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

Marcidy/nonce refactor #35

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Marcidy/nonce refactor #35

wants to merge 2 commits into from

Conversation

marcidy
Copy link
Contributor

@marcidy marcidy commented Aug 5, 2019

refactored the nonce stuff so it's smaller impact on routes.py.

added the following:

creating of a 32character nonce
store to database object (WARNING: this needs a db migrate. I'll do it, just pointing it out)
in the main page view, a nonce is created and stored in the database
The page is then served
in the served page, there is now javascript (from static/js/helper.js) which makes an async request
at a new "/nonce/" reout
If there is a nonce with value <nonce_value> in the database AND it's less than 60s old, then the stripe public key is served and subsequenctly set by a call back.
So the key is only available in a 60s window from request initiation to the client.

I suspect this will form only one part of a larger solution, but it is one part, and it is working.

further efforts to obfuscate the key will occur after implementing this, then rolling the key.

This PR replaces #34

@marcidy marcidy mentioned this pull request Aug 5, 2019
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.

1 participant