Skip to content

feature/INT-1697 - Oauth scopes review - #667

Merged
david-ruiz-cko merged 3 commits into
masterfrom
feature/INT-1697
Sep 15, 2026
Merged

david-ruiz-cko merged 3 commits into
masterfrom
feature/INT-1697

Conversation

@david-ruiz-cko

Copy link
Copy Markdown
Contributor

This pull request updates the OAuthScope enum to synchronize it with the latest Checkout.com API specification, ensuring all documented OAuth 2.0 scopes are present and correctly named. It adds missing scopes, removes deprecated ones, and improves test coverage to catch future discrepancies. Additionally, integration tests are updated to use the correct, current scopes.

OAuthScope enum synchronization and improvements:

  • Added missing OAuth 2.0 scopes (e.g., DISPUTES_SCHEME_FILES, FLOW_REFLOW, ISSUING_DISPUTES, VAULT_CUSTOMERS, VAULT_GPAYME_ENROLLMENT, VAULT_TOKENS_METADATA, compliance-related scopes, etc.) and removed deprecated/retired ones (e.g., MARKETPLACE, ISSUING_CARD_MGMT, ISSUING_CLIENT, FORWARD, FORWARD_SECRETS) to match the API spec. [1] [2] [3]
  • Clarified the distinction between PAYMENT_CONTEXT and GATEWAY_PAYMENT_CONTEXTS scopes, correcting previous naming and value mismatches.
  • Updated enum documentation to explain scope origins, naming, and special cases for easier maintenance.

Test enhancements:

  • Added comprehensive tests to ensure all enum constants have non-blank, unique wire values, and that the enum is maintained in alphabetical order.
  • Added tests to verify the presence and correct values of all newly added or renamed scopes, and to distinguish between similarly named but different scopes.

Integration test updates:

  • Updated integration tests to use the correct, current scopes—removing retired ones and replacing them with their documented equivalents (e.g., using ACCOUNTS instead of MARKETPLACE, and the new issuing scopes instead of ISSUING_CARD_MGMT/ISSUING_CLIENT). [1] [2]

@david-ruiz-cko
david-ruiz-cko requested a review from a team September 14, 2026 08:16
@agent-wall-e

agent-wall-e Bot commented Sep 14, 2026

Copy link
Copy Markdown

🔴 Risk Classification: MAJOR

Approval route: AI Review + Human Approval Required
Rollback controls: Change-freeze window + documented rollback plan

Classification reasons

  • security_sensitive_path:src/main/java/com/checkout/OAuthScope.java
  • security_sensitive_path:src/test/java/com/checkout/OAuthScopeTest.java

Operational gates

  • ✅ jira_ticket (INT-1697)
  • ✅ independent_review

Files analysed: 4


wall-e 2026.06.19-02 · policy 376219bc71e6…

@agent-wall-e

agent-wall-e Bot commented Sep 14, 2026

Copy link
Copy Markdown
🔬 Debug — why this classification?

Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.

Reason code Kind Clause Meaning
security_sensitive_pathsrc/main/java/com/checkout/OAuthScope.java classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).
security_sensitive_pathsrc/test/java/com/checkout/OAuthScopeTest.java classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

See issue #3 for the proposal to formalise this map as Appendix A of the standards doc.

wall-e 2026.06.19-02 · debug

@agent-wall-e

agent-wall-e Bot commented Sep 14, 2026

Copy link
Copy Markdown

🔵 Advisory review: Sound, but needs your judgement

This PR needs a human approval. The code itself reads as correct; whether it should land depends on context I don't have.

The PR synchronizes the OAuthScope enum with the Checkout.com API spec, adds new scopes, retains backward-compat legacy scopes, and updates integration tests to use current scope names. The code is technically correct and well-documented, but the integration test changes to live scope requests are consequential operational decisions that require someone who knows the actual sandbox/production provisioning.

For you to decide

  • AccountsPayoutSchedulesIT switches from MARKETPLACE to ACCOUNTS — the inline comment acknowledges the sandbox payouts client may be provisioned for marketplace and reject accounts with invalid_scope, which is a direct contradiction with the intent of this change; a human with sandbox access must verify the specific client used here actually accepts accounts.
  • BaseIssuingTestIT removes ISSUING_CLIENT with the comment 'the latter has no documented equivalent' — if any issuing operation actually requires that scope at runtime, dropping it will silently break those integration tests; someone with knowledge of what the sandbox issuing client is provisioned for needs to confirm.
  • FORWARD and FORWARD_SECRETS were previously listed as retired in the PR description, but the diff shows them being added (moved from the end of the file into alphabetical position) and kept without any 'not in spec' comment — the PR description's claim that they are removed is incorrect per the diff, which a reviewer should confirm is intentional.
  • PAYMENT_CONTEXT has the wire value 'Payment Context' (space and capital letter) mirrored verbatim from spec — this is flagged as a likely spec authoring defect in both the Javadoc and tests, so a human should decide whether to mirror the defect or normalize it before it reaches callers.
  • The rename of PAYMENT_CONTEXTS → GATEWAY_PAYMENT_CONTEXTS is a breaking API change for any existing caller who references OAuthScope.PAYMENT_CONTEXTS by name; there is no deprecation bridge, so any SDK consumer on this version will get a compile error.
  • The new alphabetical-order enforcement test is a reasonable structural guard, but if it ever fails in CI it will block unrelated PRs — a reviewer should decide whether that strictness is desired policy.

⚠️ The diff was too large to read in full, so this review covers only part of the change.


This is not an approval. wall-e cannot auto-approve this PR — it is an opinion to help whoever does. Advisory review · us.anthropic.claude-sonnet-4-6 · wall-e 2026.06.19-02

@agent-wall-e

agent-wall-e Bot commented Sep 14, 2026

Copy link
Copy Markdown

🔴 Risk Classification: MAJOR

Approval route: AI Review + Human Approval Required
Rollback controls: Change-freeze window + documented rollback plan

Classification reasons

  • security_sensitive_path:src/main/java/com/checkout/OAuthScope.java
  • security_sensitive_path:src/test/java/com/checkout/OAuthScopeTest.java

Operational gates

  • ✅ jira_ticket (INT-1697)
  • ✅ independent_review

Files analysed: 4


wall-e 2026.06.19-02 · policy 376219bc71e6…

@agent-wall-e

agent-wall-e Bot commented Sep 14, 2026

Copy link
Copy Markdown
🔬 Debug — why this classification?

Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.

Reason code Kind Clause Meaning
security_sensitive_pathsrc/main/java/com/checkout/OAuthScope.java classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).
security_sensitive_pathsrc/test/java/com/checkout/OAuthScopeTest.java classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

See issue #3 for the proposal to formalise this map as Appendix A of the standards doc.

wall-e 2026.06.19-02 · debug

@agent-wall-e

agent-wall-e Bot commented Sep 15, 2026

Copy link
Copy Markdown

🔴 Risk Classification: MAJOR

Approval route: AI Review + Human Approval Required
Rollback controls: Change-freeze window + documented rollback plan

Classification reasons

  • security_sensitive_path:src/main/java/com/checkout/OAuthScope.java
  • security_sensitive_path:src/test/java/com/checkout/OAuthScopeTest.java

Operational gates

  • ✅ jira_ticket (INT-1697)
  • ✅ independent_review

Files analysed: 4


wall-e 2026.06.19-02 · policy 376219bc71e6…

@agent-wall-e

agent-wall-e Bot commented Sep 15, 2026

Copy link
Copy Markdown
🔬 Debug — why this classification?

Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.

Reason code Kind Clause Meaning
security_sensitive_pathsrc/main/java/com/checkout/OAuthScope.java classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).
security_sensitive_pathsrc/test/java/com/checkout/OAuthScopeTest.java classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

See issue #3 for the proposal to formalise this map as Appendix A of the standards doc.

wall-e 2026.06.19-02 · debug

@sonarqubecloud

Copy link
Copy Markdown

@david-ruiz-cko
david-ruiz-cko merged commit 39346b1 into master Sep 15, 2026
6 of 7 checks passed
@david-ruiz-cko
david-ruiz-cko deleted the feature/INT-1697 branch September 15, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants