Commit Graph

49 Commits

Author SHA1 Message Date
Douwe Maan 1c7a8b8c27 Fix docs 2015-07-30 11:41:59 +02:00
Douwe Maan 4fb6ddfe06 Add ability to manage user email addresses via the API. 2015-07-29 15:40:08 +02:00
Steve Norman b3a751112d Allow user to be blocked and unblocked via the API 2015-07-03 11:17:57 +00:00
Stan Hu 6548e9b48c Add 2FA status to user admin API
Closes https://github.com/gitlabhq/gitlabhq/issues/9391
2015-06-23 22:41:59 -07:00
Dmitriy Zaporozhets 7b9b3c5aab
Fix part of api specs for rubocop
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-22 15:05:19 +02:00
Nihad Abbasov c3f2de68b5 Merge pull request #8831 from bladealslayer/fix/api-user-tests
Fix user API tests succeeding for the wrong reason
2015-04-22 16:55:27 +05:00
Boyan Tabakov e5b32f3c20 Fix user API tests succeeding for the wrong reason
The requests were missing multiple required attributes, while testing for single attribute missing.
Added test for checking username as required attribute.
2015-04-22 08:03:38 +03:00
Douwe Maan 1d829ca151 Fix tests. 2015-03-27 11:10:56 +01:00
Jeroen van Baarsen 0c4a70a306 Updated rspec to rspec 3.x syntax
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-02-12 19:17:35 +01:00
Douwe Maan ab22caa97e Redirect signup page to signin page.
Resolves #1916.
2015-02-05 15:56:28 +01:00
Dmitriy Zaporozhets 939c046a98 Fix feature and tests 2015-01-08 13:21:00 -08:00
Valery Sizov 3a5ed5260b Supporting for multiple omniauth provider for the same user 2014-12-04 13:03:55 +02:00
Ciro Santilli 98db90c4c9 Factor regex error messages with spec API tests 2014-11-05 15:49:35 +01:00
Marin Jankovski d59f8abea5 Fix tests after change to regex validation message. 2014-11-05 13:58:51 +01:00
Liam Monahan 2edf212a8b Expose projects_limit through users API if UserFull. 2014-11-02 18:51:34 -05:00
Marin Jankovski 86d5a63e5e Fix failing api specs. 2014-10-06 10:19:11 +02:00
jubianchi 998cd3cb63 Improve error reporting on users API
* users (#6878, #3526, #4209): Validation error messages are now exposed through 400 responses, 409 response are sent in case of duplicate email or username
* MRs (#5335): 409 responses are sent in case of duplicate merge request (source/target branches), 422 responses are sent when submiting MR fo/from unrelated forks
* issues
* labels
* projects
2014-09-16 01:25:24 +02:00
Dmitriy Zaporozhets 4967c08786
Fix signup and project visibility
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-30 16:43:32 +03:00
Dmitriy Zaporozhets 47d6f70528
Add /api/users test for admin role. Updated CHANGELOG
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-13 19:42:17 +03:00
Dmitriy Zaporozhets ae564c97d4
Dont expose user email via API
To prevent leaking of users info we reduce amount of user information
retrieved via API for normal users.

What user can get via API:

* if not admin: only id, state, name, username and avatar_url
* if admin: all user information
* about himself: all informaion

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-13 17:46:48 +03:00
Timm Friebe 05e792b4c4 Implement GET /users/:uid/keys for admin users
Complements POST operation added in gitlabhq/gitlabhq#3146

Implement DELETE /users/:uid/keys/:id for admin users

Fix "Line is too long. [83/80]"

Use single quotes as advised

Use single quotes as advised

Use single quotes as advised

Fix missing space around { and }

Fix typo in documentation

Only catch  ActiveRecord::RecordNotFound, let other exceptions propagate

Raise a "404 Not found" if key to be deleted cannot be found
As requested by @jvanbaarsen in https://github.com/gitlabhq/gitlabhq/pull/6781#discussion_r11735114

Remove tab
Unconfigured vim on this box, grrrr./
2014-04-18 14:16:19 +02:00
Jeroen van Baarsen 5dd2f36ae1 Added API testing group 2014-04-11 21:45:56 +02:00
skv a3f645ef51 Remove deprecated finders 2014-01-19 23:39:56 +04:00
Boyan Tabakov 5b657a65d4 Added test cases to verify admin status of users created via API. 2013-09-29 19:55:09 +03:00
Boyan Tabakov 479631aafc Extended User API to expose admin and can_create_group for user creation/updating.
Also, is_admin and can_create_group are exposed in the user information.
Fixed attributes_for_keys to process properly keys with boolean values (since false.present? is false).
2013-09-29 11:47:29 +03:00
Dmitriy Zaporozhets e0e88cddd8 Fix tests 2013-09-14 22:01:31 +03:00
Izaak Alpert 5dae40f579 Update to only provide one way to get a default user
-calling build_user will now apply defaults and only override them if as: :admin is set

Change-Id: Id1d938c0967752ecc14370af54f2d88128d18c44
2013-09-11 14:04:15 -04:00
Izaak Alpert d4d4a78f83 Update User api to respect default settings
-API now respects default_projects_limit, default_can_create_group, and default_can_create_team

Change-Id: I059d060d576df1050e5371e707381c5e8c608a7a
2013-09-11 14:04:15 -04:00
Johannes Schleifenbaum cd19f82e51 Fix typos 2013-07-29 12:47:06 +02:00
Dmitriy Zaporozhets 634cbd7138 Refactor API classes. So api classes like Gitlab::Issues become API::Issues 2013-05-14 15:33:31 +03:00
Alex Denisov 28e7d1a8bf Abilities added to /user and /sign_in requests 2013-03-18 20:11:28 +00:00
Kevin Lyda 415bade302 Result of misspellings run.
Most of these are comments but a few are strings for users.

Might be an idea to run this from time to time:
https://github.com/lyda/misspell-check

It runs mostly clean now.
2013-03-17 19:46:54 +00: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
Angus MacArthur 61ffcab60f Additional Admin APIs 2013-03-05 10:38:43 -05:00
Sebastian Ziebell ac4a09e9cc Merge branch 'master' into fixes/api 2013-02-27 10:16:48 +01:00
Dmitriy Zaporozhets 5aeaf248f1 Fixing rspec after upgrade to capybara pt1 2013-02-21 13:09:47 +02: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 fd1b9fdc12 Merge branch 'extend_user_api' of https://github.com/bladealslayer/gitlabhq into bladealslayer-extend_user_api
Conflicts:
	spec/requests/api/users_spec.rb
2013-01-31 13:00:50 +02:00
Marin Jankovski 296cdd591f Add optional signup. 2013-01-18 11:57:31 +01:00
Boyan Tabakov e954438a1d Extended users API to support updating and deleting users.
Also added tests.
2012-12-18 21:24:31 +02:00
Vincent Bonmalais 80fb38de7a Remove backward compatibility of factories. 2012-11-13 22:27:45 +11:00
Nihad Abbasov c610206321 fix mass-assignment error in user create API 2012-10-19 03:23:10 -07:00
Valeriy Sizov bda0a75581 #1585 Api for user creation: rspec 2012-10-02 13:59:22 +03:00
Nihad Abbasov 1bae64d7f6 whitespace 2012-09-21 04:53:13 -07:00
Nihad Abbasov b62445813d API: SSH keys belong to user entity 2012-09-21 04:49:28 -07:00
Nihad Abbasov b6f249dc1f make API specs more organized and readable 2012-09-12 05:11:56 -07:00
Robert Speicher 232389f4e8 Clean up request specs 2012-08-25 14:19:15 -04:00
Robert Speicher b2a5344a2d Add a simple `api` method to ApiHelpers, replacing api_prefix
See docs for usage
2012-08-25 14:19:15 -04:00
Robert Speicher fba174e9bc Cleanup spec/support folder and spec/spec_helper
Changes:
* Move spec/monkeypatch to spec/support
* Remove unused support/shared_examples
* Move support/api to support/api_helpers to match module name
* Move support/login to support/login_helpers to match module name
* Move API specs to requests/api (convention over configuration)
* Remove unused support/js_patch
* Simplify login_as helper
* Move DatabaseCleaner stuff to its own support file
* Remove unnecessary configuration and requires from spec_helper
2012-08-25 14:19:15 -04:00