Fail quickly if there on bad password
Inspired by: https://bugs.launchpad.net/oslo.messaging/+bug/1508512/comments/1 Add authentication_failure_close capability on the client to tell the server that it can send us connection.close command indicating ACCESS_REFUSED as the reasona. If this capability is absent then authentication failures are reported in the legacy fashion: by abruptly closing the network connection. Partial-Bug: #1508512 Change-Id: Icf6108678256e6f922620837c71f8827fe8e8c52
This commit is contained in:
		@@ -522,6 +522,10 @@ class Connection(object):
 | 
			
		||||
            failover_strategy=self.kombu_failover_strategy,
 | 
			
		||||
            transport_options={
 | 
			
		||||
                'confirm_publish': True,
 | 
			
		||||
                'client_properties': {'capabilities': {
 | 
			
		||||
                    'authentication_failure_close': True,
 | 
			
		||||
                    'connection.blocked': True,
 | 
			
		||||
                    'consumer_cancel_notify': True}},
 | 
			
		||||
                'on_blocked': self._on_connection_blocked,
 | 
			
		||||
                'on_unblocked': self._on_connection_unblocked,
 | 
			
		||||
            },
 | 
			
		||||
 
 | 
			
		||||
@@ -191,11 +191,20 @@ class TestRabbitDriverLoadSSL(test_utils.BaseTestCase):
 | 
			
		||||
 | 
			
		||||
        transport._driver._get_connection()
 | 
			
		||||
        connection_klass.assert_called_once_with(
 | 
			
		||||
            'memory:///', transport_options={'confirm_publish': True,
 | 
			
		||||
                                             'on_blocked': mock.ANY,
 | 
			
		||||
                                             'on_unblocked': mock.ANY},
 | 
			
		||||
            'memory:///', transport_options={
 | 
			
		||||
                'client_properties': {
 | 
			
		||||
                    'capabilities': {
 | 
			
		||||
                        'connection.blocked': True,
 | 
			
		||||
                        'consumer_cancel_notify': True,
 | 
			
		||||
                        'authentication_failure_close': True
 | 
			
		||||
                    }
 | 
			
		||||
                },
 | 
			
		||||
                'confirm_publish': True,
 | 
			
		||||
                'on_blocked': mock.ANY,
 | 
			
		||||
                'on_unblocked': mock.ANY},
 | 
			
		||||
            ssl=self.expected, login_method='AMQPLAIN',
 | 
			
		||||
            heartbeat=60, failover_strategy='round-robin')
 | 
			
		||||
            heartbeat=60, failover_strategy='round-robin'
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class TestRabbitPublisher(test_utils.BaseTestCase):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user