feat: Wire built-in plugins into pipeline and listeners#359
Merged
Conversation
Wrap jwt-validation and token-exchange as pipeline plugins that delegate to auth.HandleInbound/HandleOutbound. All listeners now execute through the pipeline rather than calling auth.Auth directly. Adds YAML config support for pipeline composition with programmatic fallback defaults. Behavior is unchanged — this is a refactor that proves the plugin architecture works before adding new plugins (mcp-parser, guardrails). Signed-off-by: Hai Huang <hai@gmail.com> Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Hai Huang <huang195@gmail.com>
The audience derivation is now handled inside the WaypointInboundPipeline via the WithAudienceDeriver option on the JWT validation plugin. Signed-off-by: Hai Huang <hai@gmail.com> Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Hai Huang <huang195@gmail.com>
esnible
approved these changes
May 1, 2026
esnible
left a comment
Member
There was a problem hiding this comment.
I reviewed this manually and found no problems. I disagreed with most of the review skill's comments, but this one makes sense:
#: 1
File: authbridge/cmd/authbridge/listener/extauthz/server.go, extproc/server.go, forwardproxy/server.go
Line: multiple
Severity: suggestion
Comment: extractBearer is duplicated identically in 3 packages. Consider extracting it to a shared internal/ or authlib/ helper to avoid drift
between copies.
Member
Author
|
@esnible thanks for the review. Regarding your comment: |
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
authlib/plugins/package withjwt-validationandtoken-exchangeplugins that delegate toauth.HandleInbound/HandleOutboundpipeline.Pipelineinstead of calling*auth.Authdirectlypipeline:YAML config section for plugin composition with programmatic fallback defaultsWithAudienceDeriverfunctional optionDetails
This is PR 2 of the plugin architecture series. PR 1 (merged in #358) added the
pipelinepackage with types and runner. This PR proves the architecture works by wrapping existing auth logic as plugins -- behavior is identical, just executed through the pipeline path.New files:
authlib/plugins/jwtvalidation.go-- inbound JWT validation pluginauthlib/plugins/tokenexchange.go-- outbound token exchange pluginauthlib/plugins/registry.go-- name-to-factory registry +Build()constructorauthlib/plugins/defaults.go-- default/waypoint pipeline constructorsauthlib/plugins/plugins_test.go-- 13 unit testsModified files:
listener/*/server.go-- accept*pipeline.Pipelineinstead of*auth.Authcmd/authbridge/main.go-- builds pipelines from config, passes to listenersauthlib/config/config.go-- addsPipelineConfigstructTest plan
authlib/pluginstests pass (13/13)cmd/authbridge/listener/extproctests passcmd/authbridge/listener/extauthztests passcmd/authbridge/listener/forwardproxytests passcmd/authbridge/listener/reverseproxytests passgo vet ./...cleanAssisted-By: Claude (Anthropic AI) noreply@anthropic.com