MCPcopy
hub / github.com/1Panel-dev/MaxKB / _decrypt

Function _decrypt

apps/common/auth/common.py:22–32  ·  view source on GitHub ↗
(authentication: str)

Source from the content-addressed store, hash-verified

20
21
22def _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
35class ChatAuthentication:

Callers 1

new_instanceMethod · 0.85

Calls 4

decryptFunction · 0.90
encodeMethod · 0.45
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected