Scope#
Implemented explicit workflow execution API endpoints in @isis/generation-api
for:
POST /api/v1/workflows/{workflowId}/runGET /api/v1/workflows/{workflowId}/executionsGET /api/v1/workflows/{workflowId}/executions/{executionId}
with route-level RBAC for both bearer and API-key authentication.
Implemented Artifacts#
- Generation API workflow execution routes:
apps/isis/generation-api/src/routes/workflows.tsapps/isis/generation-api/src/routes/workflows.spec.tsapps/isis/generation-api/src/app.tsapps/isis/generation-api/src/index.tsapps/isis/generation-api/src/routes/index.ts
- Auth + job filtering support:
apps/isis/generation-api/src/middleware/auth.tsapps/isis/generation-api/src/types.tsapps/isis/generation-api/src/services/job.service.ts
- OpenAPI generation/contract parity:
scripts/isis/generate_generation_api_openapi.mjsapps/isis/generation-api/src/openapi.contract.spec.tsapps/isis/generation-api/openapi.yamlopenapi/isis/openapi.yaml
RBAC Model#
- Run endpoint (
/run):- Bearer: allowed via authorized roles (
admin,ops,sre,developer) or permissions (jobs:submit,jobs:manage,workflows:run,workflows:write,*) - API key: requires equivalent run permissions (
jobs:submit,jobs:manage,workflows:run,workflows:write,*)
- Bearer: allowed via authorized roles (
- Execution history endpoints (
/executions*):- Bearer: allowed via authorized roles (
admin,ops,sre,developer,viewer) or read permissions (workflows:read,jobs:read, etc.) - API key: requires read permissions (
workflows:read,jobs:read,jobs:manage,workflows:run,workflows:write,*)
- Bearer: allowed via authorized roles (
Behavior#
POST /runnow creates a generation job with canonical workflow metadata:workflowIdworkflowVersion- tenant/project/auth trace context
GET /executionsreturns workflow-scoped history from job storage.GET /executions/{executionId}returns the execution only when it belongs to the requested workflow.- Job-list filtering now supports workflow ID resolution across canonical and legacy metadata keys for robust historical coverage.
Verification#
bash
pnpm --filter @isis/generation-api exec vitest run src/routes/workflows.spec.ts src/openapi.contract.spec.ts --reporter=dot
pnpm --filter @isis/generation-api exec vitest run src/routes/jobs.spec.ts src/routes/workflows.spec.ts src/openapi.contract.spec.ts --reporter=dot
node scripts/isis/generate_generation_api_openapi.mjs --check
pnpm --filter @isis/generation-api run openapi:check
Outcome#
WS10-002 is now closed with explicit workflow execution/history endpoints, enforced RBAC, and OpenAPI + contract test parity aligned to source routes.