DSGT-DLP / Deep-Learning-Playground

Web Application where people new to Deep Learning can input a dataset and toy around with basic Pytorch modules without writing any code
MIT License
26 stars 8 forks source link

Added Firebase Authentication to training/ Endpoints #926

Closed alantao912 closed 1 year ago

alantao912 commented 1 year ago

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.

karkir0003 commented 1 year ago

have you tried testing through postman? @alantao912

karkir0003 commented 1 year ago

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

farisdurrani commented 1 year ago

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

karkir0003 commented 1 year ago

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

dwu359 commented 1 year ago

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 commented 1 year ago

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

alantao912 commented 1 year ago

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 commented 1 year ago

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

farisdurrani commented 1 year ago

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

alantao912 commented 1 year ago

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