Skip to content
  • Hartley McGuire's avatar
    5c817255
    Add condensed #inspect for Pool, Adapter, Config · 5c817255
    Hartley McGuire authored
    Previously, it was very easy to accidentally leak a database password in
    production logs if an error ends up calling inspect on a ConnectionPool
    or an individual connection (Adapter). This is due to the default
    `#inspect` output for Pools and Adapters being unnecessarily large, and
    both currently including passwords (through the DatabaseConfig of a
    Pool, and the internal configuration of an Adapter).
    
    This commit addresses these issues by defining a custom `#inspect` for
    ConnectionPool, AbstractAdapter, and DatabaseConfig. The condensed
    `#inspect` only includes a few valuable fields instead of all of the
    internals, which prevents both the large output and passwords from being
    included.
    5c817255
    Add condensed #inspect for Pool, Adapter, Config
    Hartley McGuire authored
    Previously, it was very easy to accidentally leak a database password in
    production logs if an error ends up calling inspect on a ConnectionPool
    or an individual connection (Adapter). This is due to the default
    `#inspect` output for Pools and Adapters being unnecessarily large, and
    both currently including passwords (through the DatabaseConfig of a
    Pool, and the internal configuration of an Adapter).
    
    This commit addresses these issues by defining a custom `#inspect` for
    ConnectionPool, AbstractAdapter, and DatabaseConfig. The condensed
    `#inspect` only includes a few valuable fields instead of all of the
    internals, which prevents both the large output and passwords from being
    included.
Loading