Skip to content

Commit

Permalink
Use PLAIN auth method as others are not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
dzen committed Mar 11, 2020
1 parent 54ade18 commit f004c52
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions aioamqp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


async def connect(host='localhost', port=None, login='guest', password='guest',
virtualhost='/', ssl=None, login_method='AMQPLAIN', insist=False,
virtualhost='/', ssl=None, login_method='PLAIN', insist=False,
protocol_factory=AmqpProtocol, *, loop=None, **kwargs):
"""Convenient method to connect to an AMQP broker
Expand Down Expand Up @@ -69,7 +69,7 @@ async def connect(host='localhost', port=None, login='guest', password='guest',


async def from_url(
url, login_method='AMQPLAIN', insist=False, protocol_factory=AmqpProtocol, **kwargs):
url, login_method='PLAIN', insist=False, protocol_factory=AmqpProtocol, **kwargs):
""" Connect to the AMQP using a single url parameter and return the client.
For instance:
Expand Down
2 changes: 1 addition & 1 deletion aioamqp/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ async def start_connection(self, host, port, login, password, virtualhost, ssl=F
"""

if login_method != 'PLAIN':
logger.warning('only PLAIN login_method is supported, falling back to AMQPLAIN')
logger.warning('login_method %s is not supported, falling back to PLAIN', login_method)

self._stream_writer.write(amqp_constants.PROTOCOL_HEADER)

Expand Down
4 changes: 2 additions & 2 deletions aioamqp/tests/test_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async def func(*x, **y):
connect.assert_called_once_with(
insist=False,
password='pass',
login_method='AMQPLAIN',
login_method='PLAIN',
login='tom',
host='example.com',
protocol_factory=AmqpProtocol,
Expand All @@ -74,7 +74,7 @@ async def func(*x, **y):
connect.assert_called_once_with(
insist=False,
password='pass',
login_method='AMQPLAIN',
login_method='PLAIN',
ssl=ssl_context,
login='tom',
host='example.com',
Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Changelog
Next release
------------

* Fix annoying auth method warning because of a wrong defined default argument (closes #214).

Aioamqp 0.14.0
--------------

Expand Down

0 comments on commit f004c52

Please sign in to comment.