Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions static/app/types/integrations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ export type SentryApp = {
id: number;
slug: string;
};
webhookHeaders?: string[];
};

// Minimal Sentry App representation for use with avatars
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ const sentryAppFormSchema = z
name: z.string(),
author: z.string(),
webhookUrl: z.string(),
webhookHeaders: z.string(),
redirectUrl: z.string(),
verifyInstall: z.boolean(),
isAlertable: z.boolean(),
Expand Down Expand Up @@ -201,6 +202,7 @@ type SaveSentryAppPayload = {
author?: string | null;
overview?: string;
redirectUrl?: string;
webhookHeaders?: string[];
webhookUrl?: string;
};

Expand Down Expand Up @@ -518,6 +520,7 @@ function SentryApplicationForm({
schema: getSchemaFieldValue(app?.schema),
overview: app?.overview ?? '',
allowedOrigins: convertMultilineFieldValue(app?.allowedOrigins ?? []),
webhookHeaders: convertMultilineFieldValue(app?.webhookHeaders ?? []),
organization: organization.slug,
isInternal,
scopes: app ? [...app.scopes] : [],
Expand Down Expand Up @@ -557,6 +560,7 @@ function SentryApplicationForm({
scopes: value.scopes,
events: value.events,
allowedOrigins: extractMultilineFields(value.allowedOrigins),
webhookHeaders: extractMultilineFields(value.webhookHeaders),
schema: value.schema.trim() === '' ? {} : JSON.parse(value.schema),
// The author parser doesn't allow_blank, so send null for empty
// (covers internal apps with no author).
Expand Down Expand Up @@ -693,6 +697,26 @@ function SentryApplicationForm({
)}
</form.AppField>

<form.AppField name="webhookHeaders">
{field => (
<field.Layout.Row
label={t('Webhook Headers')}
hintText={t(
'Custom headers to include with every webhook request. Enter one header per line in the format: Header-Name: value'
)}
>
<field.TextArea
autosize
value={field.state.value}
onChange={field.handleChange}
placeholder={
'anthropic-version: 2023-06-01\nauthorization: Bearer token123'
}
/>
</field.Layout.Row>
)}
</form.AppField>

{!isInternal && (
<form.AppField name="redirectUrl">
{field => (
Expand Down
Loading