MCPcopy Index your code
hub / github.com/diffgram/diffgram / id_token_has_expired

Method id_token_has_expired

shared/auth/OAuth2Provider.py:92–101  ·  view source on GitHub ↗
(self, id_token: str)

Source from the content-addressed store, hash-verified

90 raise NotImplementedError
91
92 def id_token_has_expired(self, id_token: str) -> bool:
93 token_decoded = self.get_decoded_jwt_token(id_token = id_token)
94 expiry = token_decoded.get('exp')
95 if expiry is None:
96 return False
97 expiry_datetime = datetime.datetime.fromtimestamp(expiry)
98 if datetime.datetime.now() > expiry_datetime:
99 return True
100 else:
101 return False
102
103 def get_decoded_jwt_token(self, id_token: str) -> dict:
104 decoded_token = jwt.decode(id_token, verify=False, algorithms='RS256', options={"verify_signature": False})

Calls 2

get_decoded_jwt_tokenMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected