-
Notifications
You must be signed in to change notification settings - Fork 146
Add support for WWW-Authenticate header (SCA associations management) #1585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
18403df to
9e072d4
Compare
There was a problem hiding this 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 pull request adds support for the WWW-Authenticate header in request handling, enabling SCA (Strong Customer Authentication) associations management functionality.
Key Changes:
- Updated Mustache templates to exclude header parameters from method signatures and include required query parameters in Javadoc
- Added
wwwAuthenticateHeadersupport toRequestOptionswith getter, setter, and builder pattern method - Generated new service classes and models for SCA device and association management
- Corrected parameter ordering in transfer limits API methods
Reviewed Changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
templates-v7/libraries/jersey3/api_summary_overload.mustache |
Modified Javadoc generation to include path and required query params separately |
templates-v7/libraries/jersey3/api_overload.mustache |
Updated to exclude header and body params from required params list |
src/main/java/com/adyen/model/RequestOptions.java |
Added WWW-Authenticate header field with getter/setter and addAdditionalServiceHeader helper |
src/main/java/com/adyen/httpclient/AdyenHttpClient.java |
Added logic to set WWW-Authenticate header from RequestOptions |
src/main/java/com/adyen/constants/ApiConstants.java |
Added WWW_AUTHENTICATE_HEADER constant |
src/main/java/com/adyen/service/balanceplatform/ScaAssociationManagementApi.java |
New service API for managing SCA associations |
src/main/java/com/adyen/service/balanceplatform/ScaDeviceManagementApi.java |
New service API for managing SCA devices |
src/main/java/com/adyen/service/balanceplatform/TransferLimits*.java |
Fixed parameter ordering for consistency |
src/main/java/com/adyen/model/balanceplatform/* |
Generated models for SCA entities, devices, associations, and requests/responses |
src/test/java/com/adyen/BalancePlatformTest.java |
Added comprehensive tests for SCA management operations |
src/test/java/com/adyen/httpclient/ClientTest.java |
Added tests for WWW-Authenticate header and addAdditionalServiceHeader helper |
src/test/resources/mocks/balancePlatform/*.json |
Added mock response files for SCA operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import java.util.ArrayList; | ||
| import java.util.List; |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant imports: java.util.* already includes ArrayList and List, so the explicit imports on lines 19-20 are unnecessary.
| import java.util.ArrayList; | |
| import java.util.List; |
| import java.util.ArrayList; | ||
| import java.util.List; |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant imports: java.util.* already includes ArrayList and List, so the explicit imports on lines 19-20 are unnecessary.
| import java.util.ArrayList; | |
| import java.util.List; |
| import java.util.ArrayList; | ||
| import java.util.List; |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant imports: java.util.* already includes ArrayList and List, so the explicit imports on lines 19-20 are unnecessary.
| import java.util.ArrayList; | |
| import java.util.List; |
| import java.util.ArrayList; | ||
| import java.util.List; |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant imports: java.util.* already includes ArrayList and List, so the explicit imports on lines 19-20 are unnecessary.
| import java.util.ArrayList; | |
| import java.util.List; |
| import java.util.ArrayList; | ||
| import java.util.List; |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant imports: java.util.* already includes ArrayList and List, so the explicit imports on lines 19-20 are unnecessary.
| import java.util.ArrayList; | |
| import java.util.List; |
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
| import com.fasterxml.jackson.core.JsonProcessingException; | ||
| import java.util.*; |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused wildcard import: java.util.* is imported but no types from this package are used in the class except Objects, which should be imported explicitly.
| import java.util.*; | |
| import java.util.Objects; |
| import java.util.*; | ||
|
|
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused wildcard import: java.util.* is imported but no types from this package are used in the class except Objects, which should be imported explicitly.
| import java.util.*; |
| import java.util.*; | ||
|
|
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused wildcard import: java.util.* is imported but no types from this package are used in the class except Objects, which should be imported explicitly.
| import java.util.*; |
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
| import com.fasterxml.jackson.core.JsonProcessingException; | ||
| import java.util.*; |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused wildcard import: java.util.* is imported but no types from this package are used in the class except Objects, which should be imported explicitly.
| import java.util.*; | |
| import java.util.Objects; |
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
| import com.fasterxml.jackson.core.JsonProcessingException; | ||
| import java.util.*; |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused wildcard import: java.util.* is imported but no types from this package are used in the class except Objects, which should be imported explicitly.
| import java.util.*; | |
| import java.util.Objects; |
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces support for the WWW-Authenticate header, which is now configurable through RequestOptions. It also adds new services for SCA (Strong Customer Authentication) association and device management, complete with new models and comprehensive tests. Additionally, the code generation templates have been updated, resulting in cleaner Javadocs and more consistent method signatures across the API.
My review focuses on the impact of these changes. I've identified a few public methods where parameter order has changed, which constitutes a breaking change. I've also noted a minor usability issue in one of the new service methods regarding pagination parameters. The rest of the changes, including the new features and tests, are well-implemented and consistent with the existing codebase.
src/main/java/com/adyen/service/balanceplatform/TransferLimitsBalanceAccountLevelApi.java
Show resolved
Hide resolved
src/main/java/com/adyen/service/balanceplatform/TransferLimitsBalanceAccountLevelApi.java
Show resolved
Hide resolved
src/main/java/com/adyen/service/balanceplatform/TransferLimitsBalancePlatformLevelApi.java
Show resolved
Hide resolved
src/main/java/com/adyen/service/balanceplatform/TransferLimitsBalancePlatformLevelApi.java
Show resolved
Hide resolved
src/main/java/com/adyen/service/balanceplatform/ScaAssociationManagementApi.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces support for the WWW-Authenticate header, which has been correctly implemented in RequestOptions and AdyenHttpClient. A significant portion of the changes involves the addition of auto-generated model and service classes for SCA association management. The PR also includes several valuable fixes and improvements, such as removing duplicate Javadoc parameters and enhancing code generation templates for better clarity and consistency. I've noted a few breaking changes in method signatures within the TransferLimitsBalanceAccountLevelApi and TransferLimitsBalancePlatformLevelApi classes, where parameter orders were swapped to improve consistency with API endpoint paths. These have been flagged as medium-severity issues due to their impact on existing users of the library. The new tests for the SCA functionality are well-written and provide good coverage.
src/main/java/com/adyen/service/balanceplatform/TransferLimitsBalanceAccountLevelApi.java
Show resolved
Hide resolved
src/main/java/com/adyen/service/balanceplatform/TransferLimitsBalanceAccountLevelApi.java
Show resolved
Hide resolved
src/main/java/com/adyen/service/balanceplatform/TransferLimitsBalancePlatformLevelApi.java
Show resolved
Hide resolved
src/main/java/com/adyen/service/balanceplatform/TransferLimitsBalancePlatformLevelApi.java
Show resolved
Hide resolved
eaa48de to
2eb23f7
Compare
|
LGTM, as we talked offline, there is a tradeoff in devx by not making the header explicitly required on the builder for SCA. I think this PR still lays the groundwork for that anyway. |
PR to add support for
WWW-Authenticate:RequestOptions, same approach used forIdempotencyKey