restauth-user.py¶
restauth-user.py
manages users in RestAuth. Users are clients that
want to authenticate with services that use RestAuth.
Note that restauth-user.py
does not enforce restrictions on usernames as
rigorously as the when handling users through the standard interface. Instead,
only characters explicitly forbidden by the protocol specification are blocked.
This way it is easy to handle users (about to be) imported from other systems.
Usage¶
restauth-user.py [-h] {add,ls,rename,verify,set-password,rm,view} ...
Use one of the commands (either set-password, verify, list, add, rm or view) 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.
Getting runtime help¶
To get an authoritative list of available commands, use:
restauth-user.py --help
If you want more information on a specific comannd, do:
restauth-user.py command --help
... or see the Available commands section below.
Examples¶
restauth-user.py add exampleuser - Add a user called exampleuser. Since neither --password nor
--gen-password was specified,
restauth-user.py
will prompt for a password.
restauth-user.py add --gen-password exampleuser - Add a user called exampleuser, automatically generate a password and print it to stdout.
restauth-user.py view exampleuser - View all details of exampleuser.
restauth-user.py list - List all users known to RestAuth.
restauth-user.py verify --password=foobar exampleuser - Verify that exampleuser has the password foobar.
restauth-user.py
will exit with status code 0 if the password matches and 1 if not.
restauth-user.py set-password --gen-password exampleuser - Generate a new password for exampleuser.
restauth-user.py rm exampleuser - Remove exampleuser from RestAuth.
Available commands¶
The following subsections never document the ‘-h’ parameter for clarity.
add¶
add [-h] [--password PWD | --gen-password] user Add a new user.
-
--password
PWD
¶ The password to use.
-
--gen-password
¶
Generate a password and print it to stdout.
-
USER
¶
The name of the user.
-
ls¶
ls [-h] - List all users.
rename¶
rm¶
rm [-h] user Remove a user.
-
USER
¶
The name of the user.
-
set-password¶
set-password [-h] [--password PWD | --gen-password] user Set the password of a user.
-
--password
PWD
¶ The password to use.
-
--gen-password
¶
Generate a password and print it to stdout.
-
USER
¶
The name of the user.
-
verify¶
verify [-h] [--password PWD | --gen-password] user Verify the password of a user.
-
--password
PWD
¶ The password to use.
-
--gen-password
¶
Generate a password and print it to stdout.
-
USER
¶
The name of the user.
-
view¶
Influential environment variables¶
-
DJANGO_SETTINGS_MODULE
¶ 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.
-
PYTHONPATH
¶ 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.