Clarify the importance of NOINHERIT to properly create a role on the DOCS
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- postgresql
- Lĩnh vực
- documentation, security
Hướng nghiên cứu
Bắt đầu bằng cách xem lại tài liệu PostgreSQL GRANT được liên kết trong issue và tìm phần hướng dẫn tương ứng về việc tạo role trong repository này. Làm rõ hành vi của NOINHERIT, tính duy trì của role và ví dụ ALTER ROLE riêng biệt; được coi là hoàn tất khi tài liệu giải thích chính xác rủi ro ủy quyền và không ngụ ý rằng một CREATE ROLE được thực hiện sau đó sẽ thay đổi một role hiện có.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When a ROLE is created in PG, it may inherit privileges from other roles. It specially inherits all privileges from the PUBLIC role.
From the DOCs:
"Any particular role will have the sum of privileges granted directly to it, privileges granted to any role it is presently a member of, and privileges granted to PUBLIC.".
If your application is implementing a whitelist logic (most of the cases), this may represent a leak of authorization. So all roles must be created using the NOINHERIT clause, but there is another gotcha: creating a role and them altering it to NOINHERIT is a safer option than creating a role with NOINHERIT.
-- OK if there is no graphile_visitor already in your system
CREATE ROLE graphile_visitor NOINHERIT;
-- A better option, specially during development if you use dropdb to "reset" your application
CREATE ROLE graphile_visitor;
ALTER ROLE graphile_visitor NOINHERIT;
When a ROLE is created, it's not stored into the database itself, but inside a private catalog called pg_user. If graphile_visitor by accident was crate without the NOINHERIT, dropping the database won't erase it, so adding the NOINHERIT to its creation clause afterward will have no effect at all.
-- this is a mistake
CREATE ROLE graphile_visitor;
-- this isn't a bug fix
CREATE ROLE graphile_visitor NOINHERIT;
This happens because, when it runs the second query, PG will identify that a role with the same name already exists so it will skip the CREATE ROLE. Keeping creation and alteration separated will ensure the intended behavior.
- Ngôn ngữ chính
- SCSS
- Star
- 27
- Fork
- 124
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không 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 graphile/graphile.github.io
-
help wanted quick
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 38/100
graphile/graphile.github.io#401 · 1 bình luận · 1 reaction ·
-
website: Update details on homepage and sponsor pageCó thể làm lại được @jemgillam đã nhận 1119 ngày trước và không có pull request nào đang mở. Đang mởquick
graphile/graphile.github.io#399 · 4 bình luận · 1 người được giao ·
-
sponsor page: New wording around Grafast needed!Có thể làm lại được @jemgillam đã nhận 1149 ngày trước và không có pull request nào đang mở. Đang mở
graphile/graphile.github.io#393 · 1 reaction · 1 người được giao ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 38/100
graphile/graphile.github.io#341 · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
graphile/graphile.github.io#280 · 2 bình luận · 5 reaction ·
Tất cả issue của graphile/graphile.github.io
Issue tương tự
-
marketing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
gke-labs/kube-agents#7308 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/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
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 62/100
-
chore
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
lugassawan/swe-workbench#841 ·