Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

Fix admin connection when the connection was set via SetDbConnection - #4117

Open
EnesKartal wants to merge 1 commit into
npgsql:mainfrom
EnesKartal:fix/set-db-connection-admin-3600
Open

EnesKartal wants to merge 1 commit into
npgsql:mainfrom
EnesKartal:fix/set-db-connection-admin-3600

Conversation

@EnesKartal

Copy link
Copy Markdown

CreateAdminConnection only cloned the connection if it came from the options. With SetDbConnection() it rebuilt it from the connection string, which has no password once the connection was opened (Persist Security Info=false), so Migrate() failed with "No password has been provided".

It now clones the current connection in that case too. Added a regression test in ConnectionSpecificationTest; it fails without the change. Ran ConnectionSpecificationTest and NpgsqlRelationalConnectionTest locally against PostgreSQL 17 with SCRAM. Also confirmed the Migrate() scenario from the issue.

Fixes #3600

…ection

Database.SetDbConnection() doesn't update the options, so CreateAdminConnection()
rebuilt the admin connection from the (password-redacted) connection string instead
of cloning the connection, causing "No password has been provided" with SCRAM auth.

Fixes npgsql#3600

This branch has not been deployed

No deployments
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.

CreateAdminConnection() drops Password from connection string in EF Core 9 provider

1 participant