Decide access to every resource with one shared check
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Refactoring
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- scala
- Ambito
- api, authorization, backend, databases
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Scala
- Stelle
- 333
- Fork
- 202
- Merge medio
- 3g 11h
- PR unite (30g)
- 185
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/texera
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
addOperator returns an error but still adds the operatorForse già presa @sunny-kavixo l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/texera#9121 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Failed tool calls are marked as succeeded (isError is always false)Forse già presa @oliarmak-web l’ha presa 14 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
apache/texera#9120 · 8 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
apache/texera#8682 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/texera
Issue simili
-
? - Needs Triage bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
NVIDIA/cudf-spark#16937 ·
I maintainer di solito rispondono entro 1 giorno
-
LFST not-issued-store count truncation can incorrectly clear strictShouldWaitForse già presa @weidingliu l’ha presa oggi. Apertamodule: memory type: bug/reported
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
OpenXiangShan/XiangShan#6974 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
-
bug indigo
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
PurpleKingdomGames/indigoengine#300 · 1 commento ·
-
JavaReservoirSampleOperator returns the whole input when the dataset size is unknownForse già presa @sasmith-14 l’ha presa 2 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/wayang#884 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
AI Generated CI/CD ⚒️ Flaky-tests 🐦 python 🐍
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
valkey-io/valkey-glide#7722 ·
I maintainer di solito rispondono entro 1 giorno