Add functions to set passwords without sending them in plain text
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 45/100
Rechercherichtung
Start with the Connection class of PyGreSQL and the libpq wrapper it calls, since the proposed methods sit on top of PQencryptPasswordConn() and PQchangePassword(). Check how the libpq version is detected so the code can fall back to encrypting locally and sending ALTER USER on older libpq. Decide whether DB and pgdb get the methods too. Done means encrypt_password() and change_password() exist with tests that run against a PostgreSQL server and cover both the libpq 17+ path and the fallback.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
To set a password with SQL, it is usually sent in plain text (ALTER ROLE ... PASSWORD '...'), so it can end up in the server log or in pg_stat_activity. libpq has functions that encrypt the password on the client:
PQencryptPasswordConn()(libpq 10) returns the encrypted password, using the algorithm from the server settingpassword_encryption(normally SCRAM-SHA-256), or a given algorithm.PQchangePassword()(libpq 17) encrypts the password and sends theALTER USERcommand.
psycopg2 has encrypt_password(), psycopg 3 has both functions at the pq level. PostgreSQL 18 and 19 warn about MD5 passwords, so this helps with moving to SCRAM.
I plan to add Connection.encrypt_password(password, user, algorithm=None) and Connection.change_password(user, password), maybe also in DB and pgdb. change_password() would use PQchangePassword() with libpq 17 or newer, and otherwise encrypt the password and send ALTER USER with the escaped user name and encrypted password. User name and password are encoded with the client encoding.
- Vorherrschende Sprache
- Python
- Sterne
- 48
- Forks
- 22
- Ø Merge
- 12 Min.
- Gemergte PRs (30 T.)
- 28
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus PyGreSQL/PyGreSQL
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 8/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 15/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in PyGreSQL/PyGreSQL
Ähnliche Issues
-
Add server: crowllm-mcpOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
pathintegral-institute/mcpm.sh#568 ·
Maintainer antworten meist innerhalb von 21 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
invarislabs/invaris-agentsec#98 ·
Maintainer antworten meist innerhalb von 1 Tag
-
5-minutes beginner-friendly documentation good first issue hacktoberfest help wanted no-code-needed python
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 65/100
Huerte/algo-solutions-python#364 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
Becksteinlab/imdclient#161 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag