-
Notifications
You must be signed in to change notification settings - Fork 20
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
REST API cookie authentication and refactor #250
Conversation
This pull request introduces 7 alerts when merging c43aceb into d45425a - view on LGTM.com new alerts:
|
…ually anymore as it is automatically generated at runtime and then managed by fastapi_jwt_auth
…ally by the jwt package + comment out the authorization tests as it isn't clear if authorization is needed for now
…eded anymore with the introduction of refresh tokens, which provide a much safer alternative
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would request only few minor modifications, before approval. Please, see inline comments. In addition, could you please remove drone_registry.db-shm and drone_registry.db-wal from the repe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your work. This is now ready to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good just two open points, see review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks you very much for all your work. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go!
Changes
The authentication method was changed to cookie authentication with jwt tokens.
The login router was completly changed and moved to /user.
OAuth scopes are included in the jwt token but scopes aren't implemented yet. This is why the check_authorization function was commented out instead of beeing removed. This is also why some unused imports aren't cleaned up yet.
I removed the secret key from the service class and moved it into the Settings class for the fastapi jwt package.
I also did some minor cleanup.
Reasoning
The package was used to increase security, decrease complexity and for ease of use.
The key is generated at runtime to decrease the security risk of accidently publishing it with the config file, decreasing the it's lifespan and enabling the possibilty to regenerate it during runtime in the future.
TODO