arxiv.users.legacy.util module

Helpers and Flask application integration.

arxiv.users.legacy.util.check_password(password, encrypted)[source]

Check a password against an encrypted hash.

Return type:None
arxiv.users.legacy.util.compute_capabilities(tapir_user)[source]

Calculate the privilege level code for a user.

Return type:int
arxiv.users.legacy.util.create_all()[source]

Create all tables in the database.

Return type:None
arxiv.users.legacy.util.current_session()[source]

Get/create database session for this context.

Return type:Session
arxiv.users.legacy.util.drop_all()[source]

Drop all tables in the database.

Return type:None
arxiv.users.legacy.util.epoch(t)[source]

Convert a datetime to UNIX time.

Return type:int
arxiv.users.legacy.util.from_epoch(t)[source]

Get a datetime from an UNIX timestamp.

Return type:datetime
arxiv.users.legacy.util.get_scopes(db_user)[source]

Generate a list of authz scopes for a legacy user based on class.

Return type:List[str]
arxiv.users.legacy.util.get_session_duration()[source]

Get the session duration from the config.

Return type:int
arxiv.users.legacy.util.get_session_hash()[source]

Get the legacy hash secret.

Return type:str
arxiv.users.legacy.util.hash_password(password)[source]

Generate a secure hash of a password.

Return type:str
arxiv.users.legacy.util.init_app(app=None)[source]

Set default configuration parameters for an application instance.

Return type:None
arxiv.users.legacy.util.is_configured()[source]

Determine whether or not the legacy database is configured.

Return type:bool
arxiv.users.legacy.util.now()[source]

Get the current epoch/unix time.

Return type:int
arxiv.users.legacy.util.transaction()[source]

Context manager for database transaction.

Return type:Generator[+T_co, -T_contra, +V_co]