Decide access to every resource with one shared check
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- scala
- 領域
- api, authorization, backend, databases
調査の方向性
Start by reading the access checks named in the issue: WorkflowAccess and ComputingUnitAccess in common/auth, ResourceAccess in common/resource, plus the computing unit and notebook migration checks. Trace how today's ownership and grants feed the resource lists and checks, and review #9485 for the required contract. Done means every resource access decision uses one function and every kind uses the shared list, grant, and revoke endpoints.
索引モデルが issue の本文から書いたものです。
説明
Task Summary
Access is recorded in ten places and decided in at least five. Ownership lives in the workflow_of_user table for workflows, in an owner_uid column for datasets and models, and in a uid column for the other kinds, while grants live in four *_user_access tables with the same three columns. The checks are written separately: WorkflowAccess and ComputingUnitAccess in common/auth, ResourceAccess in common/resource for datasets and models, a second computing unit check in ComputingUnitAccessResource, and a workflow check in notebook-migration-service. The same sharing endpoints exist four times in three services, environments and warehouses cannot be shared at all, and a list can disagree with a check, as in #9227.
This task records access in one table and decides it with one function, in two phases: first one check over today's data, then one table and one set of sharing endpoints for every kind.
Before
Three of the kinds show the pattern. Models follow datasets, and environments and warehouses record only an owner.
erDiagram
user ||--o{ workflow_of_user : "owns"
workflow ||--o{ workflow_of_user : "owned in"
user ||--o{ workflow_user_access : "is granted"
workflow ||--o{ workflow_user_access : "shared in"
user ||--o{ dataset : "owns by owner_uid"
user ||--o{ dataset_user_access : "is granted"
dataset ||--o{ dataset_user_access : "shared in"
user ||--o{ workflow_computing_unit : "owns by uid"
user ||--o{ computing_unit_user_access : "is granted"
workflow_computing_unit ||--o{ computing_unit_user_access : "shared in"
workflow_user_access {
int uid PK
int wid PK
privilege_enum privilege
}
dataset_user_access {
int did PK
int uid PK
privilege_enum privilege
}
computing_unit_user_access {
int cuid PK
int uid PK
privilege_enum privilege
}
Each service decides access with its own code:
flowchart LR
ds["Dashboard Service"]
fs["File Service"]
cs["Computing Unit<br/>Managing Service"]
acs["Access Control Service"]
nb["Notebook Migration Service"]
pw["Environment and<br/>warehouse resources"]
wa["WorkflowAccess<br/>common/auth"]
ra["ResourceAccess<br/>common/resource"]
cua["ComputingUnitAccess<br/>common/auth"]
cur["ComputingUnitAccessResource<br/>its own check"]
nwa["WorkflowAccessResource<br/>its own check"]
own["An owner filter<br/>in each resource class"]
ds --> wa
fs --> ra
cs --> cur
cs --> cua
acs --> cua
nb --> nwa
pw --> own
After
erDiagram
user ||--o{ access : "holds"
resource ||--o{ access : "grants"
resource {
uuid rid PK
string kind
bool is_public
}
access {
uuid rid PK
int uid PK
string level "own, write or read"
}
flowchart LR
jvm["Every JVM service"]
ext["Agent service,<br/>gateway"]
acs["Access Control Service"]
one["One access function<br/>common/resource"]
pm["Permission map<br/>from the contract"]
t[("access")]
jvm --> one
ext -- "POST /access/evaluation" --> acs
acs --> one
pm -.-> one
one --> t
| Operation | Before | After |
|---|---|---|
| List | GET /access/workflow/list/{wid}, and a copy each for datasets, models and computing units |
GET /{kind}/{rid}/access |
| Grant or change | PUT /access/workflow/grant/{wid}/{email}/{privilege}, and the same three copies |
PUT /{kind}/{rid}/access/{uid} |
| Revoke | DELETE /access/workflow/revoke/{wid}/{email}, and the same three copies |
DELETE /{kind}/{rid}/access/{uid} |
| Check | No endpoint: each service checks access in its own code | POST /access/evaluation |
Scope
- One check over today's data. An
accessview, keyed by theridof #9487, unites today's owners and grants. One function incommon/resourceanswers both "may this user do this to this resource" and "which resources may this user see", so a list and a check cannot disagree. Every existing check calls it, andPOST /access/evaluationgives the same answer to callers outside the JVM, such as the agent service. - One table and one set of sharing endpoints. Owners and grants move into an
accesstable, and every kind is shared through the endpoints above, environments and warehouses included. The old/access/{kind}/...routes become adapters over them, and the old tables remain as views until their last reader moves. - Executions follow their workflow. An execution is checked as the workflow it belongs to, which is what the agent needs to read an execution's outcome (eugenegujing in #9395).
The second phase needs the contract of #9485, and a host for the kinds in amber (discussion point 3 of the parent issue). This task does not verify tokens, which is #9486. The agent's own rules (#5268) build on this check, and #9478 can land before it.
Discussion Points
- The levels.
own,writeandreadreplaceprivilege_enum(NONE,READ,WRITE) and the separate owner records. A public resource is readable by everyone without a row per user. - Operations of one kind. Executing a workflow or uploading a file to a dataset needs a permission that the contract of #9485 maps to a level, so a kind can add an operation without adding an access rule (mengw15 in #9395).
- Rules that differ today. For example, a user with read access can leave a shared workflow but not a shared dataset. Each such difference needs one rule, pinned by a test before the code changes.
- A policy engine. One table and one function cover a user, a resource and a level. A policy engine such as OpenFGA pays off once groups or projects arrive, and
POST /access/evaluationis where it would plug in. My Texera 2.0 prototype used OpenFGA, and needed an outbox, a relay and a second copy of its rules in SQL to filter lists.
Done when every endpoint that reads or changes a resource or its sharing decides access through the one function, and every kind is shared through the same three endpoints.
Task Type
- Refactor / Cleanup
- DevOps / Deployment / CI
- Testing / QA
- Documentation
- Performance
- Other
- 主要言語
- Scala
- スター
- 333
- フォーク
- 202
- 平均マージ
- 3日 11時間
- マージ済み PR(30日)
- 185
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/texera のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
addOperator returns an error but still adds the operator対応中かも @sunny-kavixo が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/texera#9121 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Failed tool calls are marked as succeeded (isError is always false)対応中かも @oliarmak-web が 14 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
apache/texera#9120 · コメント 8 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
apache/texera#8682 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
? - Needs Triage bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
NVIDIA/cudf-spark#16937 ·
メンテナーはふだん 1 日以内に返信
-
LFST not-issued-store count truncation can incorrectly clear strictShouldWait対応中かも @weidingliu が今日担当しました。 オープンmodule: memory type: bug/reported
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
OpenXiangShan/XiangShan#6974 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
-
bug indigo
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
PurpleKingdomGames/indigoengine#300 · コメント 1 件 ·
-
JavaReservoirSampleOperator returns the whole input when the dataset size is unknown対応中かも @sasmith-14 が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/wayang#884 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
AI Generated CI/CD ⚒️ Flaky-tests 🐦 python 🐍
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
valkey-io/valkey-glide#7722 ·
メンテナーはふだん 1 日以内に返信