Skip to content

test(verify): hold adapters to one permission guard behavior - #353

Merged
Bccorb merged 2 commits into
mainfrom
feat/permission-guard-conformance
Nov 6, 2026
Merged

Bccorb merged 2 commits into
mainfrom
feat/permission-guard-conformance

Conversation

@Bccorb

@Bccorb Bccorb commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Conformance for fells-code/seamless-auth-server#218, fells-code/seamless-auth-go#29, fells-code/seamless-auth-python#32 and fells-code/seamless-auth-rust#33. Part of v0.23 Wave 3.

What

  • verify/harness/adapter/permissionGuards.spec.ts: 12 cases under a new pending contract, permission-guards. Covers 401 and the 403 body, any-of and all-of, exact matching, a role being taken away, bearer, organization scope bound to the route, removal from an organization reaching the guard at the next token, and the live read when a token carries permissions_omitted
  • verify/harness/lib/permissionFlows.ts: idempotent setup through the admin API
  • The four /api/permissions routes in the Express and Fastify reference apps, added only when the installed adapter exports requirePermission, because a released-mode run installs a published package that may predate it
  • verify/CONFORMANCE.md: the routes and the behavior

The cases are skipped unless a run opts in, because they need API #576 and #577. No adapter CI opts in yet. CI builds the API from main, so each adapter can set SEAMLESS_VERIFY_CONTRACTS once those merge and its guard is on its default branch.

Testing

Run locally against the API worktree on feat/organization-roles-in-token, with SEAMLESS_VERIFY_CONTRACTS=permission-guards,content-type-gate, using each adapter's PR branch:

Adapter Full adapter suite
Express and Fastify (--local --no-react, including the API specs) 101 passed
Next.js 39 passed
Go 39 passed
Rust 39 passed
Python, FastAPI 39 passed
Python, Django 39 passed

Released mode with no opt-in: 24 skipped, and the reference apps start without the guard.

Not run: the browser layers (--no-react). This does not cover a recovery session or a failed live read end to end; those are in each adapter's unit tests. Express ran on port 3100 through a compose override, because port 3000 was taken on this machine.

For review

Members in these specs are added with scopes: ['organization:read'], because a member without it cannot switch to the organization (requireOrganizationAccess in the API answers 404). That is the API's behavior, reviewed and kept as is, and it is documented in docs/admin-operations.md on API #577.

@Bccorb Bccorb added this to the v0.23 milestone Nov 6, 2026
@Bccorb
Bccorb merged commit 3aea9df into main Nov 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant