Proposal: per-connection credential provider for short-lived MySQL credentials
Maintainer thường phản hồi trong vòng 10 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go, mysql
- Lĩnh vực
- backend-api-design, databases
Hướng nghiên cứu
Bắt đầu bằng cách lần theo các entry point go/mysql ConnectionConfig, Password.MigrationContext, CliPasswordProvider và ApplyCredentials. Tiếp theo, lần theo các đường dẫn kết nối dùng cho việc kết nối lại được mô tả trong database/sql, failover, cut-over và binlog-reader, rồi xác định provider được đề xuất sẽ được gọi như thế nào trước mỗi lần thử. Công việc được xem là hoàn tất khi hành vi của API và thứ tự ưu tiên được xác định và bao quát cho từng đường dẫn kết nối liên quan.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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?
- Ngôn ngữ chính
- Go
- Star
- 13.6k
- Fork
- 1.4k
- Merge trung bình
- 9 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/gh-ost
-
`--resume` without `--execute` drops the ghost table it correctly skipped alteringCó thể đã có người làm @ajm188 đã nhận 55 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 10 ngày
-
[Suggestion] Apply simple validation to alter commandCó thể đã có người làm @drkemp187 đã nhận 106 ngày trước. Đang mởenhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
github/gh-ost#1431 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 10 ngày
-
Migration hangs when --attempt-instant-ddl succeedsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 10 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Maintainer thường phản hồi trong vòng 10 ngày
-
Atomic cut-over always fails on MySQL 9.1+: information_schema.processlist errors out (3854) while another session runs a non-BMP utf8mb4 statementCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
github/gh-ost#1780 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 10 ngày
Tất cả issue của github/gh-ost
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
prime-radiant-inc/evener#6325 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
team:library-maintainers
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
padok-team/burrito#1208 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
bazel-contrib/rules_go#4784 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
betterleaks/betterleaks#484 ·
Maintainer thường phản hồi trong vòng 1 ngày