Repository navigation
feat(identitybroker): make the broker's lifetimes, clock skew, and timeouts settings - #2976
Merged
Merged
Conversation
…meouts settings The identity broker's configuration file takes optional id_jag_max_lifetime, id_jag_lifetime, credential_lifetime, client_assertion_lifetime, clock_skew, as1_request_timeout, and as2_request_timeout, each bounded and defaulting to today's value. One clock skew, at most 60s, replaces both interim skews, so converted access-token jtis are remembered for the skew past exp. Closes #2813. Co-authored-by: Mecatl <[email protected]>
rdimitrov
approved these changes
Nov 24, 2026
rdimitrov
left a comment
Member
There was a problem hiding this comment.
LGTM.
Checked:
- Defaults match the old constants, except converted-token retention (5m →
clock_skew). That is safe:golang-jwttreats a token as expired oncenow >= exp, so with no leeway at AS-1 a zero skew still covers it, and the new real-AS-1 test pins that. - The 60s
MaxClockSkewreasoning holds: a larger skew would let the broker accept a credential that AS-1 then answers with a server error instead ofactor_token_expired. as2InProcessClientcan't get a zero timeout: AS-2 exists only with a broker client, which requires a gateway entry, and the timeout is set with the entry.- The AS-1 adapter now takes its bounds from the core, so there is one source of truth, and it refuses target lifetimes above 300s.
This was referenced Nov 24, 2026
This branch was successfully 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.
Closes #2813.
Summary
The identity broker's lifetimes, clock skew, and request timeouts move from constants in code to optional settings in its configuration file (
--identity-broker-config). Every setting has a documented default, bounds, and the risk it bounds. A file without the new fields loads with the same values as before, except for how long converted access-tokenjtis are remembered (see below).Settings
id_jag_max_lifetime: AS-1's maximum for grants that issue ID-JAGs, which is also every session's hard expiry. It stays separate from any schedule-horizon setting (Phase 2, Slice 3: Scheduled runs — A scheduled run calls gateway tools on its own grant, with no one present #2569).id_jag_lifetime: applied to every gateway entry's ID-JAG target at AS-1. It also bounds the gateway token, which AS-2 caps at the ID-JAG's remaining validity. The gateway token's own lifetime stays with Bind each gateway token to its call #2727.clock_skew: one setting replaces both the 30-second credential skew and the 5-minute converted-token retention. Its maximum is 60 seconds, because ToolHive accepts an actor credential's expiry only up to 60 seconds in the past; a larger skew would turn an expired credential into a server error instead ofactor_token_expired, so the agent would never renew. The skew applies inside the broker only.Startup refuses:
id_jag_max_lifetime;id_jag_*values without a hosted AS-1.Errors name the file.
Behaviour change
How long the broker remembers a converted access-token
jtipast itsexpdrops from 5 minutes to the clock skew (30 seconds by default). That is enough because AS-1 allows no leeway on an access token'sexp. A new test against the real AS-1 pins that, so a ToolHive change that adds leeway fails it.Other changes
authorize.gonow points only at Bind each gateway token to its call #2727. No#2813markers remain.Not in this PR
API compatibility
Assessment: no remote-observable API change. Only the broker's configuration file gains optional fields; the gRPC and HTTP APIs, session events, and model-visible tool results are unchanged. No major or feature change.
Testing
task lint: 0 issues.go test -raceover./internal/...and./cmd/...: pass. The root suite's only failures aredeploy/helm/mecatl-executionanddeploy/mecatl-execution-kind, which fail the same way onmain.task docs:check: pass.app.Build: