gftea / amqprs

Async & Lock-free RabbitMQ Rust Client, Easy-to-use API
MIT License
214 stars 27 forks source link

Public access to OpenConnectionArguments fields #146

Closed eglimi closed 3 weeks ago

eglimi commented 1 month ago

Hi,

If I create a OpenConnectionArguments from an URI (string), there seems no way to access the fields such as host, port, etc. In my case, I would be interested in this because I don't want to log all parts of the original URI string, but just parts of it.

What do you think about making the fields in the struct public or add accessor methods for it? I hope I didn't miss anything. Thank you.

gftea commented 1 month ago

Wonder why do log all parts? most cases should need to log all parts for debug

eglimi commented 3 weeks ago

We have sensitive information in the connection string, which I don't want to end up in logs and traces.

As the parsing is already done for the URI, which is passed from the client, it is unfortunate that the parsed information is then hidden from the client.

gftea commented 3 weeks ago

OK, I can add that or if you want, feel free to submit a PR also

eglimi commented 3 weeks ago

Sure, I can open a PR. Do you prefer getter methods or pub fields?

gftea commented 3 weeks ago

getter is better because I prefer after creation of OpenConnectionArguments, should not need to change