コード例 #1
0
ファイル: conf.py プロジェクト: cundi/flask-auth
    def authenticate(self, data):
        try:
            username, password = data['username'], data['password']
        except KeyError:
            return  # Bad form data, don't authenticate

        users = current_app.config['AUTH_USERS']

        if username in users and utils.check_password(
                password, users[username]['password']):
            return username  # Good
コード例 #2
0
ファイル: conf.py プロジェクト: ericmoritz/flask-auth
    def authenticate(self, data):
        try:
            username, password = data['username'], data['password']
        except KeyError:
            return # Bad form data, don't authenticate

        users = current_app.config['AUTH_USERS']

        if username in users and utils.check_password(password,
                                                      users[username]['password']):
            return username # Good
コード例 #3
0
    def test_set_password(self):
        user = mongoengine_auth.User(username="******")
        user.set_password("password")

        self.assertTrue(utils.check_password("password", user.password))
コード例 #4
0
ファイル: utils.py プロジェクト: ericmoritz/flask-auth
 def test_encodepassword(self):
     result = utils.encode_password("password")
     
     self.assertTrue(utils.check_password("password", result))
コード例 #5
0
ファイル: utils.py プロジェクト: ericmoritz/flask-auth
    def test_check_password(self):
        enc_password = '******'

        self.assertTrue(utils.check_password("password", enc_password))
        self.assertFalse(utils.check_password("notpassword", enc_password))
コード例 #6
0
ファイル: utils.py プロジェクト: cundi/flask-auth
    def test_encodepassword(self):
        result = utils.encode_password("password")

        self.assertTrue(utils.check_password("password", result))
コード例 #7
0
ファイル: utils.py プロジェクト: cundi/flask-auth
    def test_check_password(self):
        enc_password = '******'

        self.assertTrue(utils.check_password("password", enc_password))
        self.assertFalse(utils.check_password("notpassword", enc_password))
コード例 #8
0
 def check_password(self, raw_password):
     """
     Returns a boolean of whether the raw_password was correct. Handles
     encryption formats behind the scenes.
     """
     return utils.check_password(raw_password, self.password)        
コード例 #9
0
ファイル: mongoengine_auth.py プロジェクト: cundi/flask-auth
 def check_password(self, raw_password):
     """
     Returns a boolean of whether the raw_password was correct. Handles
     encryption formats behind the scenes.
     """
     return utils.check_password(raw_password, self.password)