Support migration session role before inspection for Supabase temporary NOINHERIT logins
Maintainer thường phản hồi trong vòng 1 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
Hướng nghiên cứu
Start by tracing the migration CLI entry point and the connection flow used for inspection, diffing, apply, and integrity verification; the issue does not name specific files or tests. Check how temporary per-grant or function role changes restore the session role, then identify coverage for NOINHERIT membership and failed membership. Done means the selected role is in effect throughout the migration flow and the requested regression cases pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Request
Support selecting an authorized PostgreSQL migration role on the existing connection before inspection, diffing, application and integrity verification, e.g. DataProviderMigrate migrate --run-as postgres (or a declared equivalent). Per-grant runAs does not solve pre-inspection visibility.
Reproduction
DataProviderMigrate 0.10.0-beta.1, PostgreSQL on Supabase, Supabase CLI 2.118.0 managed temporary login. The CLI credential has membership in postgres but does not inherit it:
SELECT current_user = 'postgres' AS postgres,
pg_has_role(current_user, 'postgres', 'MEMBER') AS member_postgres,
has_schema_privilege(current_user, 'public', 'CREATE') AS can_create,
(SELECT count(*) FROM information_schema.tables
WHERE table_schema = 'public') AS visible_tables;
Before explicit session role selection: {postgres: false, member_postgres: true, can_create: false, visible_tables: 0}.
After SET ROLE postgres on the same diagnostic connection: {postgres: true, can_create: true, visible_tables: 21}.
Running the published migrate CLI directly with the temporary connection incorrectly plans a large fresh-schema creation and then fails 42501: permission denied for schema public. The required application change is one nullable JSON column on an existing table. Both attempts rolled back.
Tried Npgsql startup Options=-c role=postgres; Supabase's pooler does not preserve that startup role. Independent asyncpg read-only probes using startup options and a direct startup role parameter both confirmed the session was still the temporary login. Explicit SET ROLE postgres succeeds because membership is already granted.
Expected behavior / regression coverage
- An opt-in migration role applies before all database inspection and remains in effect for apply/integrity verification.
- Limited NOINHERIT login + granted migration-role membership inspects existing tables correctly; adding one nullable column does not become a fresh-schema CREATE plan.
- A missing membership fails closed before schema mutations.
- Temporary per-grant/function role changes restore the selected migration role, rather than the original limited login.
- No password, token or connection string is logged.
NAP's caller RLS sessions are unrelated and must remain unchanged. This is an administrative migration CLI capability only. Blocking rollout: Nimblesite/NimblesiteAgenticPlatform#507. A valid direct migration credential also unblocks that rollout; we are not treating this feature as the only possible path.
- Ngôn ngữ chính
- C#
- Star
- 68
- Fork
- 4
- Merge trung bình
- 50 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay 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 Nimblesite/DataProvider
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
Nimblesite/DataProvider#137 · 3 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 82/100
Nimblesite/DataProvider#72 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Nimblesite/DataProvider#108 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A check constraint the schema cannot name can never be retired, and keeps enforcing the old ruleĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Nimblesite/DataProvider#107 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Nimblesite/DataProvider#106 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Nimblesite/DataProvider
Issue tương tự
-
kronos:develop:queued priority:P0
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
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 65/100
nopSolutions/nopCommerce#8512 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
modelcontextprotocol/csharp-sdk#2061 ·
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 76/100
Maintainer thường phản hồi trong vòng 1 ngày