Skip to content

feat(server): add WithPrincipalACL and allow APIMiddlewares without an extractor - #150

Merged
patdowney merged 1 commit into
mainfrom
feat/api-middlewares-acl
Nov 15, 2026
Merged

patdowney merged 1 commit into
mainfrom
feat/api-middlewares-acl

Conversation

@patdowney

Copy link
Copy Markdown
Contributor

Summary

  • APIMiddlewares now takes ...APIOption. ValidatorHandlerOption implements it, so existing callers (connect-control, server-example) compile unchanged.
  • New WithPrincipalACL(acl) appends the principal allow/deny ACL after validation and extraction, for APIs that authorise by who the caller is rather than by role.
  • A nil extractor leaves principal extraction out.

Lets connect's mail management routes use the shared chain instead of a local copy (dioad/connect#559, C9). CORS stays ahead of the chain and is covered separately in dioad/net.

Test plan

  • make verify
  • ACL allow, deny and unlisted principals; nil extractor; ordering after validation and extraction

🤖 Generated with Claude Code

https://claude.ai/code/session_01SS4MAwAn85D1gkEzLtjYaZ

…n extractor

APIOption lets APIMiddlewares take WithPrincipalACL next to the existing
ValidatorHandlerOptions, which remain valid options, so current callers are
unchanged. A nil extractor leaves principal extraction out, for an API that
authorises by who the caller is rather than by role.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SS4MAwAn85D1gkEzLtjYaZ
@patdowney
patdowney merged commit 9e4b7d7 into main Nov 15, 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