| version | 1.0.0 |
| name | secure-invite-and-access |
| description | Implement grants, Argon2id passwords, sessions, and signed URLs per ADR-004. Activate for auth changes, access endpoints, or permission revocation.
|
| category | workflow |
| allowed-tools | Read Write Edit Grep Glob |
| license | MIT |
Skill: secure-invite-and-access
Purpose: enforce access-control rules (grants, passwords, sessions, signed URLs, audit) for d.o.EPUB Studio.
When to run
- Working on
/api/access/*, grant management, or session/token logic.
- Updating signed URL issuance/verification or audit logging.
- Investigating auth-related bugs or observability gaps.
Inputs
plans/004-adr-auth-and-access.md
packages/shared/src/schemas.ts
- Worker auth modules (
apps/worker/src/auth/*)
Workflow
- Re-read ADR – confirm grant modes, capability flags, TTL expectations.
- Threat model – identify enumeration risks, replay attacks, session leakage.
- Implement – Argon2id hashing, session issuing/refresh/revoke, signed R2 URLs (<15 min TTL),
X-Trace-Id logging.
- Audit – log
grant_*, access_*, session_* events w/ actor + trace.
- Responses – return generic access-denied errors; never leak whether email exists.
- Tests – add Vitest coverage for password validation, session expiry, signature validation, revocation flows.
Checklist