(authentication: str)
| 20 | |
| 21 | |
| 22 | def _decrypt(authentication: str): |
| 23 | cache_key = hashlib.sha256(authentication.encode()).hexdigest() |
| 24 | result = authentication_cache.get(key=cache_key, version=Cache_Version.CHAT.value) |
| 25 | if result is None: |
| 26 | with lock: |
| 27 | result = authentication_cache.get(cache_key, version=Cache_Version.CHAT.value) |
| 28 | if result is None: |
| 29 | result = decrypt(authentication) |
| 30 | authentication_cache.set(cache_key, result, version=Cache_Version.CHAT.value, timeout=60 * 60 * 2) |
| 31 | |
| 32 | return result |
| 33 | |
| 34 | |
| 35 | class ChatAuthentication: |
no test coverage detected