Support migration session role before inspection for Supabase temporary NOINHERIT logins
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- C#
- 星标
- 68
- 派生
- 4
- 平均合并
- 50 分钟
- 30 天内合并 PR
- 2
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Nimblesite/DataProvider 的其他 Issue
-
难度 1/5 1-3 小时 新手友好度 92/100
Nimblesite/DataProvider#137 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
Nimblesite/DataProvider#72 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
Nimblesite/DataProvider#108 ·
维护者通常 1 天内回复
-
A check constraint the schema cannot name can never be retired, and keeps enforcing the old rule未关闭
难度 4/5 3-5 天 新手友好度 48/100
Nimblesite/DataProvider#107 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
Nimblesite/DataProvider#106 ·
维护者通常 1 天内回复
查看 Nimblesite/DataProvider 的全部 Issue
相似的 Issue
-
kronos:develop:queued priority:P0
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
nopSolutions/nopCommerce#8512 ·
维护者通常 4 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
modelcontextprotocol/csharp-sdk#2061 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复