Commit Graph

83 Commits

Author SHA1 Message Date
GitLab Bot f459f810d5 Add latest changes from gitlab-org/gitlab@master 2023-10-27 15:09:34 +00:00
GitLab Bot fdb5a6d73c Add latest changes from gitlab-org/gitlab@master 2023-10-05 03:08:14 +00:00
GitLab Bot ec558ad8ed Add latest changes from gitlab-org/gitlab@master 2023-01-25 15:09:25 +00:00
GitLab Bot 26dfad7651 Add latest changes from gitlab-org/gitlab@master 2022-11-03 03:10:45 +00:00
GitLab Bot 51bc2d8e70 Add latest changes from gitlab-org/gitlab@master 2022-10-05 18:08:18 +00:00
GitLab Bot d489dd79cf Add latest changes from gitlab-org/gitlab@master 2022-05-03 00:08:25 +00:00
GitLab Bot e9c3815d3d Add latest changes from gitlab-org/gitlab@master 2022-02-23 09:12:16 +00:00
GitLab Bot 155f106fd5 Add latest changes from gitlab-org/gitlab@master 2021-08-19 15:10:29 +00:00
GitLab Bot c241fef181 Add latest changes from gitlab-org/gitlab@master 2021-07-27 18:10:54 +00:00
GitLab Bot a1aeaba23e Add latest changes from gitlab-org/gitlab@master 2020-09-03 09:08:20 +00:00
GitLab Bot 207ec5c078 Add latest changes from gitlab-org/gitlab@master 2020-07-12 09:09:08 +00:00
GitLab Bot 2f147005c5 Add latest changes from gitlab-org/gitlab@master 2020-07-11 00:09:17 +00:00
GitLab Bot ed16c9434e Add latest changes from gitlab-org/gitlab@master 2020-06-18 18:08:58 +00:00
Marin Jankovski 49d689fb3c
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq 2019-07-03 11:55:42 +02:00
Stan Hu ee791d3f40 Enable Gitaly ref caching for SearchController
As we noticed in
https://gitlab.com/gitlab-org/gitlab-ce/issues/56627#note_185828742,
clicking on the "Issues" tab often requests the same reference in
rendering Markdown.
2019-06-26 16:24:46 -07:00
Luke Duncalfe ba377e91e1 Authorize access before serving project template
Previously, if a user was a guest member of a private project, they
could access the merge request template as we were not checking
permission-levels of the user.

When a issue template is asked for, the user must have :read_issue for
the project; or :read_merge_request when a merge request template is
asked for.

We also now rescue_from FileNotFoundError and handle as 404. This is
because RepoTemplateFinder can raise a FileNotFoundError exception,
which Rails previously handled as a 500.

Handling these in a way that is consistent with
ActiveRecord::RecordNotFound exceptions, within controllers that
inherit from Projects::ApplicationController at least, and returning a
404.

