ADORSYS-GIS / ADORSYS-GIS/lightbridge-authz

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

Offen
#572 0 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @stephane-segning Auf GitHub ansehen
ticket
Vorherrschende Sprache
Rust
Sterne
0
Forks
1
Ø Merge
6 Std. 42 Min.
Gemergte PRs (30 T.)
246

Beschreibung

### 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)

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.