def create_session_db(ec, token_handler_args, db=None, sso_db=None, sub_func=None): _token_handler = token_handler.factory(ec, **token_handler_args) db = db or InMemoryDataBase() sso_db = sso_db or SSODb() return SessionDB(db, _token_handler, sso_db, sub_func=sub_func)
def create_session_db(password, token_expires_in=3600, grant_expires_in=600, refresh_token_expires_in=86400, db=None, sso_db=SSODb()): _token_handler = token_handler.factory( password, token_expires_in, grant_expires_in, refresh_token_expires_in) if not db: db = InMemoryDataBase() return SessionDB(db, _token_handler, sso_db)
def create_sdb(self): _sso_db = SSODb() passwd = rndstr(24) _th_args = { "code": { "lifetime": 600, "password": passwd }, "token": { "lifetime": 3600, "password": passwd }, "refresh": { "lifetime": 86400, "password": passwd }, } _token_handler = token_handler.factory(None, **_th_args) userinfo = UserInfo(db_file=full_path("users.json")) self.sdb = SessionDB(InMemoryDataBase(), _token_handler, _sso_db, userinfo)
def create_sdb(self): _sso_db = SSODb() _token_handler = token_handler.factory('losenord') self.sdb = SessionDB(InMemoryDataBase(), _token_handler, _sso_db)