restauth-service.py may be used to manage services that connect to RestAuth. A service is a system that wants to use RestAuth to store users, preferences and groups.
RestAuth stores a name (which may not include a ‘:’) and a password that identify the service. A service has zero or more IPv4 or IPv6 addresses associated with it, a service can only authenticate from the given adresses, use the *-hosts subcommands to manage hosts of a given service. A service must have permissions to perform the respective actions, use the *-permissions subcommands to manage permissions for services.
restauth-service.py [-h] {add,ls,rm,rename,view,set-hosts,add-hosts,rm-hosts,set-password,add-permissions,rm-permissions,set-permissions} ...
Use one of the commands (i.e. add, view, ls, ...) to perform the respective operation. Each command usually requires more arguments to it, see the respective section for arguments (and possible options) for each command.
To get an authoritative list of available commands, use:
restauth-service.py --help
If you want more information on a specific comannd, do:
restauth-service.py command --help
... or see the Available commands section below.
A typical workflow for adding a service is:
restauth-service.py add example.net restauth-service.py set-hosts 127.0.0.1 ::1 restauth-service.py set-permissions user_verify_password user_change_password
Please see the available permissions below for a full reference on what permissions can be configured.
The following subsections never document the ‘-h’ parameter for clarity.
Add a new service.
The password to use.
Generate a password and print it to stdout.
The name of the service.
Add hosts that a service can connect from.
The name of the service.
Add hosts that this service is able to connect from. Note: This must be an IPv4 or IPv6 address, NOT a hostname.
Add permissions to a service. This command supports shell wildcard style expansions, so ‘user*’ will add all user permissions.
The name of the service.
Permissions to add to the specified service.
Rename a service.
The name of the service.
The new name for the service.
Completely remove a service. This will also remove any groups associated with that service.
The name of the service.
Remove hosts that a service can connect from.
The name of the service.
Remove hosts that this service is able to connect from. Note: This must be an IPv4 or IPv6 address, NOT a hostname.
Remove permissions from a service. This command supports shellwildcard style expansions, so “user*” will remove all user permissions.
The name of the service.
Permissions to remove from the specified service.
Set hosts that a service can connect from.
The name of the service.
Hosts that this service is able to connect from. Note: This must be an IPv4 or IPv6 address, NOT a hostname.
Set the password for a service.
The password to use.
Generate a password and print it to stdout.
The name of the service.
Set permissions of a service, removes any previous permissions. This command supports shell wildcard style expansions, so “user*” will set all user permissions.
The name of the service.
Set the permissions of the specified service.
View details of a service.
The name of the service.
A service can have zero or more permissions. There is a permission available for each operation available via the RestAuth protocol. If a service has no permissions, you will not be able to perform any operations.
permission | description |
---|---|
users_list | List all users |
user_create | Create a new user |
user_exists | Check if a user exists |
user_delete | Delete a user |
user_verify_password | Verify a users password |
user_change_password | Change a users password |
user_delete_password | Delete a user |
permission | description |
---|---|
props_list | List all properties of a user |
prop_create | Create a new property |
prop_get | Get value of a property |
prop_set | Set or create a property |
prop_delete | Delete a property |
permission | description |
---|---|
groups_for_user | List groups for a user |
groups_list | List all groups |
group_create | Create a new group |
group_exists | Verify that a group exists |
group_delete | Delete a group |
group_users | List users in a group |
group_add_user | Add a user to a group |
group_user_in_group | Verify that a user is in a group |
group_remove_user | Remove a user from a group |
group_groups_list | List subgroups of a group |
group_add_group | Add a subgroup to a group |
group_remove_group | Remove a subgroup from a group |
The path to the Django settings module. If not set, RestAuth.settings is used, which should be fine in most cases. For more information, please read the Django documentation.
A semi-colon (‘;’) seperated list of additional directories to search for python modules. The RestAuth installation must be in the module search path for any commands to work. For more information, please read the official python documentation.