Commit Graph

25 Commits

Author SHA1 Message Date
Valery Sizov 07a3532594
Geo: Remove Gitlab::LfsToken::LegacyRedisDeviseToken implementation
We kept it for smooth update only
2019-05-22 16:11:08 +10:00
Ash McKenzie 1cfa3c76a1
Include expires_in for LFS authentication payload
When using git-lfs with SSH we weren't passing in
the expires_header header which is allows large
transfers to succeed in the event the current
default of 30 mins expires.

https://github.com/git-lfs/git-lfs/blob/master/docs/api/server-discovery.md#ssh
2019-02-15 09:29:52 +11:00
Ash McKenzie 6dab9ce343
Remove ability to specify expire_time
LfsToken#token does not need the ability to specify expire_time
2019-02-11 17:36:14 +11:00
Ash McKenzie c4f1e8ed10
Move LFS auth hash creation into GitLab::LfsToken 2019-02-11 15:49:36 +11:00
Rémy Coutable 3a2abc1d50
Enable the Layout/ExtraSpacing cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-01-24 13:05:45 +01:00
Ash McKenzie 8ce86bf9a0
Revert "Revert "LfsToken uses JSONWebToken::HMACToken by default""
This reverts commit 00acef4340.
2018-12-17 17:17:39 +11:00
🤖 GitLab Bot 🤖 00acef4340 Revert "LfsToken uses JSONWebToken::HMACToken by default"
This reverts commit 22954f2202
2018-12-05 07:03:28 +00:00
Ash McKenzie 22954f2202
LfsToken uses JSONWebToken::HMACToken by default
LfsToken::HMACToken#token_valid?() will be examined and if false, look
in redis via LfsToken::LegacyRedisDeviseToken#token_valid?().
2018-12-05 15:22:37 +11:00
Ash McKenzie 3bccd2b179
Use user? instead 2018-12-05 11:53:39 +11:00
gfyoung c858f70d07 Enable frozen string for lib/gitlab/*.rb 2018-10-22 07:00:50 +00:00
Stan Hu 0232450c8a Fix Error 500 when pushing LFS objects with a write deploy key 2017-11-08 16:21:39 +00:00
Paul Charlton cb3b4a15e6 Support multiple Redis instances based on queue type 2017-07-11 03:35:47 +00:00
Patricio Cano 26678d8ea3 Fix race condition that can be triggered if the token expires right after we retrieve it, but before we can set the new expiry time. 2016-09-29 10:25:26 -05:00
Patricio Cano 2772109ac1 Handle LFS token creation and retrieval in the same method, and in the same Redis connection.
Reset expiry time of token, if token is retrieved again before it expires.
2016-09-28 12:13:48 -05:00
Patricio Cano a4944fb715 Do not regenerate the `lfs_token` every time `git-lfs-authenticate` is called, instead return the saved token if one is present. 2016-09-27 13:23:51 -05:00
Kamil Trzcinski 3c1bb3432b Revert "Revert all changes introduced by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6043"
This reverts commit 6d43c95b70.
2016-09-19 16:34:32 +02:00
Kamil Trzcinski 6d43c95b70 Revert all changes introduced by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6043 2016-09-19 13:45:28 +02:00
Kamil Trzcinski 5790684d1f Support pushing via SSH 2016-09-19 13:11:11 +02:00
Patricio Cano be09bcf074 Refactored authentication code to make it a bit clearer, added test for wrong SSH key. 2016-09-15 12:21:00 -05:00
Patricio Cano de24075ea5 Further refactoring of authentication code, and code style fixes. 2016-09-15 12:21:00 -05:00
Patricio Cano 71aff7f6a3 Use special characters for `lfs+deploy-key` to prevent a someone from creating a user with this username, and method name refactoring. 2016-09-15 12:21:00 -05:00
Patricio Cano c144db2935 Better authentication handling, syntax fixes and better actor handling for LFS Tokens 2016-09-15 12:21:00 -05:00
Patricio Cano c25630ee2c Refactored handling of the `LfsToken` and added functionality to it to simplify external code. 2016-09-15 12:21:00 -05:00
Patricio Cano 48f1a61fd5 Refactored LFS auth logic when using SSH to use its own API endpoint `/lfs_authenticate` and added tests. 2016-09-15 12:21:00 -05:00
Patricio Cano cb85cf1f0a Refactor LFS token logic to use a Redis key instead of a DB field, making it a 1 use only token. 2016-09-15 12:21:00 -05:00