Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/controlplane/internal/service/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,8 @@ func (s *AttestationService) FindOrCreateWorkflow(ctx context.Context, req *cpAP
return nil, errors.NotFound("not found", "neither robot account nor API token found")
}

// Workflow-scoped API tokens cannot create or look up other workflows.
if token := entities.CurrentAPIToken(ctx); token != nil && token.WorkflowID != nil {
// Workflow-scoped API tokens may only target their own workflow.
if token := entities.CurrentAPIToken(ctx); token != nil && token.WorkflowName != nil && *token.WorkflowName != req.GetWorkflowName() {
return nil, errors.Forbidden("forbidden", "API token is workflow-scoped and cannot create or look up other workflows")
}

Expand Down
Loading