Skip to content
This repository has been archived by the owner on Jul 25, 2021. It is now read-only.

Feat: Added /discord/:id endpoint to allow connection to UniCS Discord Bot. #145

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

SamJHirst
Copy link
Collaborator

Resolves #138

@codecov
Copy link

codecov bot commented Dec 22, 2020

Codecov Report

Merging #145 (12ce63e) into main (d61fcf1) will decrease coverage by 0.59%.
The diff coverage is 31.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #145      +/-   ##
==========================================
- Coverage   79.16%   78.57%   -0.60%     
==========================================
  Files          51       51              
  Lines        1349     1363      +14     
  Branches      144      189      +45     
==========================================
+ Hits         1068     1071       +3     
- Misses        281      292      +11     
Impacted Files Coverage Δ
src/services/DiscordService.ts 30.13% <0.00%> (-1.75%) ⬇️
src/controllers/DiscordController.ts 32.00% <30.00%> (-5.50%) ⬇️
src/routes/UserRoutes.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d61fcf1...f04f7a4. Read the comment docs.

Copy link
Collaborator

@amishshah amishshah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A change for security, and maybe a change for the route naming too? Maybe the following instead:

  • /discord/users/:id
  • /users/discord/:id

I think these give more clarity.

@@ -29,6 +29,8 @@ export class UserRoutes {

router.post('/reset_password', getUser(TokenType.PasswordReset), this.userController.resetPassword.bind(this.userController));

router.get('/discord/:id', this.discordController.getDiscordUser.bind(this.discordController));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sensitive info, I'd say that the route should be restricted to authorised admins.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linking to unics_social_discord_bot
2 participants