MCPcopy Create free account
hub / github.com/Tong89/smartNode / decode_token

Function decode_token

backend/auth.py:58–60  ·  view source on GitHub ↗

解码并校验 JWT(过期/篡改会抛出异常)。

(token)

Source from the content-addressed store, hash-verified

56
57
58def decode_token(token):
59 """解码并校验 JWT(过期/篡改会抛出异常)。"""
60 return jwt.decode(token, jwt_secret(), algorithms=[JWT_ALGORITHM])
61
62# 匿名可访问的精确路径与前缀白名单
63PUBLIC_PATHS = {"/", "/api/health", "/favicon.ico", "/api/auth/login", "/api/auth/refresh", "/api/openapi.json", "/docs", "/api/livez", "/api/readyz"}

Callers 2

auth_refreshFunction · 0.90
_authenticateFunction · 0.85

Calls 1

jwt_secretFunction · 0.85

Tested by

no test coverage detected