示例#1
0
文件: test_auth.py 项目: ipanova/pulp
    def test_validated(self, mock_get):
        message = 'hello'
        consumer_id = 'test-consumer_id'
        document = Mock()
        document.any = {'consumer_id': consumer_id}
        key = RSA.load_key_bio(BIO.MemoryBuffer(RSA_KEY))

        mock_get.return_value = RSA.load_pub_key_bio(BIO.MemoryBuffer(RSA_PUB))

        authenticator = Authenticator()
        authenticator.validate(document, message, key.sign(message))

        mock_get.assert_called_with(consumer_id)
示例#2
0
文件: test_auth.py 项目: ipanova/pulp
    def test_validated(self, mock_get):
        message = 'hello'
        consumer_id = 'test-consumer_id'
        document = Mock()
        document.any = {'consumer_id': consumer_id}
        key = RSA.load_key_bio(BIO.MemoryBuffer(RSA_KEY))

        mock_get.return_value = RSA.load_pub_key_bio(BIO.MemoryBuffer(RSA_PUB))

        authenticator = Authenticator()
        authenticator.validate(document, message, key.sign(message))

        mock_get.assert_called_with(consumer_id)
示例#3
0
文件: test_auth.py 项目: ipanova/pulp
 def test_validate_not_enabled(self):
     authenticator = Authenticator()
     authenticator.enabled = False
     authenticator.validate('', '', '')
示例#4
0
文件: test_auth.py 项目: ipanova/pulp
 def test_validate_not_enabled(self):
     authenticator = Authenticator()
     authenticator.enabled = False
     authenticator.validate('', '', '')