Example #1
0
 def verify_key(key: str) -> Optional['ApiKey']:
     key_info = ApiKey.from_db(db.get_key(key))
     if key_info and key_info.expire_time > datetime.utcnow():
         db.update_key_last_used(key)
         return key_info
     return None
Example #2
0
File: key.py Project: 3IWOH/alerta
 def verify_key(key):
     key_info = ApiKey.from_db(db.get_key(key))
     if key_info and key_info.expire_time > datetime.utcnow():
         db.update_key_last_used(key)
         return key_info
Example #3
0
 def verify_key(key):
     key_info = ApiKey.from_db(db.get_key(key))
     if key_info and key_info.expire_time > datetime.utcnow():
         db.update_key_last_used(key)
         return key_info
Example #4
0
 def verify_key(key: str) -> Optional['ApiKey']:
     key_info = ApiKey.from_db(db.get_key(key))
     if key_info and key_info.expire_time > datetime.utcnow():
         db.update_key_last_used(key)
         return key_info
     return None