diesel: impl std::fmt::Debug for diesel::pg::PgConnection
Feature Description
impl std::fmt::Debug for diesel::pg::PgConnection {
// ...
}
Possible solution
My idea would be to just store the database_url on PgConnection::establish(database_url) in the PgConnection and use it as the debug message.
But I am open to include additional information.
Happy to implement it myself š
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 23 (23 by maintainers)
Itās not about the application knowing the
database_urlbut about the secrets being logged because ofunwraporexpectI agree that we should have a custom
DebugforConnectionManager<T>which doesnāt needT: Debug. Thereby we enable easier use ofstatic DB: OnceCell: Pool<ConnectionManager<PgConnection>>>.But
static DB: OnceCell<PgConnection>would not work. If this isnāt a common pattern we can drop #2572,but I am unsure about that. Need your experience hereā¦--> Just made a github-wide code search and only could find usage ofstatic DB: Pool<...>. Going to close PR.PoolandConnectionManageralready implementDebug, but require the enclosed type to also implement it.Ok then let me word it that way: I would be happy to merge a PR implementing
Debugfor all connection types as long as it does not reveal potentially confidential information. I consider database urlās to be potential confidential here.āJustā dropping the password/username there would mean that you have to parse the url. Thatās quite a lot of complexity for such a simple feature. Additionally Iām not sure that the password field is the only potential confidential field there. Whatās for example with ssl based authentication?