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

Added Firebase Authentication to training/ Endpoints #926

Merged
merged 16 commits into from
Sep 3, 2023

Conversation

alantao912
Copy link
Contributor

Added Firebase Authentication to training/ Endpoints

What user problem are we solving?

Insecure training endpoints.

What solution does this PR provide?

Firebase authentication to secure training endpoints.

Testing Methodology
Have not tested yet.

Any other considerations
I only found two endpoints in training apart from a test API.

@alantao912 alantao912 linked an issue Aug 23, 2023 that may be closed by this pull request
@karkir0003
Copy link
Member

have you tried testing through postman? @alantao912

@karkir0003
Copy link
Member

use cli.py to generate bearer token and verify that training endpoints work

@farisdurrani
Copy link
Member

Make sure the public routes in self.exempt_paths are accessible regardless of token status

@karkir0003
Copy link
Member

@dwu359 do we still need the exempt paths stuff that faris mentioned?

Copy link
Contributor

@dwu359 dwu359 left a comment

Choose a reason for hiding this comment

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

Good start so far, you can add the auth for entire routers btw instead of adding auth for each endpoint

@dwu359
Copy link
Contributor

dwu359 commented Aug 23, 2023

Make sure the public routes in self.exempt_paths are accessible regardless of token status

@farisdurrani @karkir0003 So Django Ninja has these things called routers which are pretty similar to flask's blueprints, we can attach auth to entire routers, and for any exempt_paths we can just put them outside of these routers or put them in a router without auth

@karkir0003
Copy link
Member

got it. so pretty much all.solved with django!

@alantao912
Copy link
Contributor Author

Make sure the public routes in self.exempt_paths are accessible regardless of token status

Just checked, none of the exempt paths have auth headers.

@farisdurrani
Copy link
Member

@alantao912 let us know when your PR is ready, and do update your branch

Copy link
Member

@karkir0003 karkir0003 left a comment

Choose a reason for hiding this comment

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

looks good to me. as long as u address the comments or do it in a followup pr, i conditionally approve

training/training/core/authenticator.py Outdated Show resolved Hide resolved
@farisdurrani
Copy link
Member

Very nice. Can you confirm you've tested this @alantao912 and it all works? As well as the exempt paths?

@alantao912
Copy link
Contributor Author

Yes, I can confirm that all endpoints work. And exempt paths do not require authentication. @farisdurrani

@alantao912 alantao912 added this pull request to the merge queue Sep 3, 2023
Merged via the queue into nextjs with commit d03bb98 Sep 3, 2023
3 checks passed
@alantao912 alantao912 deleted the 910-feature-add-auth-to-training branch September 3, 2023 01:28
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.

[FEATURE]: Add Auth to /training
4 participants