Skip to content

fix: correct identity-verification base URL and tighten subdomain regex#431

Merged
armando-rodriguez-cko merged 3 commits into
masterfrom
fix/forward-identity-base-urls
May 12, 2026
Merged

fix: correct identity-verification base URL and tighten subdomain regex#431
armando-rodriguez-cko merged 3 commits into
masterfrom
fix/forward-identity-base-urls

Conversation

@armando-rodriguez-cko

@armando-rodriguez-cko armando-rodriguez-cko commented May 11, 2026

Copy link
Copy Markdown
Contributor

Summary

The identity-verification URL constants pointed at identity-verification.api.{sandbox.,}checkout.com (extra .api.), which is not the host defined in the swagger spec. This PR fixes the constants to use identity-verification.{sandbox.,}checkout.com and updates all nock mocks in the identities test suite to match. It also tightens the EnvironmentSubdomain regex to match the AWS PrivateLink prefix format documented at https://www.checkout.com/docs/developer-resources/api/private-connections/aws-privatelink^(?:pl-)?[a-z0-9]+$ (alphanumeric, optionally prefixed by the literal pl-).

Changes

  • src/config.js — fixes IDENTITY_VERIFICATION_SANDBOX_URL and IDENTITY_VERIFICATION_LIVE_URL host
  • src/EnvironmentSubdomain.js — tightens regex to ^(?:pl-)?[a-z0-9]+$
  • test/environment-subdomain/environment-subdomain.js — updates the corpus: test-123/foo-bar rejected, pl-vkuhvk4v (docs example) and pl-abc123 accepted, pl- (bare) rejected
  • test/identities/aml-screenings/aml-screenings-unit.js — nock URL fix
  • test/identities/applicants/applicants-unit.js — nock URL fix
  • test/identities/delegation/delegation-unit.js — nock URL fix
  • test/identities/face-authentications/face-authentications-unit.js — nock URL fix
  • test/identities/id-document-verifications/id-document-verifications-unit.js — nock URL fix
  • test/identities/identity-verifications/identity-verifications-unit.js — nock URL fix
  • test/identities/submodules/submodules-unit.js — nock URL fix

API Reference

  • https://identity-verification.checkout.com / https://identity-verification.sandbox.checkout.com — identity services (/applicants, /identity-verifications, /aml-verifications, /face-authentications, /id-document-verifications)
  • https://pl-{prefix}.api.{sandbox.,}checkout.com — AWS PrivateLink subdomain format

Breaking changes

  • None for the URL fix — the previous identity URL was not reachable on production, so any user attempting these endpoints would already be failing.
  • The subdomain regex is now stricter: arbitrary hyphenated subdomains like test-123 or foo-bar-baz are rejected. Only plain alphanumeric or the literal PrivateLink form (pl-{prefix}) are accepted.

README

Not affected.

Per the AWS PrivateLink docs (https://www.checkout.com/docs/developer-resources/api/private-connections/aws-privatelink),
the valid subdomain is the first eight characters of the client_id
(alphanumeric only), optionally with the literal pl- prefix when
calling through PrivateLink. Tighten the regex from RFC-1123-style
hyphenated to ^(?:pl-)?[a-z0-9]+$ and update the test corpus:
test-123 moves to the rejected list, pl-vkuhvk4v (the docs example)
joins the accepted list, and pl-, foo-bar are added as rejected.
@sonarqubecloud

Copy link
Copy Markdown

@armando-rodriguez-cko armando-rodriguez-cko requested a review from a team May 11, 2026 15:57
@armando-rodriguez-cko armando-rodriguez-cko merged commit b25b988 into master May 12, 2026
3 checks passed
@armando-rodriguez-cko armando-rodriguez-cko deleted the fix/forward-identity-base-urls branch May 12, 2026 09:30
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