-
Notifications
You must be signed in to change notification settings - Fork 0
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
MDTZ-1089: Refactor Figma webhook error handling (PR 2/3) #126
MDTZ-1089: Refactor Figma webhook error handling (PR 2/3) #126
Conversation
@@ -75,44 +75,6 @@ describe('/admin/auth', () => { | |||
.expect({ authorized: true }); | |||
}); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Add new integration tests, reorder existing ones and resolve test flakiness (caused by a time-bound JWT token).
@@ -70,41 +70,6 @@ describe('/auth', () => { | |||
.expect({ type: '3LO', authorized: true }); | |||
}); | |||
|
|||
it('should return a response indicating that user is not authorized if no credentials stored', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Add new integration tests, reorder existing ones and resolve test flakiness (caused by a time-bound JWT token).
export const FIGMA_WEBHOOK_EVENT_REQUEST_SCHEMA: JSONSchemaTypeWithId<{ | ||
body: FigmaWebhookEventPayload; | ||
}> = { | ||
export const FIGMA_WEBHOOK_EVENT_REQUEST_SCHEMA = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Improve schema definition by using JSON Schema Discriminator (e.g., file_key
gets required for the FILE_UPDATE
event but is still optional for PING
).
|
||
export type FigmaWebhookEventPayload = { | ||
readonly event_type: FigmaWebhookEventType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Remove fields the app is not interested in.
Changes
FigmaWebhookService
withfigmaWebhookAuthMiddleware
for authenticating Figma webhook events.ValidationError
and related error handling.checkAuth
endpoints (caused by the usage of time-bound JWT tokens).