Skip to content

Drop connection options from the connect state after authentication - #808

Closed
emancu wants to merge 1 commit into
elixir-ecto:masterfrom
emancu:drop-connect-opts-after-auth
Closed

emancu wants to merge 1 commit into
elixir-ecto:masterfrom
emancu:drop-connect-opts-after-auth

Conversation

@emancu

@emancu emancu commented Oct 31, 2026

Copy link
Copy Markdown

After authentication succeeds, the connect state still holds opts (password, username, hostname, database) and ssl (this can hold the client private key and its passphrase). No code reads them after authentication. But a crash whose term contains the state puts all of them in the exit reason and in the logs, for example the MatchError in #806. This change drops both keys when authentication succeeds.

The idea comes from #807, which removes only the password. The password is not the only secret in the state: ssl can hold a private key, and DBConnection also treats the username, hostname and database as sensitive. Both keys are unused after authentication, so it is simpler to drop them than to remove secrets one by one.

I used Claude to help with this PR. I reviewed and tested the code.

Closes the second point of #806.

@emancu emancu closed this Oct 31, 2026
@emancu
emancu deleted the drop-connect-opts-after-auth branch October 31, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant