MCPcopy Create free account
hub / github.com/MetapriseAI/OrgKernel / mint_token

Function mint_token

src/orgkernel/pyapi/router.py:456–470  ·  view source on GitHub ↗

Mint a new ExecutionToken. The token is: - Scoped to agent_id + mission_id - Signed by the Org CA (prevents Token Grafting) - Time-bounded by expires_at - Scope-restricted by execution_scope

(
    data: ExecutionTokenCreate,
    db: Annotated[AsyncSession, Depends(get_db)],
)

Source from the content-addressed store, hash-verified

454 description="Create and sign a new ExecutionToken scoped to an agent + mission.",
455)
456async def mint_token(
457 data: ExecutionTokenCreate,
458 db: Annotated[AsyncSession, Depends(get_db)],
459) -> ExecutionTokenOut:
460 """
461 Mint a new ExecutionToken.
462
463 The token is:
464 - Scoped to agent_id + mission_id
465 - Signed by the Org CA (prevents Token Grafting)
466 - Time-bounded by expires_at
467 - Scope-restricted by execution_scope
468 """
469 svc = ExecutionTokenService(db)
470 return await svc.mint(data)
471
472
473@_token.get(

Callers

nothing calls this directly

Calls 2

mintMethod · 0.95

Tested by

no test coverage detected