Skip to content

feat(server): Read X-Os-Auth from query params#431

Draft
lcian wants to merge 1 commit intomainfrom
lcian/x-os-auth-query-param
Draft

feat(server): Read X-Os-Auth from query params#431
lcian wants to merge 1 commit intomainfrom
lcian/x-os-auth-query-param

Conversation

@lcian
Copy link
Copy Markdown
Member

@lcian lcian commented Apr 15, 2026

This change is needed for getsentry/sentry#113030.
It allows frontend pages that use standard image components to slap ?X-Os-Auth=<token> to the URLs they retrieve images from, as opposed to needing custom logic to add it as a header whenever the image is known to be stored in Objectstore.

This is the final piece of the puzzle that will allow us to enable auth enforcement and unblock Emerge for EA of Snapshots.
The proper solution would be pre-signed URLs, but that needs design and is significantly more complex. We don't want that to be a blocker for Snapshots.
Moreover, we're already passing JWTs around anyways (see symbolicator for attachments and sentry-cli for snapshot uploads).

Read the auth token from the `X-Os-Auth` query parameter as a fallback
between the `X-Os-Auth` header and the `Authorization` header. The query
parameter value is the raw JWT without a `Bearer` prefix, useful for
contexts where headers cannot be set (e.g. browser-initiated requests).

Precedence: X-Os-Auth header > X-Os-Auth query param > Authorization header.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant