summaryrefslogtreecommitdiff
path: root/lib/gitlab_net.rb
Commit message (Collapse)AuthorAgeFilesLines
* Explicitly include gitlab_access_status.rbAsh McKenzie2019-04-041-0/+1
|
* Remove hooks, they belong to Gitaly nowJacob Vosmaer2019-04-031-1/+0
|
* Disable rubocop for old (<2.2) hash syntaxJonathon Reinhart2018-12-131-1/+1
| | | | See the discussion on gitlab-org/gitlab-shell!166
* Use 'push_options' everywhere instead of 'push_opts'Jonathon Reinhart2018-12-131-2/+2
|
* Pass push options to GitLab /internal/post_receive APIJonathon Reinhart2018-12-131-2/+3
| | | | | | | | | | push_opts[] is named as such so that it becomes an array in the GitLab internal Grape::API params hash. If it were named push_opts, only the final (scalar) push_opts parameter would be present. Also update specs to include push_opts parameter: - gitlab_post_receive_spec - gitlab_net_spec for the internal API change
* Revert "Merge branch 'sh-bump-ruby-version' into 'master'"Douwe Maan2018-12-131-18/+8
| | | This reverts merge request !257
* Upgrade to Ruby 2.5.3Stan Hu2018-12-131-8/+18
|
* Remove circular dependency between HTTPHelper and GitlabNetsh-fix-circular-dependency-errorsStan Hu2018-11-271-3/+0
| | | | | | | | | HttpHelper depended on exceptions defined in GitLabNet, but GitLabNet included HttpHelper. Specs in Ruby 2.5 were breaking as a result of Action::Custom not able to reference constants in GitLabNet: https://gitlab.com/gitlab-org/gitlab-shell/-/jobs/126362702. Closes https://gitlab.com/gitlab-org/gitlab-shell/issues/169
* Include LFS operation when making auth requestashmckenzie/8114-geo-push-ssh-lfs-http-auth-bugAsh McKenzie2018-11-081-14/+8
| | | | Operation is either upload or download
* Changes the HTTP error code from Gateway timeout to Service Unavailableadd-http-gateway-time-out-handlingTiago Botelho2018-10-241-1/+1
|
* Adds handling of Net::HTTPGatewayTimeOut exception to GitlabNetTiago Botelho2018-10-241-1/+1
|
* Ensure text/plain & text/html content typs are handled and add missing specs ↵Ash McKenzie2018-09-111-5/+9
| | | | for handled HTTP status codes
* Custom Action supportash.mckenzie/custom-action-supportAsh McKenzie2018-09-081-3/+3
|
* GitAccessStatus initializer sensible defaultsAsh McKenzie2018-09-071-8/+1
|
* Move some GitlabNet requires into HTTPHelperAsh McKenzie2018-09-071-2/+0
|
* /api/v4/allowed returns proper HTTP status codesAsh McKenzie2018-09-071-1/+2
| | | | | * Previously, a 200 (OK) was sent when the user was unauthorised or the project was not found (or the user didn't have access) * We still treat 401 and 404 as 'success' but we need to explicitly handle them
* Fix handling non 200 response codeszj-fix-non-200-resp-codeZeger-Jan van de Weg2018-09-051-1/+0
| | | | | | | | | After the cleanup in https://gitlab.com/gitlab-org/gitlab-shell/merge_requests/231 gitlab-shell mishandled the non 200 response codes. This commit removes another few lines of codes, which fixes this. Also now we test against this case through mocking. Fixes https://gitlab.com/gitlab-org/gitlab-shell/issues/152
* Restore "Pass custom git_config_options to Gitalyo"Nick Thomas2018-08-141-0/+1
| | | | This reverts commit 764f6f47fa6a8698ae033532ae49875a87030518.
* Revert "Merge branch 'ash.mckenzie/srp-refactor' into 'master'"Nick Thomas2018-08-141-55/+94
| | | | | This reverts commit 3aaf4751e09262c53544a1987f59b1308af9b6c1, reversing changes made to c6577e0d75f51b017f2f332838b97c3ca5b497c0.
* GitlatNet#discover only parse JSON if a 200Ash McKenzie2018-08-011-1/+1
|
* Merge remote-tracking branch 'origin/master' into ash.mckenzie/srp-refactorAsh McKenzie2018-08-011-7/+10
|\
| * Add support for SSH certificate authenticationÆvar Arnfjörð Bjarmason2018-07-261-17/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This along with the code submitted to gitlab-ce in the gitlab-org/gitlab-ce! MR implements SSH certificate authentication. See the docs added to gitlab-ce for why and how to enable this. This, along with that MR, closes gitlab-org/gitlab-ce#3457 Implementation notes: - Because it's easy to do, and because an earlier nascent version of this would pass user-ID to gitlab-shell, that's now supported, even though the SSH certificate authentication uses username-USERNAME. - The astute reader will notice that not all the API calls in gitlab-ce's lib/api/internal.rb support a "username" argument, some only support "user_id". There's a few reasons for this: a) For this to be efficient, I am bending over backwards to avoid extra API calls when using SSH certificates. Therefore the /allowed API call will now return a "user id" to us if we're allowed to proceed further. This is then fed to existing APIs that would only be called after a successful call to /allowed. b) Not all of the git-shell codepaths go through /internal/allowed, or ever deal with a repository, e.g. the argument-less "Welcome to GitLab", and /internal/2fa_recovery_codes. These need to use /internal/discover to figure out details about the user, so support looking that up by username. c) Once we have the "user id", the GL_ID gets passed down to e.g. user-authored hooks. I don't want to have those all break by having to handle a third GL_ID mode of "username" in addition to the current "key id" and "user id".
* | Use actor when we don't know if it's a Key or UserAsh McKenzie2018-08-011-15/+14
| | | | | | | | | | | | * Use gl_id when we don't know if it's a key-X or user-X * Use Actor.new_from(gl_id) which will figure out if it's a Key or User * Use key_str when we're referring to key-X as key_id is confusing
* | Rename NotFound -> NotFoundErrorAsh McKenzie2018-08-011-2/+2
| |
* | Utilise new ActionsAsh McKenzie2018-08-011-17/+30
| | | | | | | | | | | | | | | | | | | | * Move gitaly, git-lfs and 2FA logic out from gitlab_shell.rb * Streamline parsing of origin_cmd in GitlabShell * Utilise proper HTTP status codes sent from the API * Also support 200 OK with status of true/false (ideally get rid of this) * Use HTTP status constants * Use attr_reader definitions (var over @var) * Rspec deprecation fixes
* | Tidy up GitlabNetAsh McKenzie2018-08-011-7/+2
| | | | | | | | | | * Remove HTTP related requires * Make protocol = GL_PROTOCOL the default
* | actor is always key_id in GitlabNetAsh McKenzie2018-08-011-7/+2
| |
* | Use HTTP status constants in GitLabNetAsh McKenzie2018-08-011-24/+11
| |
* | Move HTTP related exceptions into HTTPHelperAsh McKenzie2018-08-011-3/+0
| |
* | Move GL_PROTOCOL into GitlabNetAsh McKenzie2018-07-301-0/+1
|/
* Support HTTP headers and sending JSONAsh McKenzie2018-07-201-1/+1
|
* Rename HTTPHelper#host to #internal_api_endpointAsh McKenzie2018-07-201-11/+11
|
* Move HTTP logic out into HTTPHelperAsh McKenzie2018-07-201-104/+3
|
* Switch to structured loggingJacob Vosmaer (GitLab)2018-03-191-7/+5
|
* Update files to pass modern rubocop checks. Disable some of themdz-update-depsDmitriy Zaporozhets2018-02-221-13/+11
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Update rubocop and code to pass itDmitriy Zaporozhets2018-02-221-8/+8
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Remove special case treatment of Geo nodes for SSHStan Hu2018-01-121-2/+1
| | | | | | | We removed SSH support in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3553, so we no longer need the ability to show all refs for Geo nodes. Closes #115
* Remove direct redis integrationNick Thomas2018-01-121-25/+0
|
* pass gl_username through to hooksDavid Turner2017-09-281-1/+7
|
* Support new /internal/pre-receive API endpoint for post-receivegitaly-redis-refactorAlejandro Rodríguez2017-09-051-0/+8
|
* Support new /internal/post-receive API endpointAlejandro Rodríguez2017-08-301-0/+14
|
* Make geo_node a default parametersh-show-all-refsStan Hu2017-07-241-1/+1
|
* Support unhiding of all refs for Geo NodesStan Hu2017-07-211-1/+1
| | | | | | By default, we hide certain refs (e.g. keep-around/XXX) to save user download time. We need to preserve these references on secondary Geo nodes to have a true copy.
* Handle internal API errors when getting merge request URLsonly-parse-mr-urls-on-successSean McGivern2017-07-121-1/+8
|
* Revert "Merge branch ↵revert-gl-repositoryAlejandro Rodríguez2017-07-031-7/+6
| | | | | | | '86-follow-up-from-use-gl_repository-if-present-when-enqueing-sidekiq-postreceive-jobs' into 'master'" This reverts commit fa6343515ba65423e9de4c98c6005facc6059938, reversing changes made to 62af7f6af72728cecb98c5275d8b7aeb3953e564.
* Merge branch 'master' into remove-references-to-v3-internal-apiDmitriy Zaporozhets2017-06-211-6/+7
|\ | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * Remove old `project` parameter, use `gl_repository` instead86-follow-up-from-use-gl_repository-if-present-when-enqueing-sidekiq-postreceive-jobsAlejandro Rodríguez2017-06-201-6/+7
| |
* | Remove references to V3 internal APIremove-references-to-v3-internal-apiAdam Niedzielski2017-06-161-12/+8
|/ | | | | | | In the main Rails app we use exactly the same code for /api/v3/internal and /api/v4/internal This means that we can move gitlab-shell to V4 in preparation for sunsetting V3
* Setup use of gl-repository to enqueue PostReceive sidekiq jobsAlejandro Rodríguez2017-05-111-1/+0
|
* Handle GL_REPOSITORY env variable and use it in api callsAlejandro Rodríguez2017-05-111-6/+11
|