lablup / lablup/backend.ai

Backport the `myStorageHostPermissions` Strawberry query to a maintained pre-26.4.2 release line

Open
#12,835 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
17h 7m
Merged PRs (30d)
358

Description

## Problem

BAIFS gates file I/O on the per-host `UPLOAD_FILE`/`DOWNLOAD_FILE` union via the user-scoped Strawberry query `myStorageHostPermissions` (`manager/api/gql/storage_host.py`, `POST /admin/gql/strawberry`, `auth_required`). That query was **added in 26.4.2** (the type/payload/field each declare `added_version="26.4.2"`). Deployments older than 26.4.2 lack it, and the REST alternative `GET /folders/_/hosts` is unusable as a gate — its `allowed` list is **flat** (a host appears if the user holds *any* permission on it), so membership-checking it would be **fail-open** for upload/download granularity.

BAIFS v1 therefore declares **≥ 26.4.2** as its supported floor (verified live: the query works on manager `26.4.6` with a plain user keypair — see [docs/spikes/02-storage-host-permissions.md](../02-storage-host-permissions.md)). This ask exists only to unblock a customer pinned to an older manager.

## Request

Backport `myStorageHostPermissions` (and its `MyStorageHostPermissionsPayload` / `StorageHostPermission` types) to whichever pre-26.4.2 release line must be supported, preserving the per-permission union semantics so BAIFS can gate at `UPLOAD_FILE`/`DOWNLOAD_FILE` granularity.

## Rationale

- Without it on older managers, the only enforcement options are fail-open (unacceptable) or no BAIFS support below 26.4.2.
- The query is read-only and user-scoped; backporting is low-risk.

## Citations (`6d680960d`)

- `manager/api/gql/storage_host.py` — `my_storage_host_permissions` root field; `BackendAIGQLMeta(added_version="26.4.2")` on the field, payload, and node types.
- Route + auth: `manager/api/rest/admin/registry.py` `POST /gql/strawberry` (`auth_required`).
- Fail-open flatness of the REST alternative: `repositories/vfolder/repository.py:2131-2161` (`ListHostsActionResult`), discussed in [docs/02 §4.3](../../02-authentication.md).

---
_Filed from the BAIFS project: see lablup/BAIFS#6 and `docs/spikes/upstream-asks/07-backport-my-storage-host-permissions.md` for full context and citations._

Contributor guide

Open the contributing guide

Research direction

Start with manager/api/gql/storage_host.py and inspect the existing my_storage_host_permissions field plus its payload and node types. Check the cited Strawberry route and the target maintained pre-26.4.2 release line before backporting. Done means the user-scoped query is available there and preserves separate UPLOAD_FILE/DOWNLOAD_FILE permission membership semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, python
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.