MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / generate_jwt

Function generate_jwt

app/api/agentops/api/auth.py:71–80  ·  view source on GitHub ↗

Generate a JWT token for a project

(project: ProjectModel)

Source from the content-addressed store, hash-verified

69
70
71def generate_jwt(project: ProjectModel) -> str:
72 """Generate a JWT token for a project"""
73 _assert_jwt_secret()
74
75 payload = JWTPayload.from_project(project)
76 return jwt.encode(
77 payload.asdict(),
78 JWT_SECRET_KEY,
79 algorithm=JWT_ALGO,
80 )
81
82
83def verify_jwt(token: str) -> JWTPayload:

Callers 4

__call__Method · 0.90
get_tokenFunction · 0.90
valid_bearer_tokenFunction · 0.90
test_generate_jwtMethod · 0.90

Calls 4

_assert_jwt_secretFunction · 0.85
from_projectMethod · 0.80
encodeMethod · 0.80
asdictMethod · 0.80

Tested by 2

valid_bearer_tokenFunction · 0.72
test_generate_jwtMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…