LQL: support table/setof-returning functions for SECURITY DEFINER row reads
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
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Ít trao đổi
- Lĩnh vực
- backend-api-design, databases
Hướng nghiên cứu
Start with the functions: surface in schema.yaml and the LQL/DataProvider handling for scalar returns such as boolean and uuid. Determine whether table/setof returns and tuple projection exist; document the supported syntax and behavior, or record the missing capability in the roadmap, using the linked kill-app-admin plans as acceptance context.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Need
NAP's `[AUTHZ-ONE-ROLE]` migration (docs/plans/kill-app-admin.md) drops the direct `app_user` SELECT grant on a handful of operator-owned tables (`cost_card_llm`, `cost_card_machine`, `wallet.markup`, `bundles` in the HMAC-only path). Reads from those tables move behind `SECURITY DEFINER` functions that re-verify the caller's intent server-side (HMAC, GUC, etc.) and return the row(s).
The existing LQL `functions:` surface in `schema.yaml` supports scalar returns (`boolean`, `uuid`). Example:
```yaml
- name: is_member
arguments: [...]
returns: boolean
securityDefiner: true
bodyLql: |
exists(tenant_members |> filter(fn(m) => m.user_id = u and m.tenant_id = t))
executeRoles: [app_user, app_admin]
```
The pipeline syntax `
|> filter(...)` could naturally extend to row sets, but there is no example of a function returning a row (`returns: table(...)` / `returns: setofAsk
- Document whether table/setof returns are supported today (and how — `returns: setof cost_card_llm` style?).
- If not supported, add it to the roadmap. NAP can work around by emitting JSON-encoded rows from a SECDEF returning `text` / `jsonb`, but that's a hack — proper typed support would be far cleaner.
Workarounds NAP is considering (in order of preference)
- `returns: jsonb` + decode in Python (works today if jsonb is supported by LQL).
- `returns: setof <table_name>` (needs DataProvider support).
- Multiple scalar SECDEF fns (one per column) — slow + many round-trips.
- Keep `admin_session` for these reads — defeats the whole `[AUTHZ-ONE-ROLE]` invariant.
Filed during the 2026-05-19 NAP coverage / kill-app-admin push. Cross-link: NimblesiteAgenticPlatform/docs/plans/kill-app-admin.md, NimblesiteAgenticPlatform/docs/plans/kill-app-admin-edit-list.md.
- 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ó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Nimblesite/DataProvider#121 ·
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
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