Skip to content
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

207 combine token verification middleware #208

Merged
merged 11 commits into from
Oct 9, 2023

Conversation

victor2000sv
Copy link
Collaborator

@victor2000sv victor2000sv commented Sep 27, 2023

Describe your changes

  • Moved the checkJwt middleware to auth.middleware.js aswell as making both auth.middleware.js and admin.middleware.js compatible with awilix.
  • Added a admin validation that contains functions as "isAdmin" and "getUserByIdToken" which made it possible to replace the old auth middleware that had one function that was used while everything else was depricated.
  • Changed all routes that uses checkJwt and checkIfAdmin to their new counter parts now making use of awilix.
  • Changed the CognitoService and AdminCognitoService to use awilix and change the imports for both services.
  • Wrote a test to make sure the validation works.

Issue ticket number and preferably a link

Issue 207

This change belongs to the following squad(s)

  • Database
  • HTTP
  • OCPP

I have created unit tests for my code

  • Yes
  • No
  • No, I need help with this

Checklist before creating my pull request

  • My code is properly commented where needed
  • I have updated the documentation with my changes/additions
  • I have reviewed my code before creating this pull request
  • I have made sure that I am targeting the correct branch

ellencarlsson and others added 3 commits September 26, 2023 16:00
Update HTTP documentation and move secrets to environment variables
Copy link
Collaborator

@albin02forsberg albin02forsberg left a comment

Choose a reason for hiding this comment

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

Code looks good to me. Have not tested it myself.

@loan21xw loan21xw merged commit 90c25b5 into dev Oct 9, 2023
2 checks passed
@loan21xw loan21xw deleted the 207-combine-token-verification-middleware branch October 9, 2023 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants