Commit Graph

189 Commits

Author SHA1 Message Date
Rémy Coutable 670b2eb5c0
Merge branch 'api-fix-project-group-sharing' into 'security'
API: Share projects only with groups current_user can access

Aims to address the issues here: https://gitlab.com/gitlab-org/gitlab-ce/issues/23004

* Projects can be shared with non-existent groups
* Projects can be shared with groups that the current user does not have access to read

Concerns:

The new implementation of the API endpoint allows projects to be shared with a larger range of groups than can be done via the web UI.

The form for sharing a project with a group uses the following API endpoint to index the available groups: 494269fc92/lib/api/groups.rb (L17). The groups indexed in the web form will only be those groups that the user is currently a member of.

The new implementation allows projects to be shared with any group that the authenticated user has access to view. This widens the range of groups to those that are public and internal.

See merge request !2005

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-10-11 20:36:26 +02:00
Sean McGivern 0a1baaa80f Tidy up project list actions 2016-10-05 12:13:58 +01:00
Ben Boeckel e956a24dfd api: add /projects/visible API endpoint
FIxes #19361, #3119.
2016-10-04 17:23:18 +01:00
Felipe Artur 93d849beae Expose project share expiration_date field on API 2016-09-28 10:12:49 -03:00
Rémy Coutable 7458126111 API: Return 404 when trying to fork to unaccessible namespace
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-22 12:15:45 +02:00
Felipe Artur e0067d1850 Allow to set request_access_enabled for groups and projects using API 2016-09-19 12:13:57 -03:00
Rémy Coutable 3a58dd2d8f
Use Search::GlobalService.new in the `GET /projects/search/:query` endpoint
Also streamline the sorting part while we're at it.

That being done, there's currently a duplication between
`GET /projects/search/:query` and `GET /projects?search=:search`
so we might want to keep only the latter for 9.0...

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-12 10:34:03 +02:00
Razzeee 874ad681cd Search should compare only the lowercase versions of the project names 2016-09-09 15:19:18 +02:00
Olaf Tomalka 636db1515c Higher code quality for fork to namespace API 2016-09-06 23:51:08 +02:00
Olaf Tomalka 3aa40153e0 Improved code quality on API fork namespace feature 2016-09-06 10:52:42 +02:00
Olaf Tomalka bad3fb895c Added fork API paremeter for a specific namespace
Browser interface allows forking to an owned grup.
This commit brings API up to speed by providing optional namespace
parameter to fork API. This allows forking to users and groups under
forker's control using their id or unique name.

Fixes #21591
2016-09-06 04:16:14 +02:00
Felipe Artur 892dea6771 Project tools visibility level 2016-09-01 11:47:59 -03:00
Patricio Cano cf37d623e1 Renamed `enable_lfs` to `lfs_enabled` for the Project field, and related fixes. 2016-08-30 17:17:45 -05:00
Patricio Cano 0227e98d0d Added CHANGELOG, documentation, and API functionality 2016-08-30 16:17:41 -05:00
Marc Dequènes (Duck) 31b2c1ef88 expose 'only_allow_merge_if_build_succeeds' project setting in the API 2016-08-24 17:11:48 +09:00
Stan Hu 4955a47cb1 Clean up project destruction
Instead of redirecting from the project service to the service and back to the model,
put all destruction code in the service. Also removes a possible source of failure
where run_after_commit may not destroy the project.
2016-08-10 09:28:21 -07:00
Robert Schilling 839aec1a61 Replace parse_boolean with to_boolean 2016-07-20 08:55:44 +02:00
tiagonbotelho 563b303bde removes basicprojectwithaccess and replaces it with basicprojectdetails 2016-07-12 17:32:40 +01:00
tiagonbotelho 8d9e649c24 changes the usage of simpleprojectdetails to already implemented basicprojectsdetails and changes the url to a more reader friendly format 2016-07-12 16:40:49 +01:00
tiagonbotelho 2179c4052e adds basic functionality to the new endpoint of the api 2016-07-12 16:39:25 +01:00
tiagonbotelho be3409ab7a changes string to symbol in param 2016-07-12 16:36:42 +01:00
tiagonbotelho c4dc0f52c3 adds test to check json fields on simple request and changes the url request format 2016-07-12 16:36:42 +01:00
tiagonbotelho f5d92d120e changes the usage of simpleprojectdetails to already implemented basicprojectsdetails and changes the url to a more reader friendly format 2016-07-12 16:36:42 +01:00
tiagonbotelho a8cf4e13b3 adds basic functionality to the new endpoint of the api 2016-07-12 16:36:42 +01:00
tiagonbotelho e1c5eb480e implements filter_params 2016-07-12 16:36:42 +01:00
Grzegorz Bizon 9e211091a8 Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
Kamil Trzcinski 0958f331d1 Merge remote-tracking branch 'origin/master' into docker-registry
# Conflicts:
#	config/initializers/1_settings.rb
2016-05-13 17:14:46 -05:00
Sean McGivern 97424ea544 Restrict starred projects to viewable ones
`User#starred_projects` doesn't perform any visibility checks. This has
a couple of problems:

