Proposal: per-connection credential provider for short-lived MySQL credentials
メンテナーはふだん 10 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- go, mysql
調査の方向性
まず、go/mysql ConnectionConfig、Password.MigrationContext、CliPasswordProvider、ApplyCredentials のエントリポイントを追跡します。次に、database/sql、failover、cut-over、binlog-reader に記述された再接続の接続パスを追い、それぞれの試行の前に提案された provider がどのように呼び出されるかを判断します。関連する各接続パスについて API の動作と優先順位が定義され、カバーされていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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?
- 主要言語
- Go
- スター
- 13.6k
- フォーク
- 1.4k
- 平均マージ
- 9日 19時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/gh-ost のほかの issue
-
`--resume` without `--execute` drops the ghost table it correctly skipped altering対応中かも @ajm188 が 55 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 10 日以内に返信
-
[Suggestion] Apply simple validation to alter command対応中かも @drkemp187 が 106 日前に担当しました。 オープンenhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
github/gh-ost#1431 · コメント 4 件 ·
メンテナーはふだん 10 日以内に返信
-
Migration hangs when --attempt-instant-ddl succeeds対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
メンテナーはふだん 10 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
メンテナーはふだん 10 日以内に返信
-
Atomic cut-over always fails on MySQL 9.1+: information_schema.processlist errors out (3854) while another session runs a non-BMP utf8mb4 statement対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
github/gh-ost#1780 · コメント 1 件 ·
メンテナーはふだん 10 日以内に返信
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
prime-radiant-inc/evener#6325 ·
メンテナーはふだん 1 日以内に返信
-
team:library-maintainers
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
padok-team/burrito#1208 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
bazel-contrib/rules_go#4784 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
betterleaks/betterleaks#484 ·
メンテナーはふだん 1 日以内に返信