27 self.
uuid = kwargs.get(
"uuid",
"")
28 self.
access = kwargs.get(
"access",
"")
44 LOG.debug(
'Loading identity')
55 identity_lock.acquire()
56 IdentityManager._load()
59 identity_lock.release()
60 return IdentityManager.__identity
63 def save(login=None, lock=True):
64 LOG.debug(
'Saving identity')
66 identity_lock.acquire()
69 IdentityManager._update(login)
71 json.dump(IdentityManager.__identity.__dict__, f)
76 identity_lock.release()
80 LOG.debug(
'Updaing identity')
82 expiration = login.get(
"expiration", 0)
83 IdentityManager.__identity.uuid = login.get(
"uuid",
"")
84 IdentityManager.__identity.access = login.get(
"accessToken",
"")
85 IdentityManager.__identity.refresh = login.get(
"refreshToken",
"")
86 IdentityManager.__identity.expires_at = time.time() + expiration
91 identity_lock.acquire()
93 IdentityManager._update()
96 identity_lock.release()
100 if not IdentityManager.__identity:
101 IdentityManager.load()
102 return IdentityManager.__identity
def save(login=None, lock=True)
def __init__(self, kwargs)
def update(login=None, lock=True)