Merge pull request #2021 from hhamalai/configurable_invitation_token_age

Make invitation token max age configurable
This commit is contained in:
Arik Fraimovich 2017-10-22 09:55:11 +03:00 committed by GitHub
commit 73540175d8
2 changed files with 2 additions and 1 deletions

View File

@ -31,7 +31,7 @@ def reset_link_for_user(user):
def validate_token(token): def validate_token(token):
max_token_age = 60 * 60 * 24 * 7 # 1 week max_token_age = settings.INVITATION_TOKEN_MAX_AGE
return serializer.loads(token, max_age=max_token_age) return serializer.loads(token, max_age=max_token_age)

View File

@ -94,6 +94,7 @@ SCHEMAS_REFRESH_SCHEDULE = int(os.environ.get("REDASH_SCHEMAS_REFRESH_SCHEDULE",
AUTH_TYPE = os.environ.get("REDASH_AUTH_TYPE", "api_key") AUTH_TYPE = os.environ.get("REDASH_AUTH_TYPE", "api_key")
PASSWORD_LOGIN_ENABLED = parse_boolean(os.environ.get("REDASH_PASSWORD_LOGIN_ENABLED", "true")) PASSWORD_LOGIN_ENABLED = parse_boolean(os.environ.get("REDASH_PASSWORD_LOGIN_ENABLED", "true"))
ENFORCE_HTTPS = parse_boolean(os.environ.get("REDASH_ENFORCE_HTTPS", "false")) ENFORCE_HTTPS = parse_boolean(os.environ.get("REDASH_ENFORCE_HTTPS", "false"))
INVITATION_TOKEN_MAX_AGE = int(os.environ.get("REDASH_INVITATION_TOKEN_MAX_AGE", 60 * 60 * 24 * 7))
MULTI_ORG = parse_boolean(os.environ.get("REDASH_MULTI_ORG", "false")) MULTI_ORG = parse_boolean(os.environ.get("REDASH_MULTI_ORG", "false"))