summaryrefslogtreecommitdiff
path: root/lib/gitlab/git_access.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add “Project moved” error to Git-over-SSHMichael Kozono2017-06-161-2/+19
|
* Extract and memoize `user_access`Michael Kozono2017-06-051-6/+9
| | | | Because it is sometimes never used.
* Remove GitAccessStatus (no longer needed)Michael Kozono2017-06-051-10/+4
|
* Refactor to remove a special caseMichael Kozono2017-06-051-7/+5
|
* Fix would-be regressionMichael Kozono2017-06-051-3/+1
| | | | | | https://gitlab.com/gitlab-org/gitlab-ce/commit/57e3e942de1adef2c8621905370f07d7da7870c4 I changed it to a separate condition rather than depending on the order of the case-when statements to prevent this mistake again.
* Clarify error messagesMichael Kozono2017-06-051-8/+26
| | | | And refactor to self-document a little better.
* Refactor to let GitAccess errors bubble upMichael Kozono2017-06-051-5/+4
| | | | | | No external behavior change. This allows `GitHttpController` to set the HTTP status based on the type of error. Alternatively, we could have added an attribute to GitAccessStatus, but this pattern seemed appropriate.
* Move CI access logic into GitAccessMichael Kozono2017-06-051-3/+17
|
* Check disabled commands in GitAccess insteadMichael Kozono2017-06-051-1/+26
|
* Fix Git over HTTP specMichael Kozono2017-06-051-4/+7
| | | | | | | | | | | * The spec has 7 failures at this point * Specify rendered error messages * Render the GitAccess message rather than “Access denied” * Render the Not Found message provided by GitAccess, instead of a custom one * Expect GitAccess to check the config for whether Git-over-HTTP pull or push is disabled, rather than doing it in the controller * Add more thorough testing for authentication * Dried up a lot of tests * Fixed some broken tests
* Don't pass `env` anymore to GitAccess, ChangeAccess, and ForcePushbackport-ee-1525Rémy Coutable2017-04-101-3/+1
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Backport changes from gitlab-org/gitlab-ee!1406adam-backport-ee-1406Adam Niedzielski2017-03-131-1/+3
|
* Enable Style/MutableConstantDouwe Maan2017-02-231-3/+3
|
* Rubocop prefers to indent this wayfeature/1376-allow-write-access-deploy-keysLin Jen-Shin2016-12-201-2/+2
|
* Use consistent names and move checks to the method,Lin Jen-Shin2016-12-201-39/+43
| | | | | | | | and move those checks to be private. Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_20285012 https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_20285279
* Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin2016-12-201-1/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/1376-allow-write-access-deploy-keys * upstream/master: (538 commits) Reject blank environment vcariables in Gitlab::Git::RevList Add online terminal documentation Add changelog entry Add terminal UI and controller actions Fix specs Even out padding on plus button in breadcrumb menu Update font size of detail page header to 14px Update CHANGELOG.md for 8.13.10 Update CHANGELOG.md for 8.14.5 Fix Route#rename_children behavior Remove inline-block styling from status Add terminals to the Kubernetes deployment service Add a ReactiveCaching concern for use in the KubernetesService Add xterm.js 2.1.0 and a wrapper class to the asset pipeline Remove unnecessary hidden svg elements for icons. Fix consistent typo in environment.js Use a block to insert extra check for authenticate_build! Align milestone column header with count number Add Wiki import to BB importer Make CI badge hitboxes better match container ...
| * Accept environment variables from the `pre-receive` script.Timothy Andrew2016-12-161-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Starting version 2.11, git changed the way the pre-receive flow works. - Previously, the new potential objects would be added to the main repo. If the pre-receive passes, the new objects stay in the repo but are linked up. If the pre-receive fails, the new objects stay orphaned in the repo, and are cleaned up during the next `git gc`. - In 2.11, the new potential objects are added to a temporary "alternate object directory", that git creates for this purpose. If the pre-receive passes, the objects from the alternate object directory are migrated to the main repo. If the pre-receive fails the alternate object directory is simply deleted. 2. In our workflow, the pre-recieve script (in `gitlab-shell) calls the `/allowed` endpoint, which calls out directly to git to perform various checks. These direct calls to git do _not_ have the necessary environment variables set which allow access to the "alternate object directory" (explained above). Therefore these calls to git are not able to access any of the new potential objects to be added during this push. 3. We fix this by accepting the relevant environment variables (GIT_ALTERNATE_OBJECT_DIRECTORIES, GIT_OBJECT_DIRECTORY) on the `/allowed` endpoint, and then include these environment variables while calling out to git. 4. This commit includes (whitelisted) these environment variables while making the "force push" check. A `Gitlab::Git::RevList` module is extracted to prevent `ForcePush` from being littered with these checks.
* | Check project existence for push too, andLin Jen-Shin2016-12-101-16/+6
| | | | | | | | | | | | | | | | | | we don't have to check for deploy key for downloading because deploy key could certainly download when it could already read the project. Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_19578626
* | Don't pass the actor for deploy key, feedback:Lin Jen-Shin2016-12-101-0/+2
| | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_19579483
* | Prefer guest_can_download_code? and fix typoLin Jen-Shin2016-12-061-2/+2
| |
* | Prefer guest_can_downlod_code?Lin Jen-Shin2016-12-061-1/+1
| |
* | Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin2016-12-061-0/+4
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/1376-allow-write-access-deploy-keys * upstream/master: (488 commits) Merge branch 'issue_25064' into 'security' It's secret variables, not secure Fix dead links, add example of debug trace output, simplify titles Authorize users into imported GitLab project Document button secondary states. Update icons and color section Remove unused votes.scss Remove unused errors css Fixed MR widget content wrapping for XS viewports NIGNX -> Nginx Use pry-byebug instead byebug Fixed influence from other specs. Accept `issue new` as command to create an issue Update paranoia from 2.1.4 to 2.2.0. Use the pagination helper in the API Added changelog for #25221 Fixed top margin for Builds page status header information Satisfied eslint Fix compatibility with Internet Explorer 11 for merge requests change the date label to match the date used fix gfm doc typo about two spaces for next line transfer ...
| * Allow access to the wiki with git when repository feature disabledDouglas Barbosa Alexandre2016-11-301-1/+5
| |
* | Check download privilege more specifically andLin Jen-Shin2016-11-181-29/+29
| | | | | | | | add another error message for the new error.
* | Still grant :download_code if guest could do thatLin Jen-Shin2016-11-181-5/+3
| | | | | | | | | | Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_18518792
* | Check if the key could really download, feedback:Lin Jen-Shin2016-11-181-1/+1
| | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_18518792
* | We never check user privilege if it's a deploy keyLin Jen-Shin2016-11-181-10/+19
| |
* | Introduce has_access_to? so that we could reuse itLin Jen-Shin2016-11-161-1/+1
| | | | | | | | | | Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_18439108
* | Also need to check against push rules:Lin Jen-Shin2016-11-161-1/+1
| | | | | | | | | | Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_18440615
* | Fix test for GitAccessWiki, it's overriding change_access_checkLin Jen-Shin2016-11-111-3/+6
| |
* | Add more tests and fix write to project checkLin Jen-Shin2016-11-111-1/+1
| |
* | So deploy key might not have a corresponding userLin Jen-Shin2016-11-111-2/+2
| |
* | Improve write access check for deploy keyLin Jen-Shin2016-11-111-45/+36
| |
* | Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin2016-11-101-29/+77
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/1376-allow-write-access-deploy-keys * upstream/master: (3852 commits) Grapify token API Fix cache for commit status in commits list to respect branches Grapify milestones API Grapify runners API Improve EeCompatCheck, cache EE repo and keep artifacts for the ee_compat_check task Use 'Forking in progress' title when appropriate Fix CHANGELOG after 8.14.0-rc1 tag Update CHANGELOG.md for 8.14.0-rc1 Fix YAML syntax on CHANGELOG entry Remove redundant rescue from repository keep_around Remove redundant space from repository model code Remove order-dependent expectation Minor CHANGELOG.md cleanups Add a link to Git cheatsheet PDF in docs readme Grapify the session API Add 8.13.5, 8.12.9, and 8.11.11 CHANGELOG Merge branch 'unauthenticated-container-registry-access' into 'security' Merge branch '23403-fix-events-for-private-project-features' into 'security' Merge branch 'fix-unathorized-cloning' into 'security' Merge branch 'markdown-xss-fix-option-2.1' into 'security' ...
| * Merge branch 'fix-unathorized-cloning' into 'security'Douwe Maan2016-11-091-31/+60
| | | | | | | | | | | | | | | | | | | | Ensure external users are not able to clone disabled repositories. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/23788 See merge request !2017 Signed-off-by: Rémy Coutable <remy@rymai.me>
| * Rename capabilities to authentication_abilitiesKamil Trzcinski2016-09-161-6/+6
| |
| * Fix existing authorization specsKamil Trzcinski2016-09-151-1/+1
| |
| * Use `build_read_container_image` and use `build_download_code`Kamil Trzcinski2016-09-151-4/+4
| |
| * Make result to return project and capabilities grantedKamil Trzcinski2016-09-131-6/+6
| |
| * Use a permissions of user to access all dependent projects from CI jobs ↵Kamil Trzcinski2016-09-131-3/+16
| | | | | | | | (this also includes a container images, and in future LFS files)
* | added spacingAli Ibrahim2016-08-191-0/+1
| |
* | Allow to add deploy keys with write-accessAli Ibrahim2016-08-171-5/+12
|/
* api for generating new merge requestScott Le2016-08-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | DRY code + fix rubocop Add more test cases Append to changelog DRY changes list find_url service for merge_requests use GET for getting merge request links remove files rename to get_url_service reduce loop add test case for cross project refactor tiny thing update changelog
* Merge branch 'fix-gitaccess-scope' into 'master' Rémy Coutable2016-08-111-1/+1
|\ | | | | | | | | | | | | | | | | | | | | Fixing scope issue in GitAccess. This MR fixes a scoping issue around the GitAccessStatus.new call - it needs to be scoped to the Gitlab otherwise it can end up being confused with the GitAccessStatus class in gitlab-shell, which has a 3-element constructor. Although not strictly necessary for community GitLab, it is more correct, and fixes an issue we (Perforce) found due to our engine overrides. This change should have any affect on community GitLab. See merge request !5483
| * Fixing scope issue in GitAccess.Elliot Wiltshire2016-07-251-1/+1
| |
* | Stop 'git push' over HTTP earlyJacob Vosmaer2016-08-031-1/+1
|/ | | | | | | | | | | | Before this change we always let users push Git data over HTTP before deciding whether to accept to push. This was different from pushing over SSH where we terminate a 'git push' early if we already know the user is not allowed to push. This change let Git over HTTP follow the same behavior as Git over SSH. We also distinguish between HTTP 404 and 403 responses when denying Git requests, depending on whether the user is allowed to know the project exists.
* Allow to pull code with deploy key from public projectsallow-deploy-key-to-download-public-projectsKamil Trzcinski2016-07-191-0/+1
|
* Revert "Revert "Merge branch '18193-developers-can-merge' into 'master' ""Rémy Coutable2016-07-181-113/+30
| | | | | | | | This reverts commit 530f5158e297f3cde27f3566cfe13bad74ba3b50. See !4892. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Revert "Merge branch '18193-developers-can-merge' into 'master' "Robert Speicher2016-07-131-30/+113
| | | | | This reverts commit 9ca633eb4c62231e4ddff5466c723cf8e2bdb25d, reversing changes made to fb229bbf7970ba908962b837b270adf56f14098f.
* Move all "checks" under `GitLab::Checks`.Timothy Andrew2016-07-131-1/+1
| | | | | - https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4892#note_12892160 - This is more consistent.