Skip to content

Make token cache public#49712

Open
g2vinay wants to merge 3 commits into
Azure:mainfrom
g2vinay:make-token-cache-public
Open

Make token cache public#49712
g2vinay wants to merge 3 commits into
Azure:mainfrom
g2vinay:make-token-cache-public

Conversation

@g2vinay

@g2vinay g2vinay commented Jul 2, 2026

Copy link
Copy Markdown
Member

Makes AccessTokenCache Public

g2vinay added 3 commits July 2, 2026 11:00
Move AccessTokenCache from com.azure.core.implementation to the public
com.azure.core.credential package, alongside SimpleTokenCache. The class
is now part of the public API surface of azure-core.

Changes:
- Move AccessTokenCache.java to com.azure.core.credential package
- Add comprehensive public JavaDoc
- Update import in BearerTokenAuthenticationPolicy
- Move AccessTokenCacheTests to com.azure.core.credential test package
- Update import in TokenCacheTests
Copilot AI review requested due to automatic review settings July 2, 2026 18:13
@github-actions github-actions Bot added the Azure.Core azure-core label Jul 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR promotes AccessTokenCache from the internal com.azure.core.implementation namespace into the public com.azure.core.credential API surface, and updates in-repo usages and tests accordingly.

Changes:

  • Moved AccessTokenCache to com.azure.core.credential and expanded its public JavaDoc.
  • Updated BearerTokenAuthenticationPolicy and test code to reference the new public package.
  • Added a CHANGELOG entry documenting the newly-public API.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sdk/core/azure-core/src/test/java/com/azure/core/credential/TokenCacheTests.java Updates AccessTokenCache import to the new public package.
sdk/core/azure-core/src/test/java/com/azure/core/credential/AccessTokenCacheTests.java Moves the test into the com.azure.core.credential package.
sdk/core/azure-core/src/main/java/com/azure/core/http/policy/BearerTokenAuthenticationPolicy.java Updates the policy to import AccessTokenCache from the public credential package.
sdk/core/azure-core/src/main/java/com/azure/core/credential/AccessTokenCache.java Promotes AccessTokenCache to a public package and adds extensive JavaDoc + sample.
sdk/core/azure-core/CHANGELOG.md Documents the promotion of AccessTokenCache as a feature addition.
Comments suppressed due to low confidence (2)

sdk/core/azure-core/src/test/java/com/azure/core/credential/AccessTokenCacheTests.java:8

  • These imports are from the same package as the test (com.azure.core.credential) and will be flagged by Checkstyle's RedundantImport rule (see eng/lintingconfigs/checkstyle/track2/checkstyle.xml:64-73). Remove the redundant imports.
    sdk/core/azure-core/src/main/java/com/azure/core/credential/AccessTokenCache.java:53
  • The embedded Javadoc sample contains very long lines (due to HTML entities) that are likely to exceed the repo's 120-character LineLength Checkstyle rule (see eng/lintingconfigs/checkstyle/track2/checkstyle.xml:53-59). Please wrap the sample statements similarly to other credential samples to avoid Checkstyle failures.

Comment on lines 4 to 8
package com.azure.core.credential;

import com.azure.core.implementation.AccessTokenCache;
import com.azure.core.credential.AccessTokenCache;
import org.junit.jupiter.api.Test;
import reactor.core.publisher.Flux;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure.Core azure-core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants