You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b352e74
Browse filesBrowse the repository at this point in the historyBrowse files
feat(controlplane): add workflow scope, attestation enforcement, and system flag to API tokens
Closes#3115
Extends the API token model with three internal capabilities:
- Workflow scope: tokens may optionally be scoped to a workflow within a
project. The workflow is persisted on the apitoken row and embedded as
workflow_id/workflow_name JWT claims. Expressed in biz via a new
APITokenWithWorkflow(*Workflow) functional option, with validation that the
workflow belongs to the requested project.
- Attestation enforcement: the auth middleware verifies the workflow_id JWT
claim matches the row, and findWorkflowFromTokenOrNameOrRunID rejects when
a workflow-scoped token operates on a different workflow. FindOrCreateWorkflow
forbids workflow-scoped tokens from minting other workflows.
- System tokens: an immutable is_system flag on the row. System tokens mint
and validate JWTs normally but are hidden from APITokenService/List by
default and return NotFound on Revoke. Opt-in via WithIncludeSystemTokens()
in biz; mint via APITokenAsSystem(). No public proto API change.
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
0 commit comments