migrate: roles removed from schema.yaml are never dropped (no DropRoleOperation, even with --allow-destructive)

Đang mở
#83 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
38/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
csharp, sql
Lĩnh vực
database, security

Hướng nghiên cứu

Start by reading schema.yaml, the migration-spec, and the RLS spec section [RLS-PG-SUPPORT-DDL] to understand managed roles and current create/reassert behavior. Trace how --allow-destructive emits grant revokes and policy drops, then define where DropRoleOperation fits after those operations. Done means removed managed roles can be dropped safely, while roles owning objects or having unmanaged memberships are skipped with a warning.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Context

NAP completed its `[AUTHZ-ONE-ROLE]` migration: the `app_admin` role was removed from `schema.yaml` (roles list, all grants, all policies). Per the RLS spec, "Role drift is reconciled non-destructively: roles are created if missing" — there is no drop path at all.

Grants and policies referencing the removed role DO drop under `--allow-destructive`, which leaves a bare NOLOGIN/NOBYPASSRLS role with no privileges. That is powerless but it is permanent drift: the declarative yaml says the role does not exist, the database says it does, and there is no sanctioned way to converge (NAP is forbidden from hand-written DDL by policy).

Ask

A `DropRoleOperation` emitted when a role exists in the database (and was previously managed — e.g. matches a declared-role naming scope or is recorded in migration state) but is absent from the yaml, gated behind `--allow-destructive` like table/policy drops. Ordering: after all grant revokes and policy drops that reference the role, and it should skip (with a warning) if the role still owns objects or has memberships outside the managed set.

The migration-spec has no section on role drops today; the RLS spec's [RLS-PG-SUPPORT-DDL] only covers create/reassert.

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

Mở trong Codespaces

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.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Nimblesite/DataProvider

Tất cả issue của Nimblesite/DataProvider

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.