"""
The MIT License (MIT)

Copyright (c) 2014 Robert Hodgen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""


""" The key a user's session ID will be stored under. Note: Changing this value
will in effect log out all currently logged in users. """
NDB_USERS_COOKIE_KEY = 'user_session_id'

""" Tells web browsers to only send the cookie over SSL/TLS connections.
Should be set to True to protect users sessions. Note: `NDB_USERS_COOKIE_SECURE`
 will be ignored in Development; see `login._user_secure_cookies()`. """
NDB_USERS_COOKIE_SECURE = True

""" The number of characters a user's session ID should be. """
NDB_USERS_SESSION_ID_LENGTH = 50

""" The number of characters a user's password salt (`User.passwordSalt`)
should be. """
NDB_USERS_SALT_LENGTH = 10

""" The number of characters a user's activation token and password recovery
token should be. """
NDB_USERS_TOKEN_LENGTH = 20

""" The number of days an extended user session should remain active. Will be
set in both the cookies sent to users and value stored in ndb
(`UserSession.expires`). """
NDB_USERS_SESSION_EXTENDED_DAYS = 90

""" The number of days a standard (non extended) user session would remain
active. Will be sent in the `UserSession.expires` but NOT the cookie. """
NDB_USERS_SESSION_STANDARD_DAYS = 1

""" The number of days a user's activation token remains active. """
NDB_USERS_ACTIVATION_DAYS = 7

""" The number of days a user's password recovery token remains active. """
NDB_USERS_RECOVERY_DAYS = 1

""" The email address user activation and password recovery emails come from.
Note: this must be either *@appid.appspotmail.com or a project
administrator's email address. When set to False the email sender will be
autogenerated via `users._email_sender()`. """
NDB_USERS_EMAIL_SENDER = 'ThoughtJot! <no-reply@thought-jot.appspotmail.com>'

""" Note: Enabling will force existing users to verify their email addresses
before logging in again. This will not disrupt existing user sessions as
`users.get_current_user()` only returns a User object for a given (not expired)
UserSession. """
NDB_USERS_ENFORCE_EMAIL_VERIFICATION = False

""" The amount of time to wait between receiving a bounce email notification and
sending the user another email. """
NDB_USERS_EMAIL_BOUNCE_RETRY_HOURS = 12

""" Change `NDB_USERS_SITE_NICKNAME` to the name of your site. This will be the
visible text to the `NDB_USERS_DEFAULT_CONTINUE_URI` link. """
NDB_USERS_SITE_NICKNAME = 'Home'

""" Change `NDB_USERS_DEFAULT_CONTINUE_URI` to the URI ndb_users should redirect
users upon successful login, logout, register, or other action. Note: this does
not override the `continue` GET parameter, `NDB_USERS_DEFAULT_CONTINUE_URI` is
used when no `continue` GET parameter is specified. """
NDB_USERS_DEFAULT_CONTINUE_URI = '/'

""" Route URIs. Warning: Do not change `/_login` prefix unless module URL
handlers are updated in your .yaml file. """
NDB_USERS_LOGIN_URI                 = '/_login'
NDB_USERS_LOGIN_CREATE_URI          = '/_login/create'
NDB_USERS_LOGIN_ACTIVATE_URI        = '/_login/activate'
NDB_USERS_LOGIN_PASSWORD_CHANGE_URI = '/_login/password/change'
NDB_USERS_LOGIN_PASSWORD_FORGOT_URI = '/_login/password/forgot'
NDB_USERS_LOGIN_PASSWORD_RESET_URI  = '/_login/password/reset'

""" API paths. Warning: Do not change `/_login` prefix unless module URL
handlers are updated in your .yaml file. """
NDB_USERS_LOGIN_API_PATH                 = '/_login.json'
NDB_USERS_LOGIN_CREATE_API_PATH          = '/_login/create.json'
NDB_USERS_LOGIN_ACTIVATE_API_PATH        = '/_login/activate.json'
NDB_USERS_LOGIN_PASSWORD_CHANGE_API_PATH = '/_login/password/change.json'
NDB_USERS_LOGIN_PASSWORD_FORGOT_API_PATH = '/_login/password/forgot.json'
NDB_USERS_LOGIN_PASSWORD_RESET_API_PATH  = '/_login/password/reset.json'