https://gitlab.com/gitlab-org/gitlab-ce/issues/54943
2019-06-11 08:21:04 +12:00
James Edwards-Jones bedb9a3e6d Avoid passing not_found_or_authorized_proc around
Since this needs to be called on every find_routable!(Project, ...
we can instead move it to a RoutableActions check.
2019-05-15 17:36:50 +07:00
Stan Hu f2fa7c3299 Fix and expand Gitaly FindCommit caching
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/26248 added
support for deduplicating FindCommit requests using Gitaly ref name
caching. However, not all endpoints were covered, and in one case the
Gitaly wrapper wasn't actually surrounding the serialization step. We
can safely cache ref names between FindCommit calls for #index and #show
endpoints for merge requests and pipelines. This can significantly
reduce the number of FindCommit requests.
2019-04-04 13:42:58 -07:00
Andrew Newdigate 3288e1a874 Adds the Rubocop ReturnNil cop
This style change enforces `return if ...` instead of
`return nil if ...` to save maintainers a few minor review points
2019-03-06 17:51:56 +02:00
Thong Kuah 28dabc67f4 Restore 403 functionality for external auth (EE)
When we unhooked ClustersController from
Project::ApplicationsController, we missed an EE override to
handle_not_found_or_authorized.

Rather than carry on with override RoutingActions, make a specific proc
for Project that we override in EE instead. Use that proc in both
Clusters::BaseController and Project::ApplicationsController.
2018-11-01 19:37:32 +13:00
gfyoung 12ee2753c1 Enable even more frozen string in app/controllers
Enables frozen string for some vestigial files as
well as the following:

* app/controllers/projects/**/*.rb
* app/controllers/sherlock/**/*.rb
* app/controllers/snippets/**/*.rb
* app/controllers/users/**/*.rb

Partially addresses #47424.
2018-09-25 22:43:49 -07:00
Stan Hu b9cee4ba3c Set issuable_sort and diff_view cookies to secure when possible
Closes #49120
2018-09-03 22:37:36 -07:00
Lin Jen-Shin 4ee08b77bc Updates from `rubocop -a` 2018-07-09 21:13:08 +08:00
blackst0ne 350e26b8a6 [Rails5] Use `safe_params` instead of `params` in `url_for` helpers
This commits replaces `params` with `safe_params` in `url_for` helpers
to resolve security issues [1] and failing specs with the

```
ArgumentError:
  Attempting to generate a URL from non-sanitized request parameters!
  An attacker can inject malicious data into the generated URL, such as
  changing the host. Whitelist and sanitize passed parameters to be secure.
```

error.

[1]: https://gitlab.com/gitlab-org/gitlab-ce/issues/45168
2018-04-28 21:35:16 +11:00
Bob Van Landuyt 12dd2b0cc0 Share collaboration check between view and presenter 2018-04-11 10:51:15 +02:00
Bob Van Landuyt 8ad9c4e873 Rename `create_merge_request` permissions
So we can distinguish between the permissions on the source and the
target project.

- `create_merge_request_from` indicates a user can create a merge
  request with the project as a source_project
- `create_merge_request_in` indicates a user can create a merge
  request with the project as a target_project
2018-04-11 10:51:15 +02:00
Bob Van Landuyt ec43e36444 Prevent new merge requests for archived projects
This prevents creating merge requests targeting archived projects.

This could happen when a project was already forked, but then the
source was archived.
2018-04-11 10:51:14 +02:00
Bob Van Landuyt e74879280f Allow maintainers to edit directly in a fork 2018-03-07 16:55:34 +01:00
Christiaan Van den Poel 66ebb206b0 disables the shortcut to the issue boards when issues are disabled 2018-01-08 09:06:25 +00:00
Jen-Shin Lin bd46c8abfd Merge branch 'security-10-1' into '10-1-stable'
Security fixes for 10.1 RC

See merge request gitlab/gitlabhq!2209
2017-10-17 15:58:58 -07:00
Zeger-Jan van de Weg 04cd47dd5a
Don't show references to Pages when not available
In this instance its subgroups, and given we can't deploy it, we
shouldn't allow it to be shown.

Fixes gitlab-org/gitlab-ce#34864
2017-08-31 09:27:42 +02:00
Nick Thomas e4391c7190 Backport changes from https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2328 2017-07-21 18:45:12 +01:00
Douwe Maan fe13f11041 Create and use project path helpers that only need a project, no namespace 2017-07-05 11:11:59 -05:00
Nick Thomas 8e5bf9d8dc Use the new check_project_feature_available! method in project controllers 2017-06-21 10:56:45 +01:00
Nick Thomas 03228cb5b6 Backport check_project_feature_available! from EE 2017-06-21 10:56:45 +01:00
Kamil Trzcinski 25b99a5b3b Update tests and application 2017-06-13 16:05:38 +02:00
Michael Kozono 49697bc8df Refactor to more robust implementation
In order to avoid string manipulation or modify route params (to make them unambiguous for `url_for`), we are accepting a behavior change:

When being redirected to the canonical path for a group, if you requested a group show path starting with `/groups/…` then you’ll now be redirected to the group at root `/…`.
2017-05-19 09:13:27 -07:00
Kamil Trzciński 6ad3814e1b Merge branch 'feature/gb/manual-actions-protected-branches-permissions' into 'master'
Check access to a branch when user triggers manual action

Closes #20261

See merge request !10494
2017-05-06 17:17:02 +00:00
Michael Kozono e1c245af51 Resolve discussions 2017-05-05 12:12:51 -07:00
Michael Kozono f05469f99b Resolve discussions 2017-05-05 12:12:50 -07:00
Michael Kozono 9e48f02ea8 Dry up routable lookups. Fixes #30317
Note: This changes the behavior of user lookups (see the spec change) so it acts the same way as groups and projects. Unauthenticated clients attempting to access a user page will be redirected to login whether the user exists and is publicly restricted, or does not exist at all.
2017-05-05 12:12:50 -07:00
Michael Kozono 7d02bcd2e0 Redirect from redirect routes to canonical routes 2017-05-05 12:11:57 -07:00
Grzegorz Bizon 61dd92aaff Authorize build update on per object basis 2017-05-05 14:04:45 +02:00
Mark Fletcher 3ce95e7c16 Disable navigation to Pages config if Pages is disabled
* Regards project-level pages config
- Nav link is now shown only if Pages is enabled for instance
- Navigation to following controllers denied if Pages disabled:
  * projects/pages_controller
  * projects/pages_domains_controller
- 'disabled' partial removed
+ Test for pages_controller introduced
2017-05-04 14:11:40 +08:00
Douwe Maan d170133bde Refactor changing files in web UI 2017-04-20 00:37:44 +00:00
Jacopo 7b04b63eeb New directory from interface on existing branch
The user can create a new directory on a different branch than the
source branch when the branch already exists.
2017-03-21 11:51:53 +01:00
Sam Rose 3c4dc43384 Dispatch needed JS when creating a new MR in diff view 2017-02-14 13:39:42 -05:00
Sean McGivern b7685ad113 Merge branch 'git_to_html_redirection' into 'master'
Redirect http://someproject.git to http://someproject

Closes #26275

See merge request !8951
2017-02-03 21:06:02 +00:00
blackst0ne 63dac85385 Fixed redirection from http://someproject.git to http://someproject 2017-02-04 00:00:26 +11:00
Adam Pahlevi a0586dbc16 replace `find_with_namespace` with `find_by_full_path`
add complete changelog for !8949
2017-02-03 07:14:04 +07:00