1. It assumes a user can always view all of their starred projects in
   perpetuity (project not changed to private, access revoked, etc.).
2. It assumes that we'll only ever allow a user to star a project they
   can view. This is currently the case, but bugs happen.

Add `User#viewable_starred_projects` to filter the starred projects by
those the user either has explicit access to, or are public or
internal. Then use that in all places where we list the user's starred
projects.
2016-05-10 18:13:52 +01:00
Kamil Trzcinski 0094d8f196 Rename `images` to `container_registry` 2016-05-09 20:29:57 +03:00
Kamil Trzcinski 03b3fe13f6 Make images_enabled configurable 2016-04-29 16:45:00 +02:00
Robert Schilling 54231aa4e0 Styling changes to code and docs 2016-04-13 16:25:24 +02:00
Robert Schilling 3ab9ea8dae Make staring API more restful 2016-04-13 14:26:41 +02:00
Robert Schilling ea2193aaeb API: Star and unstar a project 2016-04-13 14:26:40 +02:00
Zeger-Jan van de Weg 3549d7c1d4 PUT becomes POST on archiving endpoints
Also the specs have a minor improvement. Mainly the access right spec.
Changes are reflected in the docs
2016-03-24 18:58:42 +01:00
Zeger-Jan van de Weg 2c5bcf2e1b Add endpoints for archiving and unarchiving 2016-03-23 22:36:35 +01:00
Dmitriy Zaporozhets e8b3b92dde
Bring share project with group API from EE
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-03-13 11:52:43 +01:00
Kamil Trzcinski b4c36130cc Rename allow_guest_to_access_builds to public_builds 2016-02-04 12:57:46 +01:00
Kamil Trzcinski 6a5a175d9f Expose allow_guest_to_access_builds in GitLab API 2016-02-04 11:14:12 +01:00
Josh Frye 91b9cbff8d First pass at deleting projects in the background. 2016-01-29 09:14:16 -05:00
Douwe Maan 9664424cab Merge branch 'ci/api-projects' into 'master'
Extend projects API with CI data

Reference #4264 

See merge request !2303
2016-01-13 13:32:35 +00:00
Tomasz Maczukin fc4108b38b Modify CI features in projects API 2016-01-11 15:27:20 +01:00
Douwe Maan 1886d727f7 Add API project upload endpoint 2016-01-07 13:37:14 +01:00
Tomasz Maczukin ba9799b42f Update ./doc/api 2016-01-07 10:39:02 +01:00
Tomasz Maczukin 0a21731e3b Add ci fields in project create/update feature API 2016-01-05 15:00:25 +01:00
Stan Hu 086cfc8685 Fix API project lookups when querying with a namespace with dots
Attempting to use the /projects/:id API by specifying :id in
"namespace/project" format would always result in a 404 if the namespace
contained a dot.

The reason? From http://guides.rubyonrails.org/routing.html#specifying-constraints:

"By default the :id parameter doesn't accept dots - this is because the dot is
used as a separator for formatted routes. If you need to use a dot within an
:id add a constraint which overrides this - for example id: /[^\/]+/ allows
anything except a slash."

Closes https://github.com/gitlabhq/gitlabhq/issues/9573
2016-01-03 15:08:44 -08:00
Stan Hu 301a30e0ea Add project permissions to all project API endpoints
This standardizes all the project API formats. Also needed to support Huboard.
2015-12-22 10:58:23 -08:00
Zeger-Jan van de Weg c36821df9f Api support for requesting starred projects for user
Fixes #4112
2015-12-16 21:46:00 +01:00
Kamil Trzcinski e80e3f5372 Migrate CI::Project to Project 2015-12-11 18:02:09 +01:00
Stan Hu 631a30276e Fix API setting of 'public' attribute to false will make a project private
Closes #3864
2015-12-05 17:39:36 -08:00
Kamil Trzcinski 6384c757b7 Expose CI enable option in project features
- Enable CI by default for all new projects
2015-11-13 10:52:50 +01:00