Specification overview
The following documentation lists only the status codes returned by the method itself, if you get a response code not listed here, try the General response codes page.
Basic user management
Basic user management takes care of the very basic functionalities related to user management. It allows you to get a list of users, add a user to the system, set/verify the password and delete a user. The basic user management facilities provided by RestAuth are as simple as in any way possible. For all important operations you only have to check the status code returned to get the answer to your question - there is no need to parse the response body at all. The only exception to this is getting a list of all known users.
what | method | URI | parameters | notable status codes |
---|---|---|---|---|
Create a user | POST | /users/ |
|
|
Get a list of users | GET | /users/ |
| |
Verify that a user exists | GET | /users/<user>/ |
| |
Verify password | POST[1] | /users/<user>/ |
|
|
Change password | PUT | /users/<user>/ |
|
|
Delete a user | DELETE | /users/<user>/ |
|
- ↑ Following the REST paradigm, this really should be a GET request, not a POST request. GET requests have one major disadvantage, though: GET parameters are usually logged in the log-files of your webserver. This would mean that a password verification request to users/<username>?password=<password> would be logged. There are ways around logging this, but in our opinion services should always be "secure by default".
Managing user properties
It is possible to use RestAuth to store user properties like email-addresses, real names, etc. The keys that applications use for certain properties is by convention only, so applications have to take care to map their internal names for a property to the name RestAuth knows about.
what | method | request | parameters | status codes |
---|---|---|---|---|
Get all properties | GET | /users/<user>/props/ |
| |
Create a new property | POST | /users/<user>/props/ |
|
|
Set values of multiple properties | PUT | /users/<user>/props/ |
A dictionary of key/value pairs of properties to set. |
|
Get value of a property | GET | /users/<user>/props/<prop>/ |
| |
Set value of a property | PUT | /users/<user>/props/<prop>/ |
|
|
Delete a property | DELETE | /users/<user>/props/<prop>/ |
|
Group management
Many systems use a group based model to manage privileges granted to individual users. You can use RestAuth to manage the groups that a user is in. Services always only have access to their own set of groups, so e.g. becoming administrator in one service does not make you administrator in any other service. It is however possible to inherit group membership from other groups, that are not necessarily associated with any service. So you could define an 'admin' group and define that the admin group of every service inherits its members from that general group. It is not possible for a service to manage groups outside of its own scope, including groups not associated with any service.
what | method | request | parameters | status codes |
---|---|---|---|---|
Get a list of groups | GET | /groups/ |
|
|
Create a group | POST | /groups/ |
|
|
Set groups of a user | PUT | /groups/ |
|
|
Verify that a group exists | GET | /groups/<group>/ |
| |
Delete a group | DELETE | /groups/<group>/ |
| |
Get all users in a group | GET | /groups/<group>/users/ |
| |
Add a user to a group | POST | /groups/<group>/users/ |
|
|
Set users of a group | PUT | /groups/<group>/users/ |
|
|
Verify that a user is in a group | GET | /groups/<group>/users/<user>/ |
| |
Remove a user from a group | DELETE | /groups/<group>/users/<user>/ |
| |
Get a list of sub-groups | GET | /groups/<group>/groups/ |
| |
Add a group to a group | POST | /groups/<group>/groups/ |
|
|
Set subgroups of a group | PUT | /groups/<group>/groups/ |
|
|
Verify that a group is in a group | GET | /groups/<group>/groups/<subgroup>/ |
| |
Remove a group from a group | DELETE | /groups/<group>/groups/<subgroup>/ |
|
Dry-Runs
See Doing dry-runs.