Skip to content

Commit

Permalink
fix: Add security header for webhooks API routes (#2308)
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr authored Oct 14, 2023
1 parent 4c65722 commit 7780848
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api.planx.uk/docs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ const securitySchemes = {
scheme: "bearer",
bearerFormat: "JWT",
},
hasuraAuth: {
type: "apiKey",
in: "header",
name: "Authorization",
},
};

const parameters = {
Expand Down
14 changes: 14 additions & 0 deletions api.planx.uk/modules/webhooks/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ paths:
/webhooks/hasura/sendSlackNotification:
post:
tags: ["webhooks"]
security:
- hasuraAuth: []
summary: Send Slack notification
description: Endpoint to trigger a Slack notification following a submission event
parameters:
Expand All @@ -212,6 +214,8 @@ paths:
/webhooks/hasura/create-payment-invitation-events:
post:
tags: ["webhooks"]
security:
- hasuraAuth: []
summary: Create payment invitation events
description: Setup events which will trigger payment invitation emails to be generated
requestBody:
Expand All @@ -227,6 +231,8 @@ paths:
/webhooks/hasura/create-payment-reminder-events:
post:
tags: ["webhooks"]
security:
- hasuraAuth: []
summary: Create payment reminder events
description: Setup events which will trigger payment reminder emails to be generated
requestBody:
Expand All @@ -242,6 +248,8 @@ paths:
/webhooks/hasura/create-payment-expiry-events:
post:
tags: ["webhooks"]
security:
- hasuraAuth: []
summary: Create payment expiry events
description: Setup events which will trigger payment expiry emails to be generated
requestBody:
Expand All @@ -257,6 +265,8 @@ paths:
/webhooks/hasura/create-reminder-event:
post:
tags: ["webhooks"]
security:
- hasuraAuth: []
summary: Create session reminder event
description: Setup events which will trigger session reminder emails to be generated
requestBody:
Expand All @@ -272,6 +282,8 @@ paths:
/webhooks/hasura/create-expiry-event:
post:
tags: ["webhooks"]
security:
- hasuraAuth: []
summary: Create session expiry event
description: Setup events which will trigger session expiry email to be generated
requestBody:
Expand All @@ -287,6 +299,8 @@ paths:
/webhooks/hasura/sanitise-application-data:
post:
tags: ["webhooks"]
security:
- hasuraAuth: []
summary: Sanitise application data
description: Called by Hasura cron job "sanitise_application_data" on a nightly basis
responses:
Expand Down

0 comments on commit 7780848

Please sign in to comment.