Skip to content

feat(kernel): support federated token providers - #444

Open
vuanhphung wants to merge 7 commits into
mainfrom
vu-phung/kernel-federation-client-id
Open

feat(kernel): support federated token providers#444
vuanhphung wants to merge 7 commits into
mainfrom
vu-phung/kernel-federation-client-id

Conversation

@vuanhphung

@vuanhphung vuanhphung commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Reuses WithFederatedTokenProvider* on the kernel backend. The driver snapshots one base-provider token for kernel-side PAT federation; WithFederatedTokenProviderAndClientID also forwards the SP-wide client ID. Because the kernel cannot refresh the provider, an expired token requires a new connection.

Pins KERNEL_REV to the federation-capable kernel. The kernel bump also requires aligning one retry-setter assertion with its clamp behavior.

Validation: go test ./..., make test-kernel, and make lint.

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

@eric-wang-1990

Copy link
Copy Markdown
Contributor

For Go, we should also reuse-existing FederationProvider to avoid confusion as much as possible. Can we thread that through?
One path is we just get the token from the provider in the driver, then pass it to kernel as PAT with federation. That will fail in the case the token expired.

Long term is support custom token provider in kernel which is out of scope for now

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

@vuanhphung vuanhphung changed the title feat(kernel): forward identity federation client ID feat(kernel): support federated token providers Aug 20, 2026

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 2 Low

Looks good — the federated-provider kernel wiring is correct: the wrapper preserves the Thrift path, GetToken is snapshotted exactly once (telemetry short-circuit verified by test), and the federation client ID is correctly gated to the PAT branch. Two minor low-severity items: one stale retry-range comment the kernel bump left behind, and missing coverage for the two new federated error paths.

Comment thread kernel_config.go
Comment thread kernel_config.go

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low

Looks good — the kernel federated-token path is implemented correctly: the base provider is snapshotted once (kernel does its own exchange via set_identity_federation_client_id), the telemetry classifier short-circuits to avoid a second GetToken, and the new federatedTokenAuthenticator wrapper is safe on the Thrift path (nothing type-asserts the concrete provider, and the embedded authenticator implements neither M2M/U2M interface). One low doc-consistency gap: CONNECTION_PARAMETERS.md's kernel notes weren't updated with the snapshot/expiry caveat that README got.

Comment thread CONNECTION_PARAMETERS.md

@peco-review-bot peco-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low

Looks good — clean reuse of WithFederatedTokenProvider* on the kernel path with correct type-switch ordering, context-threaded token resolution, and a telemetry short-circuit that avoids a second provider snapshot. One low-severity question about the account-wide (no client-id) federation path.

Comment thread kernel_config.go
@vuanhphung

Copy link
Copy Markdown
Collaborator Author

@eric-wang-1990 PTAL!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants