gitlab-org--gitlab-foss/spec/lib/gitlab
Douwe Maan 029c0d79af Merge branch 'lfs-ssh-authorization-fix' into 'master'
Do not regenerate the `lfs_token` every time `git-lfs-authenticate` is called

## What does this MR do?

 Do not regenerate the `lfs_token` every time `git-lfs-authenticate` is called, instead return the saved token if one is present.

This was causing a lot of 401s, leading to 403s, as state in #22527

As it turns out, when pushing a lot of LFS objects, the LFS client was calling `git-lfs-authenticate` in the middle of the request again. This caused the `lfs_token` to be regenerated. The problem lies in that the LFS client was not aware of this change, and was still using the old token. This caused all subsequent requests to fail with a 401 error.

Since HTTP Auth is protected by Rack Attack, this 401s where immediately flagged and resulted in the IP of the user being banned. 

With this change, GitLab returns the value stored in Redis, if one is present, thus if the LFS client calls `git-lfs-authenticate` again during the request, the auth header will remain unchanged, allowing all subsequent requests to continue without issues.

## What are the relevant issue numbers?

Fixes #22527

cc @SeanPackham @jacobvosmaer-gitlab

See merge request !6551
2016-09-28 18:13:34 +00:00
..
backend Strip comments before sending keys to gitlab-shell 2016-09-16 11:49:11 +02:00
badge Render coverage badge for latest successful pipeline 2016-08-18 16:30:43 +02:00
bitbucket_import Fix spec to set import_url before attempting to create import_data 2016-07-17 20:57:11 -07:00
checks Change the order of the access rules to check simpler first, and add specs 2016-08-12 18:27:42 -04:00
ci Add validation of URL and validation of name 2016-09-19 10:07:12 +02:00
conflict Fix merge conflict size limit 2016-09-07 16:00:26 +01:00
data_builder Simplify the name for data builder, feedback: 2016-08-12 16:09:29 +08:00
database fix 2016-09-15 21:59:59 -05:00
diff Fix line commenting for the initial commit 2016-08-19 16:35:44 +01:00
downtime_check Better formatting for downtime check messages 2016-08-17 12:15:20 +02:00
email Disable “issue by email” feature until it uses a different token 2016-08-19 19:49:12 -05:00
fogbugz_import Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
gfm Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
git Enable some Rubocop cops related to new lines 2016-08-03 12:02:41 +02:00
github_import Import all GitHub comments after importing issues and PRs 2016-09-27 20:45:07 +02:00
gitlab_import Fixed gitlab.com importer missing confidential attribute 2016-09-05 17:41:48 +02:00
google_code_import Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
graphs Infinity Bug in Commit Statistics 2016-05-20 22:23:08 +02:00
import_export fix model order in import/export config and 1to1 relation issue. Added relevant specs. 2016-09-27 14:56:33 +02:00
ldap Log LDAP lookup errors and don't swallow unrelated exceptions 2016-09-28 07:44:58 +02:00
metrics Adds response mime type to transaction metric action when it's not HTML 2016-08-25 16:33:41 +02:00
middleware Fix typo in gitlab-workhorse header 2016-08-19 12:25:52 +02:00
o_auth adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
saml adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
sanitizers Improved SVG sanitizer specs to include smoke tests for clean. 2016-06-12 21:05:58 -04:00
sherlock Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
slash_commands Fix behavior around commands with optional arguments 2016-08-18 14:29:49 -05:00
sql
template Load issues and merge requests templates from repository 2016-08-16 15:50:17 -03:00
asciidoc_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
auth_spec.rb Handle LFS token creation and retrieval in the same method, and in the same Redis connection. 2016-09-28 12:13:48 -05:00
award_emoji_spec.rb Fix emoji paths in relative root configurations 2016-07-01 09:10:12 -07:00
blame_spec.rb
changes_list_spec.rb api for generating new merge request 2016-08-11 23:37:00 +07:00
closing_issue_extractor_spec.rb Don’t close issues on original project from a fork 2016-08-04 12:38:08 +02:00
color_schemes_spec.rb
current_settings_spec.rb Handle case when Redis cache returns an empty setting 2016-06-29 14:28:41 -07:00
database_spec.rb Improve Issuable.order_labels_priority 2016-06-06 11:59:49 -05:00
downtime_check_spec.rb Added checks for migration downtime 2016-07-20 12:41:56 +02:00
exclusive_lease_spec.rb
git_access_spec.rb Post-merge improve of CI permissions 2016-09-20 15:41:41 +02:00
git_access_wiki_spec.rb Fix specs after renaming authentication_capabilities 2016-09-16 11:12:22 +02:00
git_spec.rb Add spec covering 'committer_hash' 2016-09-20 10:15:43 -07:00
highlight_spec.rb Fix specs 2016-08-01 13:24:06 +02:00
incoming_email_spec.rb It's for Message-ID so it should be message_id 2016-05-20 18:23:04 -05:00
key_fingerprint_spec.rb
lazy_spec.rb Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
lfs_token_spec.rb Handle LFS token creation and retrieval in the same method, and in the same Redis connection. 2016-09-28 12:13:48 -05:00
markup_helper_spec.rb
metrics_spec.rb Tracking of custom events 2016-08-17 10:04:04 +02:00
popen_spec.rb Use 'git update-ref' for safer web commits 2016-09-02 11:49:40 +02:00
project_search_results_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
redis_spec.rb Make Gitlab::Redis.params safe for mutation 2016-09-22 15:58:40 +02:00
reference_extractor_spec.rb Remove JiraIssue model and replace references with ExternalIssue 2016-06-16 01:25:18 +03:00
regex_spec.rb
search_results_spec.rb Clean up search result classes 2016-09-06 10:12:55 +03:00
snippet_search_results_spec.rb Clean up search result classes 2016-09-06 10:12:55 +03:00
themes_spec.rb
upgrader_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
uploads_transfer_spec.rb
url_builder_spec.rb Add DiffNote model 2016-07-06 18:50:59 -04:00
url_sanitizer_spec.rb spec and fix for sanitize method 2016-07-11 09:01:09 +02:00
user_access_spec.rb changes default_branch_protection to allow devs_can_merge protection option aswell 2016-08-04 21:15:26 +01:00
version_info_spec.rb
workhorse_spec.rb Use base SHA for patches and diffs 2016-09-22 18:49:31 +01:00