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

fix: minor backend improvement part2 #860

Merged
merged 19 commits into from
Sep 6, 2023

Conversation

ianliuwk1019
Copy link
Collaborator

@ianliuwk1019 ianliuwk1019 commented Sep 1, 2023

Continue refactoring/improvement at backend.
This PR mainly focuses on improvement for router code (router_user_role_assignment.py):

  • Migrate some validations from jwt_validation.py and router_user_role_assignment.py into a
    new file: "router_guards.py".
  • Migrate previous "requester" into schemas.py and add one "target_user" class.
  • Simplify "router_user_role_assignment.py" code with using FastAPI "Depends" (dependency injection): depends on validations to pass before handler is called.
  • Fix tests - reset dependency override back to default so it does not affect other tests.

@ianliuwk1019 ianliuwk1019 changed the title Fix/minor backend improvement part2 fix: minor backend improvement part2 Sep 1, 2023
@ianliuwk1019 ianliuwk1019 marked this pull request as ready for review September 5, 2023 16:22
@ianliuwk1019 ianliuwk1019 merged commit c049bab into main Sep 6, 2023
9 checks passed
@ianliuwk1019 ianliuwk1019 deleted the fix/minor-backend-improvement-part2 branch September 6, 2023 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants