user.cli

Provides commands used to manage users.

Module Contents

Functions

add(→ Callable[[CoreRequest, Framework], None])

Adds a user with the given name to the database.

delete(→ Callable[[CoreRequest, Framework], None])

Removes the given user from the database.

exists(→ Callable[[CoreRequest, Framework], None])

Returns 0 if the user exists, 1 if it doesn't when recursive equals

activate(→ Callable[[CoreRequest, Framework], None])

Activates the given user.

deactivate(→ Callable[[CoreRequest, Framework], None])

Deactivates the given user.

logout(→ Callable[[CoreRequest, Framework], None])

Logs out the given user on all sessions.

logout_all(→ Callable[[CoreRequest, Framework], None])

Logs out all users on all sessions.

list(→ Callable[[CoreRequest, Framework], None])

Lists all users.

change_password(→ Callable[[CoreRequest, Framework], None])

Changes the password of the given username.

change_yubikey(→ Callable[[CoreRequest, Framework], None])

Changes the yubikey of the given username.

transfer_yubikey(→ Callable[[CoreRequest, Framework], ...)

Transfers the Yubikey from one user to another.

change_role(→ Callable[[CoreRequest, Framework], None])

Changes the role of the given username.

list_sessions(→ Callable[[CoreRequest, Framework], None])

Lists all sessions of all users.

Attributes

cli

user.cli.cli[source]
user.cli.add(role: str, username: str, password: str | None, yubikey: str | None, no_prompt: bool, realname: str | None, phone_number: str | None) Callable[[CoreRequest, Framework], None][source]

Adds a user with the given name to the database.

user.cli.delete(username: str) Callable[[CoreRequest, Framework], None][source]

Removes the given user from the database.

user.cli.exists(username: str, recursive: bool) Callable[[CoreRequest, Framework], None][source]

Returns 0 if the user exists, 1 if it doesn’t when recursive equals to False. If the recursive flag is set, it will loop over all schemas and print the result for each schema without return value.

user.cli.activate(username: str) Callable[[CoreRequest, Framework], None][source]

Activates the given user.

user.cli.deactivate(username: str) Callable[[CoreRequest, Framework], None][source]

Deactivates the given user.

user.cli.logout(username: str) Callable[[CoreRequest, Framework], None][source]

Logs out the given user on all sessions.

user.cli.logout_all() Callable[[CoreRequest, Framework], None][source]

Logs out all users on all sessions.

user.cli.list(active_only: bool, inactive_only: bool, sources: bool) Callable[[CoreRequest, Framework], None][source]

Lists all users.

user.cli.change_password(username: str, password: str | None) Callable[[CoreRequest, Framework], None][source]

Changes the password of the given username.

user.cli.change_yubikey(username: str, yubikey: str | None) Callable[[CoreRequest, Framework], None][source]

Changes the yubikey of the given username.

user.cli.transfer_yubikey(source: str, target: str) Callable[[CoreRequest, Framework], None][source]

Transfers the Yubikey from one user to another.

user.cli.change_role(username: str, role: str) Callable[[CoreRequest, Framework], None][source]

Changes the role of the given username.

user.cli.list_sessions() Callable[[CoreRequest, Framework], None][source]

Lists all sessions of all users.