Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-04-10Don't pass `env` anymore to GitAccess, ChangeAccess, and ForcePushRémy Coutable
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-03-13Backport changes from gitlab-org/gitlab-ee!1406Adam Niedzielski
2017-02-23Enable Style/MutableConstantDouwe Maan
2016-12-20Rubocop prefers to indent this wayLin Jen-Shin
2016-12-20Use consistent names and move checks to the method,Lin Jen-Shin
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
2016-12-20Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin
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 ...
2016-12-16Accept environment variables from the `pre-receive` script.Timothy Andrew
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.
2016-12-09Check project existence for push too, andLin Jen-Shin
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
2016-12-09Don't pass the actor for deploy key, feedback:Lin Jen-Shin
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_19579483
2016-12-06Prefer guest_can_download_code? and fix typoLin Jen-Shin
2016-12-06Prefer guest_can_downlod_code?Lin Jen-Shin
2016-12-06Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin
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 ...
2016-11-30Allow access to the wiki with git when repository feature disabledDouglas Barbosa Alexandre
2016-11-18Check download privilege more specifically andLin Jen-Shin
add another error message for the new error.
2016-11-17Still grant :download_code if guest could do thatLin Jen-Shin
Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_18518792
2016-11-17Check if the key could really download, feedback:Lin Jen-Shin
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_18518792
2016-11-17We never check user privilege if it's a deploy keyLin Jen-Shin
2016-11-16Introduce has_access_to? so that we could reuse itLin Jen-Shin
Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_18439108
2016-11-16Also need to check against push rules:Lin Jen-Shin
Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_18440615
2016-11-11Fix test for GitAccessWiki, it's overriding change_access_checkLin Jen-Shin
2016-11-11Add more tests and fix write to project checkLin Jen-Shin
2016-11-11So deploy key might not have a corresponding userLin Jen-Shin
2016-11-11Improve write access check for deploy keyLin Jen-Shin
2016-11-10Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin
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' ...
2016-11-09Merge branch 'fix-unathorized-cloning' into 'security'Douwe Maan
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>
2016-09-16Rename capabilities to authentication_abilitiesKamil Trzcinski
2016-09-15Fix existing authorization specsKamil Trzcinski
2016-09-15Use `build_read_container_image` and use `build_download_code`Kamil Trzcinski
2016-09-13Make result to return project and capabilities grantedKamil Trzcinski
2016-09-13Use a permissions of user to access all dependent projects from CI jobs ↵Kamil Trzcinski
(this also includes a container images, and in future LFS files)
2016-08-19added spacingAli Ibrahim
2016-08-17Allow to add deploy keys with write-accessAli Ibrahim
2016-08-11api for generating new merge requestScott Le
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
2016-08-11Merge branch 'fix-gitaccess-scope' into 'master' Rémy Coutable
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
2016-08-03Stop 'git push' over HTTP earlyJacob Vosmaer
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.
2016-07-26Fixing scope issue in GitAccess.Elliot Wiltshire
2016-07-19Allow to pull code with deploy key from public projectsKamil Trzcinski
2016-07-18Revert "Revert "Merge branch '18193-developers-can-merge' into 'master' ""Rémy Coutable
This reverts commit 530f5158e297f3cde27f3566cfe13bad74ba3b50. See !4892. Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-13Revert "Merge branch '18193-developers-can-merge' into 'master' "Robert Speicher
This reverts commit 9ca633eb4c62231e4ddff5466c723cf8e2bdb25d, reversing changes made to fb229bbf7970ba908962b837b270adf56f14098f.
2016-07-13Move all "checks" under `GitLab::Checks`.Timothy Andrew
- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4892#note_12892160 - This is more consistent.
2016-07-13Appease rubocop.Timothy Andrew
2016-07-13Refactor `Gitlab::GitAccess`Timothy Andrew
1. Don't use case statements for dispatch anymore. This leads to a lot of duplication, and makes the logic harder to follow. 2. Remove duplicated logic. - For example, the `can_push_to_branch?` exists, but we also have a different way of checking the same condition within `change_access_check`. - This kind of duplication is removed, and the `can_push_to_branch?` method is used in both places. 3. Move checks returning true/false to `UserAccess`. - All public methods in `GitAccess` now return an instance of `GitAccessStatus`. Previously, some methods would return true/false as well, which was confusing. - It makes sense for these kinds of checks to be at the level of a user, so the `UserAccess` class was repurposed for this. The prior `UserAccess.allowed?` classmethod is converted into an instance method. - All external uses of these checks have been migrated to use the `UserAccess` class 4. Move the "change_access_check" into a separate class. - Create the `GitAccess::ChangeAccessCheck` class to run these checks, which are quite substantial. - `ChangeAccessCheck` returns an instance of `GitAccessStatus` as well. 5. Break out the boolean logic in `ChangeAccessCheck` into `if/else` chains - this seems more readable. 6. I can understand that this might look like overkill for !4892, but I think this is a good opportunity to clean it up. - http://martinfowler.com/bliki/OpportunisticRefactoring.html
2016-07-13Enforce "developers can merge" during `pre-receive`.Timothy Andrew
1. When a merge request is being merged, save the merge commit SHA in the `in_progress_merge_commit_sha` database column. 2. The `pre-receive` hook looks for any locked (in progress) merge request with `in_progress_merge_commit_sha` matching the `newrev` it is passed. 3. If it finds a matching MR, the merge is legitimate. 4. Update `git_access_spec` to test the behaviour we added here. Also refactored this spec a bit to make it easier to add more contexts / conditions.
2016-07-13Added "developers can merge" setting to protected branchesMathias Vestergaard
- Cherry-picked from `mvestergaard:branch-protection-dev-merge` - https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4220
2016-07-06Revert back to not defining a default Git access protocol.Patricio Cano
2016-07-06Default Git access protocol to `web`Patricio Cano
2016-07-06Don't allow empty strings in the `protocol` check.Patricio Cano
2016-07-06Correct access control flow for Git HTTP requests.Patricio Cano
2016-07-06Raise an error if no protocol is passed to the GitAccess check.Patricio Cano
2016-07-06Rename ENV['PROTOCOL'] to ENV['GL_PROTOCOL'] to conform to what GitLab Shell ↵Patricio Cano
expects and make the `protocol` param in `GitAccess` mandatory.