ADORSYS-GIS / ADORSYS-GIS/lightbridge-authz

[Ticket]: listQuotaTiers catalogue procedure (twin of listBillingPlans)

オープン
#572 コメント 0 件 リアクション 0 件 担当者 1 名 @stephane-segning が担当を希望しています GitHub で見る
ticket
主要言語
Rust
スター
0
フォーク
1
平均マージ
7時間 7分
マージ済み PR(30日)
237

説明

### Type
Feature

### Summary
We need a read-only `listQuotaTiers` catalogue procedure because the converse-frontends console's `/settings/tiers` screen (IA v3 phase 2) can only display which quota tier ids are already ASSIGNED to an account/project — it has no way to enumerate the operator-configured tier catalogue itself, so no tier picker can be built anywhere in the console.

Expected result:
> A procedure shaped like `listBillingPlans(): BillingPlanInfo[]` — e.g. `listQuotaTiers(args: ListQuotaTiersInput): QuotaTierInfo[]` — returning every configured tier's id/name and whatever limit fields it carries, read-only.

### Intent
`Account.defaultQuota` and `Project.projectQuota` are both free-form tier-id strings validated server-side against `QuotaTiers::is_allowed` (see `packages/authz-rpc/schema/authz.cstack`'s own comments on `defaultQuota`/`projectQuota`), but nothing on the RPC surface exposes that catalogue for a frontend to read. `/settings/tiers` today can only show ASSIGNED tiers (`Account.defaultQuota`/`Project.projectQuota`) as read-only rows with an inline note pointing at this gap — no tier picker exists anywhere in the console because there is nothing to populate one with.

### Source of truth (links)
https://github.com/ADORSYS-GIS/converse-frontends/issues/368 (IA v3 phase 2 — "the settings area")

### Current Behavior
`QuotaTiers` (the operator-configured tier catalogue, analogous to `Billing`/`ModelCatalog`) has no corresponding `list*` procedure. `listBillingPlans`/`listModelCatalog` are the direct precedent this is missing a twin of.

### Expected Behavior
A read-only procedure returns the full quota-tier catalogue (id, name, and whatever limit fields the tier carries — mirroring `BillingPlanInfo.limits`' shape), gated at a permission a caller who can already read/assign quota tiers holds.

### Acceptance Criteria
- [ ] Given an authenticated, appropriately-permissioned caller, when they call the new procedure, then they receive the full quota-tier catalogue.
- [ ] Given a caller without that permission, when they call it, then they receive a clear authorization error.
- [ ] Error cases are handled safely.
- [ ] Existing behavior is not broken.
- [ ] Relevant tests are added or updated.
- [ ] Verification evidence is provided.

### Out of Scope
Writing/creating quota tiers from the console — tiers stay operator config; this is read-only, matching `listBillingPlans`/`listModelCatalog`'s own scope.

### Technical Context
`packages/authz-rpc/schema/authz.cstack` — see `listBillingPlans`/`listModelCatalog` for the pattern to mirror, and `Account.defaultQuota`/`Project.projectQuota`'s own doc comments for how `QuotaTiers::is_allowed` validates a write today with no corresponding read. Consuming side: `apps/console/src/app/(console)/settings/tiers/page.tsx` names this gap inline (`InlineStatus`) beside the read-only assigned-tier rows it can already render from `Account`/`Project` fields it already fetches.

### Risks
None beyond ordinary API-surface growth — read-only, additive.

### Test Plan
Unit tests on the new procedure's authorization gate and its shape; a converse-frontends follow-up wires an actual tier picker into `/settings/tiers` (and anywhere else a tier is assigned) and adds its own tests/stories.

### Verification evidence
Filed from the converse-frontends IA v3 phase 2 work (branch `claude/ia-v3-p2`) as a blocking backend gap discovered while building `/settings/tiers`. No code change in this repo yet — this ticket tracks the gap itself.

### Human accountable owner
@stephane-segning

### AI Usage Declaration
Drafting the ticket, Understanding code

### Human verification completed
- [ ] I am the accountable owner and accept responsibility for this ticket. (assigned at open time per team convention; owner review pending)

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start in packages/authz-rpc/schema/authz.cstack by comparing listBillingPlans and listModelCatalog, then inspect the Account.defaultQuota and Project.projectQuota comments and the QuotaTiers::is_allowed validation path. Add the procedure and its authorization and shape tests, confirming that permitted callers receive the catalogue and unauthorized callers receive a clear error without breaking existing behavior.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust
領域
api, authorization
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。