Repository navigation
Conversation
With agentTokens.enabled on, the gateway builds the broker from config at start: the services and their scopes, the sessions key to seal tokens, api.tokens.groupsMaxAge as the age limit, and the OIDC provider as the minter. The OIDC provider collects an offline token at each sign-in, the sign-in host hands it to the broker, and the janitor runs in the background. Start fails, naming the setting and not its value, when the sessions key is not persistent, the client secret file is empty, or no sign-in provider can mint. With the switch off there is no broker, sign-in collects nothing, and Purge runs beside start to end every stored token at Keycloak; a minter that never answers does not hold start. Purge now deletes a live row by the generation it read, so a token a still-switched-on replica stores meanwhile stays for the next start, and any row it did not delete counts as kept. The broker's hand-off into the gateway, the cluster's sessions-key check and the sign-in collection switch each have a test that fails when the connection is cut. contracts.md, the spec and the plan's evidence, checkpoint review and deviations are updated.
This branch has not been deployed
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.
Slice 15: Wiring and gateway start
The gateway builds the broker from config when the switch is on (failing start naming what is missing), runs its janitor, and runs
Purgebeside start when the switch is off.Spec: nebari-dev/tapas/docs/superpowers/specs/2026-11-30-agent-token-broker-design.md
Plan: nebari-dev/tapas/docs/superpowers/plans/2026-12-01-agent-tokens-and-frames.md (Slice 15)
Contracts touched:
gateway.ConfiggainsAgentTokensDepends on: #66
agentTokens.services, the sessions key,api.tokens.groupsMaxAge, and the OIDC provider as minter;authoidc.WithOfflineTokens()andAuthenticator.OfflineTokensfrom the same switch;RunJanitor(JanitorFirst, JanitorEvery). Start fails naming the setting for no persistent sessions key, an empty client secret file, or no minter (Journey 10).OfflineTokensa nil interface,Purgein a goroutine; a hanging minter does not hold start (Q43).Purgedeletes by thegenit read (owner decision); a row it did not delete counts as kept.agentTokens.enabled: trueturns the whole broker on. Nothing consumes it until the Frames slices.Reviewer note: each connection between the broker and the running gateway has a test that fails when it is cut (checked by mutation).
Validation
go test -count=1 ./internal/cli/... ./internal/gateway/...make test-postgres: exit 0)make test-localgo vet ./...