feat: enable Flight SQL ingress in multi-tenant mode#326
Open
feat: enable Flight SQL ingress in multi-tenant mode#326
Conversation
Introduce a CredentialValidator interface in flightsqlingress to abstract auth away from a static users map, and a teamRoutedSessionProvider in controlplane to route Flight SQL sessions to per-team SessionManagers. - Add CredentialValidator interface with MapCredentialValidator (static users, single-tenant) and FuncCredentialValidator (config store, multi-tenant) implementations - Add teamRoutedSessionProvider that bridges SessionProvider to per-team SessionManager via TeamRouter, with pid→SessionManager tracking for correct destroy routing - Rewrite startFlightIngress() to branch on mode: multi-tenant uses config store auth + team-routed sessions, single-tenant uses existing static users + single session manager - Add Protocol field to ManagedSession and admin dashboard sessions table (green "postgres" / blue "flight" badges) - Add --flight-port 8815 and faster session TTLs to local K8s manifest - Add /multitenant-up and /multitenant-down Claude skills Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
386ffed to
bfac6f8
Compare
Contributor
Author
|
tried to consolidate the auth logic between pg and flight but it wasn't right so I backed it up to the basic implementation |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
CredentialValidatorinterface inflightsqlingressto abstract auth away from a staticmap[string]string, withMapCredentialValidator(single-tenant) andFuncCredentialValidator(multi-tenant config store) implementationsteamRoutedSessionProvideradapter that routes Flight SQL sessions to per-teamSessionManagerinstances viaTeamRouter, with apidSessionmap for correct destroy routingflightSessionProviderwrapper so single-tenant Flight sessions are also labeled correctlystartFlightIngress()to support both modes: multi-tenant uses config store auth + team-routed sessions, single-tenant uses static users + single session managerProtocolfield toManagedSessionand admin dashboard sessions table with colored badges (green "postgres" / blue "flight")--flight-port 8815and faster session TTLs to local K8s multitenant manifest/multitenant-upand/multitenant-downClaude skills for stack lifecycleTest plan
go test ./server/flightsqlingress/— all 28 existing tests pass withMapCredentialValidatorwrappinggo test ./controlplane/— all tests pass including 4 newteamRoutedSessionProvidertests (error path, pid map cleanup, unknown pid no-op, concurrent destroy safety)go build -tags kubernetes .— compiles cleanlyjust run-multitenant-local, connected with duckhog extension over Flight SQL, verified session creation routes tolocalteam's worker pool, confirmed "flight" protocol badge appears in admin dashboard at/sessions, verified session cleanup after idle TTL🤖 Generated with Claude Code