user.cli

Provides commands used to manage users.

Attributes

cli

Functions

add(...)

Adds a user with the given name to the database.

delete(...)

Removes the given user from the database.

exists(...)

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

activate(...)

Activates the given user.

deactivate(...)

Deactivates the given user.

logout(...)

Logs out the given user on all sessions.

logout_all(...)

Logs out all users on all sessions.

list(...)

Lists all users.

change_password(...)

Changes the password of the given username.

change_yubikey(...)

Changes the yubikey of the given username.

change_mtan(...)

Changes the yubikey of the given username.

change_totp(...)

Changes the yubikey of the given username.

transfer_yubikey(...)

Transfers the Yubikey from one user to another.

change_role(...)

Changes the role of the given username.

list_sessions(...)

Lists all sessions of all users.

Module Contents

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) collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]

Adds a user with the given name to the database.

user.cli.delete(username: str) collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]

Removes the given user from the database.

user.cli.exists(username: str, recursive: bool) collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.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) collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]

Activates the given user.

user.cli.deactivate(username: str) collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]

Deactivates the given user.

user.cli.logout(username: str) collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]

Logs out the given user on all sessions.

user.cli.logout_all() collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]

Logs out all users on all sessions.

user.cli.list(active_only: bool, inactive_only: bool, sources: bool) collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]

Lists all users.

user.cli.change_password(username: str, password: str | None) collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]

Changes the password of the given username.

user.cli.change_yubikey(username: str, yubikey: str | None) collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]

Changes the yubikey of the given username.

user.cli.change_mtan(username: str, phone_number: str | None) collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]

Changes the yubikey of the given username.

user.cli.change_totp(username: str, secret: str | None, generate: bool) collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]

Changes the yubikey of the given username.

user.cli.transfer_yubikey(source: str, target: str) collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]

Transfers the Yubikey from one user to another.

user.cli.change_role(username: str, role: str) collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]

Changes the role of the given username.

user.cli.list_sessions() collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]

Lists all sessions of all users.