feat(sharing): publish writable and manageable domains on the account payload

Every accountAccess entry on GET /api/auth/me carries writableDomains
and manageableDomains: the sections the grant opens, intersected with
the sections whose routes accept a delegated write at that level. A
READ grant gets two empty lists, a WRITE grant gets writable sections
only, a MANAGE grant gets both, and the vault appears in neither.

The client parser checks the structural invariants (no repeats, within
the grant's sections, manageable within writable, nothing below the
level) and requires the two published views of the active record to
agree on the lists. Regenerate the OpenAPI document and extend the
payload consumer guard with the active-record readers.
This commit is contained in:
Marc-André Bombeck committed 2026-09-09 19:42:26 +02:00
1 parent 54f0030ead
commit b5c392636f
14 files changed
+319 -2

No files matched your search

+56
View File
@@ -65685,6 +65685,32 @@ components:
- type: "null"
canWrite:
type: boolean
writableDomains:
type: array
items:
type: string
enum:
- measurements
- medications
- labs
- profile
- illness
- mind
- cycle
- documents
manageableDomains:
type: array
items:
type: string
enum:
- measurements
- medications
- labs
- profile
- illness
- mind
- cycle
- documents
required:
- accountId
- username
@@ -65695,6 +65721,8 @@ components:
- recordKind
- sections
- canWrite
- writableDomains
- manageableDomains
additionalProperties: false
active:
anyOf:
@@ -65747,6 +65775,32 @@ components:
- type: "null"
canWrite:
type: boolean
writableDomains:
type: array
items:
type: string
enum:
- measurements
- medications
- labs
- profile
- illness
- mind
- cycle
- documents
manageableDomains:
type: array
items:
type: string
enum:
- measurements
- medications
- labs
- profile
- illness
- mind
- cycle
- documents
required:
- accountId
- username
@@ -65757,6 +65811,8 @@ components:
- recordKind
- sections
- canWrite
- writableDomains
- manageableDomains
additionalProperties: false
- type: "null"
recordKind: