Commit graph

178 commits

Author SHA1 Message Date
Dmitriy Zaporozhets
bf17d976a7 add api users filter and integrate users select2 2013-03-13 23:19:09 +02:00
Dmitriy Zaporozhets
11b57d979c Reduce amount of user info provided with internal api 2013-03-11 14:35:00 +02:00
Sebastian Ziebell
562de2a438 Merge branch 'master' into api/system_hooks_adjustments 2013-03-07 17:59:27 +01:00
Sebastian Ziebell
32f1eaaf0f API: system hooks API functions and documentation updated
* updated system hooks documentation and code comments
* fixed access to system hooks if no user given resulting in a `500 Server Error`
* added tests
2013-03-07 17:56:11 +01:00
Dmitriy Zaporozhets
a7055be1fd Merge pull request #2835 from Asquera/fixes/api
Fix API return codes
2013-03-07 08:33:34 -08:00
Sebastian Ziebell
ecf53bb9e6 API: fixes project creation and removed redundant info 2013-03-07 15:11:33 +01:00
Sebastian Ziebell
3374027e3a Merge branch 'master' into fixes/api, code clean up and tests fixed
Conflicts:
	doc/api/projects.md
	spec/requests/api/projects_spec.rb
2013-03-07 14:51:56 +01:00
Dmitriy Zaporozhets
d2cec12632 block user should not be able to push 2013-03-07 14:18:30 +02:00
Dmitriy Zaporozhets
7c408960ce Merge pull request #3146 from amacarthur/AdminAPIs
Additional Admin APIs
2013-03-06 22:57:24 -08:00
Dmitriy Zaporozhets
afee5303ff Merge pull request #3149 from m4tthumphrey/api-deploy-keys
Added methods to manage project deploy keys via API
2013-03-06 07:43:45 -08:00
Matt Humphrey
1dd712ddc2 System hooks API. 2013-03-06 15:15:26 +00:00
Sebastian Ziebell
b5ef6d2268 API: refactored and simplified error handling in merge requests API 2013-03-05 23:43:05 +01:00
Sebastian Ziebell
cce35b6d05 Fixes api 2013-03-05 22:33:45 +01:00
Sebastian Ziebell
61cfa2a7a6 Merge branch 'master' into fixes/api
Conflicts:
	lib/api/projects.rb
2013-03-05 22:29:49 +01:00
Matt Humphrey
f411772e33 Project deploy keys API 2013-03-05 21:23:29 +00:00
Angus MacArthur
61ffcab60f Additional Admin APIs 2013-03-05 10:38:43 -05:00
Andrew8xx8
0d9a6fe7b1 User's blocked field refactored to use state machine 2013-03-04 18:52:30 +04:00
Matt Humphrey
1c0c7bd6e3 Missed comma. 2013-03-01 16:36:19 +00:00
Matt Humphrey
dd653f62f3 Added namespace_id to project creation via API
This allows you to set the namespace ID for projects via the the API. By default it is created for the current user. You can assign it to the global namespace by passing `GLN` which translates to 'Global Namespace'.
2013-03-01 16:34:11 +00:00
Sebastian Ziebell
d269d107d8 API: fixed adding a note
Now the correct attribute is checked if it's available or not. Also fixed a test.
2013-02-27 18:12:02 +01:00
Sebastian Ziebell
3bb342b961 Merge branch 'master' into fixes/api 2013-02-27 17:52:59 +01:00
Sebastian Ziebell
7499f65014 API: extracted helper method to validate required parameters, code clean up
Added a helper method to check if required parameters are given in an API call. Can be used
to return a `400 Bad Request` return code if a required attribute is missing.
Code clean up and fixed tests.
2013-02-27 17:50:30 +01:00
Nihad Abbasov
3c5954b8c8 proper fix for #2300 2013-02-27 06:47:04 -08:00
Sebastian Ziebell
07f306d8af Merge branch 'master' into fixes/api 2013-02-27 15:15:47 +01:00
Sebastian Ziebell
3b3add35fb API: merge request documentation updated, added return codes to functions
The API documentation of merge requests contains info to status codes for all functions.
Required arguments are now checked in the merge requests API functions and a `400 Bad Request` error is
returned if they are not given.
2013-02-27 15:07:42 +01:00
Nihad Abbasov
8d847b89d2 API: fix commits pagination
closes #2300
2013-02-27 06:00:33 -08:00
Sebastian Ziebell
e96d77d3db API: issues documentation and API functions updated
The issues documentation is updated with infos to status codes and the deprecated `DELETE` function and
how to close an issue. A few more tests added to check status codes of API functions.
2013-02-27 14:36:20 +01:00
Sebastian Ziebell
873db06255 API: groups documentation updated, functions return different status codes
Updates the API documentation of groups with infos to return codes. The function calls
in the groups API have updated documentation and return `400 Bad Request` status code
if a required attribute is missing.
2013-02-27 12:34:45 +01:00
Sebastian Ziebell
e119b0a0cb API repository documentation updated, includes infos to return codes
The API documentation of repository is updated and now contains infos to status codes.
Code documentation is also adjusted for `GET /projects/:id/repository/commits` and includes infos to
pagination attributes. Tests are updated.
2013-02-27 11:24:12 +01:00
Sebastian Ziebell
ac4a09e9cc Merge branch 'master' into fixes/api 2013-02-27 10:16:48 +01:00
Dmitriy Zaporozhets
4e5164338a specs for api/internal 2013-02-26 22:53:59 +02:00
Sebastian Ziebell
4a60c377b8 API documentation update for milestones
Updated the milestones API documentation and added return codes descriptions.
2013-02-20 22:51:59 +01:00
Sebastian Ziebell
33c1463645 API: fixes return codes for notes, documentation updated
The notes API documentation updated with return codes. API now returns `400 Bad Request` if
required attributes are not present. Return codes are documented now, also tested in added tests.
The documentation now reflects the current state of the API.
2013-02-20 22:17:05 +01:00
Sebastian Ziebell
f0e417091c Merge branch 'master' into fixes/api
Conflicts:
	spec/requests/api/projects_spec.rb
