Skip to content

feat(sentry-apps): send custom headers on all external requests#119530

Merged
cvxluo merged 1 commit into
cvxluo/extract-webhook-header-parsing-and-masking-helpersfrom
cvxluo/send-custom-headers-on-all-external-requests
Jul 13, 2026
Merged

feat(sentry-apps): send custom headers on all external requests#119530
cvxluo merged 1 commit into
cvxluo/extract-webhook-header-parsing-and-masking-helpersfrom
cvxluo/send-custom-headers-on-all-external-requests

Conversation

@cvxluo

@cvxluo cvxluo commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

When custom headers are set, send them on all external requests. This can change the headers for custom select form UI components, external issue linking / unlinking, and custom alert rule action UI components

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 13, 2026
Co-authored-by: Claude <noreply@anthropic.com>
@cvxluo cvxluo force-pushed the cvxluo/send-custom-headers-on-all-external-requests branch from ae5d927 to 0fef7fd Compare July 13, 2026 17:39
custom_headers = _custom_request_headers(sentry_app)
send_headers = {**custom_headers, **headers}
# Since some headers may carry secrets, we mask them to avoid logging them
loggable_headers = {**mask_header_values(custom_headers), **headers}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

note that we mask all custom headers in the log, rather than just potentially sensitive fields. i figure this is a little easier + more secure if we treat all the custom headers as sensitive.

return True


def _custom_request_headers(sentry_app: SentryApp | RpcSentryApp) -> dict[str, str]:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is a relatively inelegant way to check that the feature flag is enabled. we can remove it once we remove the flag

@cvxluo cvxluo marked this pull request as ready for review July 13, 2026 17:49
@cvxluo cvxluo requested review from a team and billyvg July 13, 2026 17:51
@cvxluo cvxluo merged commit 0a5cf8e into master Jul 13, 2026
68 checks passed
@cvxluo cvxluo deleted the cvxluo/send-custom-headers-on-all-external-requests branch July 13, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants