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

Correct typo 'authtkt' for secure and http_only #4237

Merged
merged 1 commit into from
Oct 31, 2018

Conversation

ger-benjamin
Copy link
Member

@ger-benjamin ger-benjamin commented Oct 30, 2018

Never see this "authtk" string, without the final t. I guess it was a typo.

Also, accept false, False, No, no, 0 as "false value, and not only False.
Still True by default.

secure = settings.get("authtk_secure")
secure = True if secure is None else secure != "False"
http_only = settings.get("authtkt_http_only", "")
http_only = False if http_only.lower() in ("false", "no", "0") else True
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
http_only = False if http_only.lower() in ("false", "no", "0") else True
http_only = not http_only.lower() in ("false", "no", "0")

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
http_only = False if http_only.lower() in ("false", "no", "0") else True
from pyramid.settings import asbool
http_only = asbool(settings.get("authtkt_http_only", "False"))

 - 'authtkt' instead of 'authtk'
 - Accept lower values
 - All for secure and http_only
Copy link
Member

@sbrunner sbrunner left a comment

Choose a reason for hiding this comment

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

Nice :-)

@ger-benjamin
Copy link
Member Author

@sbrunner I can't merge The base branch restricts merging to authorized user :-/

@sbrunner
Copy link
Member

Oups, it should be fixed :-)

@ger-benjamin ger-benjamin merged commit 78afcac into 2.3 Oct 31, 2018
@ger-benjamin ger-benjamin deleted the correct_authtkt_secure_typo branch October 31, 2018 13:59
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