Skip to content

Conversation

rudsi
Copy link
Contributor

@rudsi rudsi commented Jul 27, 2025

Closes the issue #10422

This PR introduces a thread-safe, in-memory cache for the OIDC client credentials access token.

Previously, a new token was fetched via a network call for every protected outbound request, causing unnecessary latency. This change implements a double-checked locking pattern to ensure a token is fetched only when the cached one is missing or expired.

Caches the token to improve performance. Closes helidon-io#10422.
Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Jul 27, 2025
Copy link

Thank you for signing the OCA.

@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Verified All contributors have signed the Oracle Contributor Agreement. and removed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. labels Jul 28, 2025
@rudsi rudsi changed the title issue(#10422): Add caching for client credentials token Add caching for client credentials token Jul 28, 2025
@rudsi
Copy link
Contributor Author

rudsi commented Jul 28, 2025

Hi @botsteve, I’ve opened a PR for the issue. Please review it when you get a chance and let me know if any changes are needed. Thanks!

@rudsi
Copy link
Contributor Author

rudsi commented Jul 29, 2025

Hi @spericas, when you have a moment, could you please review this PR for me? Thanks!

@rudsi
Copy link
Contributor Author

rudsi commented Jul 29, 2025

Hi @spericas, resolved checkstyle errors, could you please approve the workflow.

@romain-grecourt
Copy link
Contributor

Please try to avoid (re)formatting code that you aren't modifying.
This will remove the noise from your diffs and make it easier to review your changes.

@rudsi
Copy link
Contributor Author

rudsi commented Jul 30, 2025

Hi @romain-grecourt,
The reformatting in the previous commit was a result of my IDE settings—I'll make sure to avoid that in the future.

I've addressed the bugs which were causing the build checks to fail. When you have some time, I’d appreciate it if you could review the latest changes.

Thanks!

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

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants