Description — what to implement and the why/impact.
Implement an API key authentication guard and decorator supporting granular scope-based permissions for developer and agent API access.
Context & Requirements — background, constraints, design references, edge cases;
Autonomous agents and developers interact with Astroid API using long-lived API keys. The authentication guard must validate hashed keys against the database, attach tenant and agent context to the request, and enforce required permission scopes (e.g., transactions:write, policies:read).
Acceptance Criteria — a checklist of specific, testable conditions that define "done".
Implementation Guidance — likely files/modules to touch and a suggested approach.
- Likely files:
src/modules/auth/, src/common/guards/api-key.guard.ts, prisma/schema.prisma.
- Store API keys hashed using SHA-256 rather than in plaintext.
Testing & Validation — how the contributor should prove it works.
- Run
npm test ensuring all auth guard tests pass successfully.
- Verify type safety with
npm run typecheck.
Submission Guidelines — must open a PR that includes "Closes #"; assignment is required before starting.
Wave complexity: Medium
Description — what to implement and the why/impact.
Implement an API key authentication guard and decorator supporting granular scope-based permissions for developer and agent API access.
Context & Requirements — background, constraints, design references, edge cases;
Autonomous agents and developers interact with Astroid API using long-lived API keys. The authentication guard must validate hashed keys against the database, attach tenant and agent context to the request, and enforce required permission scopes (e.g.,
transactions:write,policies:read).Acceptance Criteria — a checklist of specific, testable conditions that define "done".
ApiKeyGuardand decorator@RequireScopes(...)created.Implementation Guidance — likely files/modules to touch and a suggested approach.
src/modules/auth/,src/common/guards/api-key.guard.ts,prisma/schema.prisma.Testing & Validation — how the contributor should prove it works.
npm testensuring all auth guard tests pass successfully.npm run typecheck.Submission Guidelines — must open a PR that includes "Closes #"; assignment is required before starting.
Wave complexity: Medium