generated from RealDevSquad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 279
feat: add Discord service verification and token generation #2419
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
e1f29ec
feat: add Discord service verification and token generation
joyguptaa ee1f6b7
refactor: update test descriptions for discord service authorization
joyguptaa 36dfab0
fix: handle missing x-service-name header in Discord bot verification
joyguptaa c4d290b
fix: correct discord service public key configuration
joyguptaa 7185388
fix: update discord service private key configuration in token genera…
joyguptaa 8b2dfd3
fix: use HEADERS constant for service name in Discord bot authorization
joyguptaa ca7b4a9
refactor: update description for discord service authorization tests
joyguptaa 90003e7
fix: update test description for unauthorized token handling in disco…
joyguptaa c825d89
fix: update service name in authorization test for cloudflare worker
joyguptaa 92dad92
fix: remove unused import in authorizeBot test file
joyguptaa 5ba8059
fix: update verifyDiscordBot tests to remove unused response object
joyguptaa 1576c5e
fix: update discord service authorization test to check for unauthori…
joyguptaa b8a4db4
fix: refactor response handling in discord service authorization tests
joyguptaa 6de11c4
chore: fix assert statement
pankajjs ca99392
chore: fix import statement
pankajjs 2599d99
chore: remove duplicate test name
pankajjs d0e5da0
refactor: add logic to handle discord service verification
pankajjs 042fb17
refactor: remove nested if conditions
pankajjs b447abd
fix: handle verification based on header
pankajjs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,15 @@ | ||
| const CLOUDFLARE_WORKER = "Cloudflare Worker"; | ||
| const BAD_TOKEN = "BAD.JWT.TOKEN"; | ||
| const CRON_JOB_HANDLER = "Cron Job Handler"; | ||
| const DISCORD_SERVICE = "Discord Service"; | ||
|
|
||
| const Services = { | ||
| CLOUDFLARE_WORKER: CLOUDFLARE_WORKER, | ||
| CRON_JOB_HANDLER: CRON_JOB_HANDLER, | ||
| }; | ||
|
|
||
| module.exports = { CLOUDFLARE_WORKER, BAD_TOKEN, CRON_JOB_HANDLER, Services }; | ||
| const DiscordServiceHeader = { | ||
| name: "x-service-name" | ||
| } | ||
|
|
||
| module.exports = { CLOUDFLARE_WORKER, BAD_TOKEN, CRON_JOB_HANDLER, Services, DISCORD_SERVICE, DiscordServiceHeader }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.