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

Add cookie secret as part of config #1835

Merged
merged 2 commits into from
May 14, 2016

Conversation

squirrelo
Copy link
Contributor

does what it says on the tin.

@antgonza
Copy link
Member

👍 once tests pass.

@antgonza
Copy link
Member

BTW this was deployed in the test environment and it works fine.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 83.097% when pulling 2adf019 on squirrelo:cookie-secret-in-config into 89b6a5e on biocore:master.

@josenavas
Copy link
Contributor

@antgonza I'm confused on the tests passing here - the encoded config file is not changed. I'm assuming that what is happening is that is just using 'None' as the COOKIE_SECRET. What should we do when the COOKIE_SECRET is not provided in the config file? Should we fail or generate one at random?

@antgonza
Copy link
Member

Nop, here the COOKIE_SECRET = SECRET. The failure is gonna be when we merge to master.

@josenavas
Copy link
Contributor

I guess I then misunderstood how it works - I though that the PR against master are the ones already using the encoded config file - otherwise the changes in the previous portals branch would not have failed.

@@ -178,6 +178,7 @@ def _get_main(self, config):
if not self.certificate_file:
self.certificate_file = join(install_dir, 'qiita_core',
'support_files', 'server.crt')
self.cookie_secret = config.get('main', 'COOKIE_SECRET')
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, we should check if self.cookie_secret is None (as it is done for self.key_file below). If it is None, I would go back to the current behavior, generate a random one, but also raising a Warning to the user to let him now that it was not set, in case that he actually needs to set it (e.g. load balancing).

I don't think it is critical to the point of raising an error, since the usage of that config value is specific to some functionality (we didn't realize that we needed until we wanted to do load balancing), but not signing at all I think it's bad.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Functionality added

@squirrelo
Copy link
Contributor Author

Comment addressed

@josenavas
Copy link
Contributor

👍

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.003%) to 83.071% when pulling 98d522c on squirrelo:cookie-secret-in-config into 89b6a5e on biocore:master.

@antgonza antgonza merged commit 4d0f6a2 into qiita-spots:master May 14, 2016
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.

None yet

4 participants