htcondor / scitokens-credmon

HTCondor implementation of the Scitokens credential monitor
Apache License 2.0
3 stars 7 forks source link

Fix non-persistent sessions #21

Closed jasoncpatton closed 5 years ago

jasoncpatton commented 5 years ago

As reported by Duncan, the current code has some issues with persisting sessions. This PR contains two fixes for this problem:

  1. Dictionaries (and other structures) containing session info are now created independently from the Flask.session object and then explicitly assigned to the object only after all modifications to the dictionary (or other structure) are done.
  2. Fixed a bug in utils.generate_secret_key() for the non-existent wsgi_session_key file case that caused the function to return early with a non-persistent key instead of first trying to populate a newly created file with a persistent key.