-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
refactor(auth): Use self.authenticate_header()
in authenticate()
method to get auth header prefix
#329
Conversation
self.authenticate_header()
in authenticate()
method to get auth header prefixauthenticate()
authenticate()
authenticate()
authenticate()
self.authenticate_header()
in authenticate()
method to get auth header prefix
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.
if you can get rid of the 2 first commits I will approve !
Thanks for the contribution 👌🏻
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #329 +/- ##
========================================
Coverage 91.70% 91.70%
========================================
Files 9 9
Lines 229 229
Branches 35 35
========================================
Hits 210 210
Misses 16 16
Partials 3 3 ☔ View full report in Codecov by Sentry. |
@luqmansen Thank you for your contribution! 😁 @johnraz I think we can use GitHub's |
@giovannicimolin indeed that would give the same result, we just need to make sure the commit message is proper 😊 |
Hi @johnraz, I have dropped the unneeded commit, thank you for reviewing :adore: |
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! LGTM.
Description
As titled, seems like the
TokenAuthentication
class already defined a method to retrieve the header, yet not utilized within the class itself.ref: the related method
Similar technique has been done in
rest_framework
Token Authentication (though, using class attribute)Impact
These changes allows the auth header to be overridden from the subclass without having to override the
authenticate()
method (just for small auth prefix header changes) or meddling with global settings forknox_settings.AUTH_HEADER_PREFIX
(because it might be used somewhere else within the project)example usage:
without these changes, the subclass needs to: