Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer --url over empty Org Auth Token url #1913

Closed
szokeasaurusrex opened this issue Jan 23, 2024 · 0 comments · Fixed by #1914
Closed

Prefer --url over empty Org Auth Token url #1913

szokeasaurusrex opened this issue Jan 23, 2024 · 0 comments · Fixed by #1914
Assignees
Labels

Comments

@szokeasaurusrex
Copy link
Member

szokeasaurusrex commented Jan 23, 2024

If an Org Auth Token's payload defines an empty but not null url, then we should prefer the url provided as a command line argument via --url. The current behavior is to raise an error that the two urls don't match, which makes little sense, given that an empty url in the org Auth Token likely indicates a misconfigured Sentry self-hosted instance, and most users would expect the --url to take precedence.

With this change, we would prevent situations like the following: getsentry/sentry-javascript-bundler-plugins#465

@szokeasaurusrex szokeasaurusrex self-assigned this Jan 23, 2024
szokeasaurusrex added a commit that referenced this issue Jan 24, 2024
With this change, the CLI will treat an org auth token that specifies an empty URL the same way as an org auth token that is not specifying a URL at all.

We implemented this change in behavior by changing the type of the url in the AuthTokenPayload from an Option<String> to a String. In cases where the url previously would have been set to None, the url will now be set to an empty string. Uses of the AuthTokenPayload's url field have been updated to treat empty strings the way they previously treated None values.

Fixes GH-1913
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant