bloomberg / amqpprox

An AMQP 0.9.1 proxy server, designed for use in front of an AMQP 0.9.1 compliant message queue broker such as RabbitMQ.
Apache License 2.0
78 stars 16 forks source link

Set custom error message inside connection close method for unauthorised client #64

Closed Chinmay1412 closed 2 years ago

Chinmay1412 commented 2 years ago

Proxy can also be configured to use external http service to authenticate clients. But currently, if the external auth service fail to authenticate client, proxy will close the client connection with default message "ERROR: Not authorized by amqpprox proxy". It will be difficult for that client to debug the actual problem in that case. So this PR will propagate the reason, which proxy got from the external http service to the client. And client will immediately be able to know the actual reason in such cases.