feat(provider/lambdai): add Kubernetes workload identity auth - #440
Open
alaski-lambda wants to merge 3 commits into
Open
feat(provider/lambdai): add Kubernetes workload identity auth#440alaski-lambda wants to merge 3 commits into
alaski-lambda wants to merge 3 commits into
Conversation
Contributor
Greptile SummaryThe PR adds Kubernetes workload-identity authentication to the Lambda AI provider.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previously reported credential-selection, alias-handling, and stale-401 invalidation issues are addressed by the current implementation and targeted regression tests. Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant Loader as Lambda Provider Loader
participant Cache as Workload Identity Cache
participant OIDC as Lambda OIDC Endpoint
participant API as Lambda Topology API
Client->>Loader: Generate topology request
alt Explicit token supplied
Loader->>API: Topology request with static token
else Pod workload identity
Loader->>Cache: Request API key
alt No usable cached key
Cache->>OIDC: Exchange projected ServiceAccount token
OIDC-->>Cache: Short-lived API key
end
Cache-->>Loader: Cached or refreshed API key
Loader->>API: Topology request with API key
alt API returns 401
Loader->>Cache: Invalidate rejected key if current
Cache->>OIDC: Exchange token
OIDC-->>Cache: Replacement API key
Loader->>API: Retry once with replacement key
end
end
API-->>Client: Topology response
Reviews (10): Last reviewed commit: "fix(provider/lambdai): harden workload-i..." | Re-trigger Greptile |
alaski-lambda
force-pushed
the
feat/lambdai-workload-identity-upstream
branch
2 times, most recently
from
July 31, 2026 17:09
19048f2 to
2c6a9e0
Compare
alaski-lambda
force-pushed
the
feat/lambdai-workload-identity-upstream
branch
2 times, most recently
from
July 31, 2026 17:58
b70716a to
0923802
Compare
alaski-lambda
force-pushed
the
feat/lambdai-workload-identity-upstream
branch
from
July 31, 2026 18:15
0923802 to
51d93fb
Compare
Authenticate the lambdai provider with Kubernetes workload identity instead of a long-lived API token Secret. When lambda-pod-identity-webhook injects LAMBDA_ROLE_LRN and LAMBDA_WORKLOAD_IDENTITY_TOKEN_FILE into the pod, topograph exchanges the projected ServiceAccount token at POST /api/v1/oidc/token for a short-lived Lambda API key, caches it process-wide, and refreshes it before expiry (single-flight, jittered, and tolerant of a transient exchange failure while the cached key is valid). Static-token mode is unchanged when LAMBDA_ROLE_LRN is absent. Signed-off-by: Andrew Laski <alaski@lambdal.com>
alaski-lambda
force-pushed
the
feat/lambdai-workload-identity-upstream
branch
from
August 3, 2026 19:43
51d93fb to
d0cbe1c
Compare
Collaborator
|
/ok-to-test 36c6a9a |
Contributor
|
🌿 Preview your docs: https://nvidia-preview-pull-request-440.docs.buildwithfern.com/topograph |
dmitsh
reviewed
Aug 3, 2026
dmitsh
reviewed
Aug 3, 2026
Addresses review feedback on the workload-identity implementation. Reject duplicate case-insensitive spellings of a credential key. mapstructure matches keys case-insensitively, so "token" and "Token" both feed the same field and Go's randomized map iteration chose the winner -- the same request could authenticate as a different principal, or against a different workspace, from one run to the next. The ambiguity is reported rather than resolved arbitrarily. Share a failed token refresh with queued callers. The graceful-degradation path returned the still-valid cached key but left refreshAt untouched, so every caller queued behind refreshMu observed the same refresh-due state and ran its own retry cycle against a failing endpoint. The next attempt is now deferred, never past the hard expiry, and republished as a copy so values already handed out stay immutable. Bound the process-level credential cache. baseURL is a per-request provider parameter, so the cache key space is caller-controlled; entries are evicted in insertion order, which costs at most one extra exchange. Move the test-only resetCredentialCache helper into token_test.go. Signed-off-by: Andrew Laski <alaski@lambdal.com>
alaski-lambda
force-pushed
the
feat/lambdai-workload-identity-upstream
branch
from
August 4, 2026 13:38
b315a66 to
490717e
Compare
Contributor
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
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.
Authenticate the lambdai provider with Kubernetes workload identity instead of a long-lived API token Secret. When lambda-pod-identity-webhook injects LAMBDA_ROLE_LRN and LAMBDA_WORKLOAD_IDENTITY_TOKEN_FILE into the pod, topograph exchanges the projected ServiceAccount token at POST /api/v1/oidc/token for a short-lived Lambda API key, caches it process-wide, and refreshes it before expiry (single-flight, jittered, and tolerant of a transient exchange failure while the cached key is valid).
Static-token mode is unchanged when LAMBDA_ROLE_LRN is absent.
Description
Checklist
git commit -s).