Make token cache public#49712
Open
g2vinay wants to merge 3 commits into
Open
Conversation
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
Contributor
There was a problem hiding this comment.
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
AccessTokenCachetocom.azure.core.credentialand expanded its public JavaDoc. - Updated
BearerTokenAuthenticationPolicyand 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'sRedundantImportrule (seeeng/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
LineLengthCheckstyle rule (seeeng/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; |
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.
Makes AccessTokenCache Public