Skip to content

UID2-4739: use DefaultCredentialsProvider for KMS client in JWTTokenProvider#406

Open
sophia-chen-ttd wants to merge 3 commits into
mainfrom
sch-UID2-4739-credentials-provider-fix
Open

UID2-4739: use DefaultCredentialsProvider for KMS client in JWTTokenProvider#406
sophia-chen-ttd wants to merge 3 commits into
mainfrom
sch-UID2-4739-credentials-provider-fix

Conversation

@sophia-chen-ttd

@sophia-chen-ttd sophia-chen-ttd commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

JWTTokenProvider explicitly constructs WebIdentityTokenFileCredentialsProvider for KMS access, which ties it to OIDC/IRSA. Switching to DefaultCredentialsProvider makes it compatible with EKS Pod Identity, instance profiles, and any future credential mechanism — matching the standard AWS SDK v2 best practice of letting the credential chain resolve at runtime.

  • Replace WebIdentityTokenFileCredentialsProvider.create() with DefaultCredentialsProvider.create() in the non-static-credentials branch of getKmsClient
  • Update the corresponding import

Companion fix to CloudStorageS3.java (UID2-4739).

Test plan

  • Verify existing IRSA-based environments continue to work (DefaultCredentialsProvider falls through to the web identity token file provider in its chain)
  • Update trust policies of EKS cluster to Pod Identity (not IRSA) and verify KMS signing succeeds
  • Verify static-credentials path (accessKeyId/secretAccessKey set in config) is unchanged

🤖 Generated with Claude Code

…rovider

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@sophia-chen-ttd sophia-chen-ttd left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The swap from WebIdentityTokenFileCredentialsProvider to DefaultCredentialsProvider is correct and aligns with AWS SDK v2 best practice. The change broadens credential chain support (IRSA, EKS Pod Identity, instance profiles, env vars, etc.) without affecting the static-credentials fast-path. No functional regressions are expected, but the expanded credential chain introduces some operational subtleties worth noting.

Comment thread src/main/java/com/uid2/core/service/JWTTokenProvider.java
Comment thread src/main/java/com/uid2/core/service/JWTTokenProvider.java
Comment thread src/main/java/com/uid2/core/service/JWTTokenProvider.java
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.

1 participant