Build surface (flow-serving server scaffolding) #21
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lab/authz-bridge!21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/build-surface"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #12
The Bridge's flow-serving foundation: the single binary runs the three
listeners — a gRPC
ext_authzCheckservice on:8083(OIDC) and:8084(Exchange), and a plain-HTTP listener on:8082(callback/logout) — all wired into the manager and consuming the
per-replica Snapshot, with the
ext_authzproto and a JWT/JWKSlibrary in place. Nothing protocol-specific yet: a
Checkreturns astub
OK; a:8082request returns a stub. This makes "the serversexist, are wired, and read the Snapshot" true, unblocking every flow
ticket.
What's in it
internal/serve— theServermanager runnable (three listeners;one failing stops all; clean shutdown on ctx done;
NeedLeaderElection()==falseso every replica serves, like themirror). The gRPC
Checkresolves the App by the request's Host viaAppForHostname(the resolution path the Flows use) and returns thestub OK (status code 0); the HTTP listener returns the stub. The
serving path reads only
SnapshotProvider.Current()(a lock-freepointer load) — no K8s API read.
internal/jwt—Verify: the ES256 signature against the JWKS(matched by kid; the ES256-only algorithm whitelist defeats an
algorithm-confusion forgery) plus the
exp/iss/audclaimchecks; returns the typed claims plus the raw claim map for the
claim→header injection. No hand-rolled crypto — go-jose does the
signature/key handling.
cmd/main.go— theServeris added to the manager (sharingthe mirror's Snapshot), with
--oidc-bind-address/--exchange-bind-address/--callback-bind-addressflags(defaults
:8083/:8084/:8082).envoyproxy/go-control-plane(theenvoymodule; the
envoy/service/auth/v3Checkproto) andgo-jose/go-jose/v4are direct dependencies.Serverdriven against a constructed
Snapshot(the pure snapshot builder)on ephemeral ports, asserting the
CheckResponsestatus, the HTTPresponse, the Snapshot read count, and the fail-on-bound-address /
shutdown behavior;
jwt.Verifyagainst a generated ES256 key (tokensigned with go-jose, public key in the JWKS).
Verification
GOTOOLCHAIN=go1.26.0 make lint— 0 issuesGOTOOLCHAIN=go1.26.0 make test— all packages passgo build ./...— clean