generated from Real-Dev-Squad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 277
Open
0 / 10 of 1 issue completedOpen
0 / 10 of 1 issue completed
Copy link
Description
Description:
The current middleware verifyDiscordBot requires an update to properly validate incoming requests from the Discord service. Right now, it partially handles this by checking the x-service-name header and verifying the token, but lacks complete validation logic specific to Discord's expected signature-based request validation (if applicable).
Proposed Changes:
- Ensure the middleware performs complete validation of incoming requests from Discord, including:
- Verifying the authorization header format.
- Confirming x-service-name equals DISCORD_SERVICE.
- If x-service-name is DISCORD_SERVICE, ensure botVerification.verifyDiscordService(token) returns a valid result and implements any additional checks Discord requires (e.g., signature verification).
- Maintain compatibility with existing token-based validation from Cloudflare Worker (CLOUDFLARE_WORKER).
- Improve error handling and response messages for clarity.
Sub-issues
Metadata
Metadata
Assignees
Labels
No labels