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

Remove legacy code related to base64 encoded secret. Fixes #89 #135

Merged
merged 1 commit into from
Jun 6, 2017

Conversation

johngian
Copy link
Collaborator

@johngian johngian commented Jun 6, 2017

No description provided.

@johngian
Copy link
Collaborator Author

johngian commented Jun 6, 2017

@akatsoulas r?

@johngian johngian changed the title Remove legacy code related to base64 encoded secret. Remove legacy code related to base64 encoded secret. Fixes #89 Jun 6, 2017
@codecov-io
Copy link

codecov-io commented Jun 6, 2017

Codecov Report

Merging #135 into master will increase coverage by 0.34%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #135      +/-   ##
==========================================
+ Coverage   94.71%   95.06%   +0.34%     
==========================================
  Files           6        6              
  Lines         246      243       -3     
==========================================
- Hits          233      231       -2     
+ Misses         13       12       -1
Impacted Files Coverage Δ
mozilla_django_oidc/auth.py 94.31% <100%> (+0.91%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fcd9f53...e0e5ae3. Read the comment docs.

Copy link
Collaborator

@akatsoulas akatsoulas left a comment

Choose a reason for hiding this comment

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

r+wc 👍

secret = self.OIDC_RP_CLIENT_SECRET
if import_from_settings('OIDC_RP_CLIENT_SECRET_ENCODED', False):
secret = base64.urlsafe_b64decode(self.OIDC_RP_CLIENT_SECRET)

# Verify the token
verified_token = jws.verify(token, secret, algorithms=['HS256'])
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: You can directly use here self.OIDC_RP_CLIENT_SECRET since secret it's not used anywhere else now that you are removing the base64 stuff so that we can remove another line.

@johngian johngian force-pushed the remove-legacy-base64 branch from 3a41273 to e0e5ae3 Compare June 6, 2017 12:53
@johngian johngian merged commit 7aa32e5 into mozilla:master Jun 6, 2017
@johngian johngian deleted the remove-legacy-base64 branch June 6, 2017 13:00
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.

3 participants