restapi.services.authentication.NoAuthentication

class restapi.services.authentication.NoAuthentication[source]
__init__()
Return type:

None

Methods

__init__()

add_user_to_group(user, group)

Save the group.members -> user relationship

change_password(user, password, ...)

check_password_validity(user, ...)

count_failed_login(username)

create_group(groupdata)

A method to create a new group

create_role(name, description)

A method to create a new role

create_temporary_token(user, token_type[, ...])

create_token(payload)

Generate a str token with JWT library to encrypt the payload

create_user(userdata, roles, group)

A method to create a new user

custom_user_properties_post(user, userdata, ...)

custom_user_properties_pre(userdata)

delete_group(group)

delete_user(user)

fill_payload(user[, expiration, token_type])

Informations to store inside the JWT token, starting from the user obtained from the current service

flush_failed_logins(username)

Flush failed logins for the give username

get_group([group_id, name])

How to retrieve a single group from the current authentication db

get_group_members(group)

How to retrieve group users list from the current authentication db

get_groups()

How to retrieve groups list from the current authentication db

get_logins([username, only_unflushed])

Save login information

get_password_hash(password)

get_qrcode(user)

get_remote_ip([raise_warnings])

get_roles()

How to retrieve all the roles

get_roles_from_user(user)

Retrieve roles from a user object from the current auth service

get_tokens([user, token_jti, get_all])

Return the list of tokens

get_totp_secret(user)

get_user([username, user_id])

How to retrieve a single user from the current authentication db, based on the unique username or the user_id return None if no filter parameter is given

get_user_group(user)

How to retrieve the group that the user belongs to from the current auth db

get_users()

How to retrieve a list of all users from the current authentication db

init_auth_db(options)

init_groups(force)

init_roles()

init_users(default_group, roles, force)

invalidate_token(token)

With this method the specified token must be invalidated as expected after a user logout

is_admin(user)

Check if current user has Administration role

is_bcrypt_hashed(password)

is_coordinator(user)

Check if current user has Coordinator role

is_staff(user)

Check if current user has Staff role

link_roles(user, roles)

A method to assign roles to a user

load_default_user()

load_roles()

log_event(event[, target, payload, user])

make_login(username, password, totp_code)

module_initialization()

register_failed_login(username, user)

save_group(group)

save_login(username, user, failed)

Save login information

save_role(role)

save_token(user, token, payload[, token_type])

save_user(user)

unpack_token(token[, raiseErrors])

unpacked_token(valid[, token, jti, user])

verify_blocked_username(username)

verify_password(plain_password, hashed_password)

verify_password_strength(pwd, old_pwd, ...)

verify_roles(user, roles[, required_roles, ...])

verify_token(token[, raiseErrors, token_type])

verify_token_validity(jti, user)

This method MUST be implemented by specific Authentication Methods to add more specific validation contraints

verify_totp(user, totp_code)

verify_user_status(user)

Attributes

ACTIVATE_ACCOUNT

DEFAULT_TOKEN_TTL

DISABLE_UNUSED_CREDENTIALS_AFTER

FAILED_LOGINS_EXPIRATION

FORCE_FIRST_PASSWORD_CHANGE

FULL_TOKEN

GRACE_PERIOD

JWT_ALGO

JWT_SECRET

MAX_LOGIN_ATTEMPTS

MAX_PASSWORD_VALIDITY

MIN_PASSWORD_LENGTH

PWD_RESET

SAVE_LAST_ACCESS_EVERY

SECOND_FACTOR_AUTHENTICATION

TOTP

TOTP_VALIDITY_WINDOW

UNLOCK_CREDENTIALS

default_password

default_role

default_user

fernet

role_descriptions

roles

roles_data