Skip to content

Conversation

@rujche
Copy link
Member

@rujche rujche commented Feb 4, 2026

Link to related API review page: https://spa.apiview.dev/review/3eb39a8f46944061ae3dd8536b3ff095?activeApiRevisionId=9ea852b0dd2a4dc38531617a1e0268cc&diffApiRevisionId=b40c95a2f29c423d959bd112d8e51598&diffStyle=trees

This pull request modernizes and improves the construction of KeyVaultLoadStoreParameter objects in the Azure Key Vault JCA library by introducing a builder pattern. This change makes the API more flexible and maintainable, and deprecates the older multi-argument constructors. The update also refactors usages throughout the codebase and test suite to leverage the new builder approach.

API modernization and maintainability

  • Introduced a Builder inner class and a static builder(String keyVaultUri) method in KeyVaultLoadStoreParameter, providing a fluent API for constructing instances and reducing reliance on overloaded constructors.
  • Deprecated the multi-argument constructors in KeyVaultLoadStoreParameter in favor of the builder pattern, with clear Javadoc annotations guiding users to the new API. [1] [2] [3]

Refactoring usages

  • Updated KeyVaultKeyStore.getKeyVaultKeyStoreBySystemProperty() to use the builder for constructing KeyVaultLoadStoreParameter and setting properties, improving readability and maintainability.
  • Refactored the test setup in KeyVaultKeyStoreTest.setEnvironmentProperty() to use the builder pattern for creating KeyVaultLoadStoreParameter instances.

Minor code improvements

  • Made the getAccessToken() method package-private to better encapsulate access within KeyVaultLoadStoreParameter.
  • Updated the main constructor to be private and used only by the builder, further enforcing the builder pattern and preventing direct instantiation with multiple parameters.# Description

If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes], no breaking change comparing to previous release.
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings February 4, 2026 02:44
@rujche rujche requested review from a team, Netyyyy, moarychan and saragluna as code owners February 4, 2026 02:44
@rujche rujche requested a review from srnagar February 4, 2026 02:44
@rujche rujche self-assigned this Feb 4, 2026
@rujche rujche added azure-spring All azure-spring related issues azure-spring-jca labels Feb 4, 2026
@rujche rujche added this to the 2026-02 milestone Feb 4, 2026
@rujche rujche moved this from Todo to In Progress in Spring Cloud Azure Feb 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

API Change Check

APIView identified API level changes in this PR and created the following API reviews

com.azure:azure-security-keyvault-jca

Copy link
Contributor

Copilot AI left a comment

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 addresses API review feedback for azure-security-keyvault-jca by introducing a builder-based construction API for KeyVaultLoadStoreParameter, deprecating older constructors, and refactoring call sites/tests to use the fluent builder.

Changes:

  • Added KeyVaultLoadStoreParameter.Builder and KeyVaultLoadStoreParameter.builder(String) for fluent construction.
  • Deprecated several existing KeyVaultLoadStoreParameter constructors and updated internal/test usage to prefer the builder.
  • Refactored KeyVaultKeyStore.getKeyVaultKeyStoreBySystemProperty() to construct parameters via the builder (including the challenge verification flag).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
sdk/keyvault/azure-security-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/KeyVaultLoadStoreParameter.java Introduces builder API and deprecates older constructors; refactors construction internals.
sdk/keyvault/azure-security-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/KeyVaultKeyStore.java Switches system-property parameter creation to the new builder flow.
sdk/keyvault/azure-security-keyvault-jca/src/test/java/com/azure/security/keyvault/jca/KeyVaultKeyStoreTest.java Updates test setup to create parameters using the builder.

@rujche rujche merged commit dff451e into main Feb 4, 2026
19 checks passed
@rujche rujche deleted the rujche/main/resolve-comments-in-api-review-for-azure-security-keyvault-jca branch February 4, 2026 06:21
@github-project-automation github-project-automation bot moved this from In Progress to Done in Spring Cloud Azure Feb 4, 2026
Netyyyy pushed a commit to Netyyyy/azure-sdk-for-java that referenced this pull request Feb 4, 2026
rujche added a commit that referenced this pull request Feb 5, 2026
rujche added a commit to Netyyyy/azure-sdk-for-java that referenced this pull request Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

azure-spring All azure-spring related issues azure-spring-jca

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants