Esempio n. 1
0
def _resolve_default(default, username, audit_name):
    if not default:
        return default

    if not isinstance(default, str):
        return default

    resolved_env_default = resolve_env_var(default)
    if resolved_env_default != default:
        return resolved_env_default

    return replace_auth_vars(default, username, audit_name)
Esempio n. 2
0
    def __init__(self, params_dict):
        super().__init__()

        self.client_id = model_helper.read_obligatory(params_dict, 'client_id', ' for Google OAuth')

        secret_value = model_helper.read_obligatory(params_dict, 'secret', ' for Google OAuth')
        self.secret = model_helper.resolve_env_var(secret_value)

        self.states = {}

        self._client_visible_config['client_id'] = self.client_id
        self._client_visible_config['oauth_url'] = tornado.auth.GoogleOAuth2Mixin._OAUTH_AUTHORIZE_URL
        self._client_visible_config['oauth_scope'] = 'email'
Esempio n. 3
0
    def read_password(params_dict):
        password = params_dict.get('password')
        password = model_helper.resolve_env_var(password)

        return password