mosquito / aio-pika

AMQP 0.9 client designed for asyncio and humans.
https://aio-pika.readthedocs.org/
Apache License 2.0
1.18k stars 186 forks source link

Quick Start Guide, External Credentials Example. May be incorrect. #607

Open zleonid1 opened 6 months ago

zleonid1 commented 6 months ago

Refering to this example: https://aio-pika.readthedocs.io/en/latest/quick-start.html#external-credentials-example

It fails in https://github.com/mosquito/aiormq/blob/master/aiormq/connection.py#L400-L411 specifically the self.url.query.get("auth", "plain") line. as the auth param appears to be missing running the code from the example. It can be set manually via client_properties however

    connection = await aio_pika.connect_robust(
        host="127.0.0.1",
        login="",
        ssl=True,
        ssl_options=SSLOptions(
            cafile="cacert.pem",
            certfile="cert.pem",
            keyfile="key.pem",
            no_verify_ssl=ssl.CERT_REQUIRED,
        ),
        client_properties={
            "connection_name": "aio-pika external credentials",
            "auth": "EXTERNAL"
        },
    )