2013-02-20 14:30:11 +01:00
Sebastian Ziebell
eefb27f5ae Merge branch 'master' into fixes/api
Conflicts:
	spec/requests/api/projects_spec.rb
2013-02-20 12:43:32 +01:00
Matt Humphrey
33c513274d Fix RESTfulness of project hook deletions by API 2013-02-20 11:35:36 +00:00
Sebastian Ziebell
1b97a2eee8 API: fixes return codes, documentation updated with status codes, tests added
The users API updated with return codes, e.g. if required parameters are missing
a `400 Bad Request` error is returned instead of `404`. Fixes return codes of functions,
e.g. deletion of a ssh key is an idempotent function now.
The API documentation is updated to reflect the current status of the API. Descriptions
are more detailed and complete, infos to return values are added to all functions.
2013-02-20 12:23:56 +01:00
Dmitriy Zaporozhets
25e4c512d4 Merge pull request #3011 from Asquera/fix_access_to_nonvisible_hook
API: fixes visibility of project hook
2013-02-20 02:45:07 -08:00
Dmitriy Zaporozhets
67465dc5ef Fix private flag for project 2013-02-19 11:45:49 +02:00
Andrew8xx8
1644117a1a Issue uses StateMachine now 2013-02-18 14:43:50 +04:00
Andrew8xx8
0b512af803 Milestone uses StateMachine now 2013-02-18 14:43:50 +04:00
Andrew8xx8
29f70acc98 Merge Request uses StateMachine now 2013-02-18 14:43:50 +04:00
Sebastian Ziebell
e9d3b96595 API: fixes visibility of project hook
When a user is not authorized to see the list of hooks for a project, he is
still able to access the hooks separately. For example if access to
`GET /projects/:id/hooks` fails and returns a `403 Unauthorized` error it is
still possible to access a hook directly via `GET /projects/:id/hooks/:hook_id`.

Fixes access, also added tests to check access and status codes of hooks.
2013-02-16 14:42:49 +01:00
Dmitriy Zaporozhets
b729728536 uppercase Gitlab version and revision constants. check api return gitlab version now 2013-02-16 14:42:22 +02:00
livedata
bbd1bfd155 fixed API access to the project 2013-02-15 15:37:06 +01:00
Sebastian Ziebell
c305eb31aa API: tests that check status codes for project branches and hooks
Status code 422 (Unprocessable Entity) returned if invalid url is given when creating
or updating a project hook.
2013-02-14 16:55:33 +01:00
Sebastian Ziebell
6df02adc7a API: status code 403 returned if new project would exceed limit
When the project limit is reached the user is not allowed to create new ones.
Instead of error code 404 the status code 403 (Forbidden) is returned with error
message via API.
2013-02-14 15:51:56 +01:00
Sebastian Ziebell
6fc3263e15 API: extracted helper method to provide 400 bad request error with description
Extracted a method for 400 error (Bad request) and adjusted code accordingly. The name of
the missing attribute is used to show which one was missing from the request. It is used to
give an appropriate message in the json response.
2013-02-13 15:48:52 +01:00
Sebastian Ziebell
54ab9bb6df API: return status code 400 if filepath of raw file blob not given 2013-02-13 14:47:59 +01:00
Sebastian Ziebell
fd01f3aacd API: fixes a few return codes for project snippets
When using project snippets via API the functions now provide status codes for
different situations other then only returning 404 error. If required parameters are missing,
e.g. `title` when creating a project snippet a 400 (Bad request) error is returned. The snippet
delete function now is idempotent and returns a 200 (Ok) regardless if the snippet with the
given id is available or not. Changing return codes of these functions has the advantage that
the 404 error is used only for resources, which are not available.

Tests added to check these status codes when handling project snippets.
2013-02-13 12:09:16 +01:00