fix/BUNYIP-188-cors-origin-comma-list #210

Merged
YousifShkara merged 2 commits from fix/BUNYIP-188-cors-origin-comma-list into main 2026-06-24 09:59:35 +02:00
Owner
No description provided.
`StripeConfig::from_env` derives the Stripe Checkout `success_url` and
`cancel_url` fallback from `CORS_ORIGIN`. `CORS_ORIGIN` is a comma-separated
list of allowed origins everywhere else in the codebase: on the dev-sso
stack it lands as e.g. `"https://x-bunyip.a8n.run,https://x-mokosh.a8n.run"`.
The old fallback interpolated the entire list, producing
`"https://x-bunyip.a8n.run,https://x-mokosh.a8n.run/checkout/success"`,
and Stripe rejected that URL at session creation.

BUNYIP-175 PR #208 papered over this by forcing operators to set
`STRIPE_SUCCESS_URL` / `STRIPE_CANCEL_URL` explicitly in their `.env`. This
fixes the underlying fallback: a new `first_origin` helper splits the
value on `,`, trims whitespace per entry, and returns the first non-empty
origin. Explicit env-var overrides still take precedence (BUNYIP-175 PR
#208 behaviour preserved).

Five unit tests cover: single-origin pass-through, comma-list first-wins,
whitespace trimming, empty-entry skipping, all-empty returning `None`.

#BUNYIP-188
chore: cargo fmt
All checks were successful
E2E / Playwright against deployment (pull_request) Successful in 15s
Check / fmt + clippy + build + tests (pull_request) Successful in 2m41s
Create release / Create release from merged PR (pull_request) Has been skipped
7415fac603
YousifShkara deleted branch fix/BUNYIP-188-cors-origin-comma-list 2026-06-24 09:59:36 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/bunyip!210
No description provided.