Skip to content

Conversation

@gcatanese
Copy link
Contributor

@gcatanese gcatanese commented Nov 10, 2025

PR to add support for WWW-Authenticate:

  • update templates to NOT include header in the signature
  • add support for the header in RequestOptions, same approach used for IdempotencyKey
  • generate services/models and add tests
  • add test to verify response headers are available when the API returns 401 (ApiException)

@gcatanese gcatanese requested a review from Copilot November 10, 2025 12:53
Copy link

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 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 wwwAuthenticateHeader support to RequestOptions with 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.

Comment on lines +19 to +20
import java.util.ArrayList;
import java.util.List;
Copy link

Copilot AI Nov 10, 2025

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.

Suggested change
import java.util.ArrayList;
import java.util.List;

Copilot uses AI. Check for mistakes.
Comment on lines +19 to +20
import java.util.ArrayList;
import java.util.List;
Copy link

Copilot AI Nov 10, 2025

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.

Suggested change
import java.util.ArrayList;
import java.util.List;

Copilot uses AI. Check for mistakes.
Comment on lines +19 to +20
import java.util.ArrayList;
import java.util.List;
Copy link

Copilot AI Nov 10, 2025

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.

Suggested change
import java.util.ArrayList;
import java.util.List;

Copilot uses AI. Check for mistakes.
Comment on lines +19 to +20
import java.util.ArrayList;
import java.util.List;
Copy link

Copilot AI Nov 10, 2025

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.

Suggested change
import java.util.ArrayList;
import java.util.List;

Copilot uses AI. Check for mistakes.
Comment on lines +20 to +21
import java.util.ArrayList;
import java.util.List;
Copy link

Copilot AI Nov 10, 2025

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.

Suggested change
import java.util.ArrayList;
import java.util.List;

Copilot uses AI. Check for mistakes.
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.util.*;
Copy link

Copilot AI Nov 10, 2025

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.

Suggested change
import java.util.*;
import java.util.Objects;

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +19
import java.util.*;

Copy link

Copilot AI Nov 10, 2025

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.

Suggested change
import java.util.*;

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +19
import java.util.*;

Copy link

Copilot AI Nov 10, 2025

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.

Suggested change
import java.util.*;

Copilot uses AI. Check for mistakes.
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.util.*;
Copy link

Copilot AI Nov 10, 2025

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.

Suggested change
import java.util.*;
import java.util.Objects;

Copilot uses AI. Check for mistakes.
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.util.*;
Copy link

Copilot AI Nov 10, 2025

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.

Suggested change
import java.util.*;
import java.util.Objects;

Copilot uses AI. Check for mistakes.
@gcatanese
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

@gcatanese gcatanese marked this pull request as ready for review November 12, 2025 14:26
@gcatanese gcatanese requested review from a team as code owners November 12, 2025 14:26
@gcatanese gcatanese added the Enhancement Indicates new feature requests label Nov 12, 2025
@galesky-a
Copy link

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.

@gcatanese gcatanese merged commit 671ca0c into main Nov 14, 2025
4 checks passed
@gcatanese gcatanese added Feature Indicates a new feature addition and removed Enhancement Indicates new feature requests labels Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Indicates a new feature addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants