fix: correct identity-verification base URL and tighten subdomain regex#431
Merged
Merged
Conversation
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.
|
david-ruiz-cko
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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 useidentity-verification.{sandbox.,}checkout.comand updates allnockmocks in the identities test suite to match. It also tightens theEnvironmentSubdomainregex 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 literalpl-).Changes
src/config.js— fixesIDENTITY_VERIFICATION_SANDBOX_URLandIDENTITY_VERIFICATION_LIVE_URLhostsrc/EnvironmentSubdomain.js— tightens regex to^(?:pl-)?[a-z0-9]+$test/environment-subdomain/environment-subdomain.js— updates the corpus:test-123/foo-barrejected,pl-vkuhvk4v(docs example) andpl-abc123accepted,pl-(bare) rejectedtest/identities/aml-screenings/aml-screenings-unit.js— nock URL fixtest/identities/applicants/applicants-unit.js— nock URL fixtest/identities/delegation/delegation-unit.js— nock URL fixtest/identities/face-authentications/face-authentications-unit.js— nock URL fixtest/identities/id-document-verifications/id-document-verifications-unit.js— nock URL fixtest/identities/identity-verifications/identity-verifications-unit.js— nock URL fixtest/identities/submodules/submodules-unit.js— nock URL fixAPI 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 formatBreaking changes
test-123orfoo-bar-bazare rejected. Only plain alphanumeric or the literal PrivateLink form (pl-{prefix}) are accepted.README
Not affected.