Proposal: per-connection credential provider for short-lived MySQL credentials
Maintainer antworten meist innerhalb von 10 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- go, mysql
- Bereich
- backend-api-design, databases
Rechercherichtung
Beginne damit, die Einstiegspunkte go/mysql ConnectionConfig, Password.MigrationContext, CliPasswordProvider und ApplyCredentials nachzuverfolgen. Verfolge anschließend die in database/sql, failover, cut-over und binlog-reader beschriebenen Verbindungspfade für Wiederverbindungen und bestimme dann, wie der vorgeschlagene Provider vor jedem Versuch aufgerufen würde. Als erledigt gilt die Aufgabe, wenn das API-Verhalten und die Priorität für jeden relevanten Verbindungspfad definiert und abgedeckt sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Problem
Managed MySQL services and other credential providers supply short-lived database credentials: e.g. AWS IAM for RDS, GCP Cloud SQL IAM, and HashiCorp Vault's database secrets engine. Currently, gh-ost captures a password once and reuses it for the life of the migration, so there is no way to supply a renewed valid credential when a new connection is dialed mid-migration.
New connections are opened in at least the following cases:
• database/sql re-dials after ErrBadConn or a server-side wait_timeout
• a failover forces reconnection
• the cut-over takes a fresh pinned connection for its lock
• the binlog reader is rebuilt after a streaming failure surfaces
Proposed API and scope
// go/mysql
type PasswordProvider func(ctx context.Context, key InstanceKey) (string, error)
ConnectionConfig.PasswordProvider takes precedence over Password.MigrationContext. CliPasswordProvider is copied into the connection config by ApplyCredentials. The provider is called immediately before each connection attempt.
This is deliberately an API for programs embedding gh-ost . It does not add built-in cloud IAM support or a credential-fetching CLI flag, and introduces no cloud SDK dependency. An embedding caller implements it with an AWS SigV4 token, an Entra or Cloud SQL access token, a Vault lease, a password command, or a closure over a static string.
Example: embedding with AWS RDS IAM
ctx.CliPasswordProvider = func(c context.Context, key mysql.InstanceKey)
(string, error) {
return auth.BuildAuthToken(
c, key.DisplayString(), awsConfig.Region, ctx.CliUser, awsConfig.Credentials,
)
}
ctx.CliAllowCleartextPasswords = true
ctx.UseTLS = true
ctx.TLSCACertificate = "/etc/ssl/certs/rds-ca-bundle.pem"
Would a library hook be an acceptable first interface, or would you prefer a CLI-facing mechanism such as a credentials file or a password command?
- Vorherrschende Sprache
- Go
- Sterne
- 13.6k
- Forks
- 1.4k
- Ø Merge
- 9 T. 19 Std.
- Gemergte PRs (30 T.)
- 1
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
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 github/gh-ost
-
`--resume` without `--execute` drops the ghost table it correctly skipped alteringEvtl. vergeben @ajm188 hat das vor 56 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
Maintainer antworten meist innerhalb von 10 Tagen
-
[Suggestion] Apply simple validation to alter commandEvtl. vergeben @drkemp187 hat das vor 106 Tagen übernommen. Offenenhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
github/gh-ost#1431 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 10 Tagen
-
Migration hangs when --attempt-instant-ddl succeedsEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
Maintainer antworten meist innerhalb von 10 Tagen
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 42/100
Maintainer antworten meist innerhalb von 10 Tagen
-
Atomic cut-over always fails on MySQL 9.1+: information_schema.processlist errors out (3854) while another session runs a non-BMP utf8mb4 statementEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 52/100
github/gh-ost#1780 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 10 Tagen
Ähnliche Issues
-
[Docs] Four internal links return 404 (Models concept, Contributing to Docs, Providers reference)Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
meshery/meshery#23520 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
flaky: execenv TestRelayControlledCancelAndDirectParentDeath reads an empty pid file under loadOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
SocialGouv/iterion#3263 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Container registry refuses image names with "__" or "--" (NAME_INVALID), which the OCI distribution spec allows since v1.1.0Evtl. vergeben @lazerg hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
itadori26/trisse-home#226 ·
Maintainer antworten meist innerhalb von 1 Tag