gws.plugin.auth_session_manager.sqlite

Source code: gws.plugin.auth_session_manager.sqlite

Package Contents

class gws.plugin.auth_session_manager.sqlite.Config(*args, **kwargs)

Bases: gws.base.auth.session_manager.Config

Configuration for sqlite sessions

path: str | None

session storage path

class gws.plugin.auth_session_manager.sqlite.Object

Bases: gws.base.auth.session_manager.Object

Base session manager.

dbPath: str
metaData: gws.lib.sa.MetaData
engine: gws.lib.sa.Engine
table: gws.lib.sa.Table
configure()

Configuration hook.

activate()

Activation hook.

cleanup()

Remove invalid Sessions from the storage.

create(method, user, data=None)

Create a new Session,

Parameters:
  • method – Auth Method that creates the Session.

  • user – ‘User’ for which the Session is created.

  • data – Session data.

Returns:

A new Session.

delete(sess)

Delete a Session.

Parameters:

sess – Session object.

delete_all()

Delete all Sessions.

get(uid)

Get Session by its uid.

Parameters:

uid – Session uid.

Returns:

A Session or None.

get_valid(uid)

Get a valid Session by its uid.

Parameters:

uid – Session uid.

Returns:

A Session or None if uid does not exists or the Session is not valid.

get_all()

Get all sessions.

save(sess)

Save the Session state into a persistent storage.

Parameters:

sess – Session object.

touch(sess)

Update the Session last activity timestamp.

Parameters:

sess – Session object.