Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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