Skip to content

Accept any string for auth.site, validate at startup#387

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
oliver/accept-any-string-for-auth.site-validate-at-startup
May 22, 2026
Merged

Accept any string for auth.site, validate at startup#387
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
oliver/accept-any-string-for-auth.site-validate-at-startup

Conversation

@oliverli
Copy link
Copy Markdown
Collaborator

@oliverli oliverli commented May 22, 2026

Summary

  • Loosen the user-facing AuthOptions.site type from the Site union to plain string, so callers can pass values sourced from env vars or dynamic config without TypeScript friction.
  • Runtime behaviour is unchanged: validateOptions already validates auth.site against the SITES list at startup (via resolveSite) and throws an aggregated error for unsupported sites.
  • AuthOptionsWithDefaults still narrows site back to Site (via Omit<AuthOptions, 'site'> & { site: Site }), so downstream consumers (RUM SDK config, Metrics URL templates, Error Tracking, Apps) keep the constrained type.

Test plan

  • yarn typecheck:all
  • yarn test:unit packages/factory (covers validateOptions)
  • yarn cli integrity

🤖 Generated with Claude Opus 4.7

Loosen the user-facing AuthOptions.site type from the Site union to
plain string so customers can pass values from env vars or config
files without TypeScript friction. Validation in validateOptions
already rejects unknown sites at startup, so this is a type-only
change. AuthOptionsWithDefaults still narrows site back to Site for
downstream consumers (RUM SDK, Metrics URLs, etc).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@oliverli oliverli marked this pull request as ready for review May 22, 2026 19:00
@oliverli oliverli requested a review from yoannmoinet as a code owner May 22, 2026 19:00
Copy link
Copy Markdown
Member

@yoannmoinet yoannmoinet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit 77a0746 into master May 22, 2026
7 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the oliver/accept-any-string-for-auth.site-validate-at-startup branch May 22, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants