Household grants and Scopes for Bots #88

Open
opened 2026-11-27 16:43:27 -05:00 by bobby · 0 comments
Owner

Part of #73 (spec: #72)

What to build

The Owner gives a Bot a Household grant of a Scope with hapi grant add|list|remove <bot> <scope>. Scopes are finance|fitness|maintenance|smart_home × read|write (write implies read), plus health. Routes declare require_scope(...), which shows in OpenAPI. Household RLS checks the read Scope in USING and the write Scope in WITH CHECK. Grant changes are audited.

Acceptance criteria

  • A Bot with maintenance:read can list and get Assets, and gets 403 on create
  • A Bot with maintenance:write can create Assets, with Recorded by showing the Bot
  • A Bot without a grant gets 403
  • RLS also denies a Bot without the grant, proved by a test that bypasses the app guard
  • Grant add and remove log audit events
Part of #73 (spec: #72) ## What to build The Owner gives a Bot a Household grant of a Scope with `hapi grant add|list|remove <bot> <scope>`. Scopes are `finance|fitness|maintenance|smart_home` × `read|write` (write implies read), plus `health`. Routes declare `require_scope(...)`, which shows in OpenAPI. Household RLS checks the read Scope in `USING` and the write Scope in `WITH CHECK`. Grant changes are audited. ## Acceptance criteria - [ ] A Bot with `maintenance:read` can list and get Assets, and gets `403` on create - [ ] A Bot with `maintenance:write` can create Assets, with Recorded by showing the Bot - [ ] A Bot without a grant gets `403` - [ ] RLS also denies a Bot without the grant, proved by a test that bypasses the app guard - [ ] Grant add and remove log audit events
bobby added the ready-for-agent label 2026-11-27 16:43:27 -05:00
bobby added a new dependency 2026-11-27 16:43:27 -05:00
bobby added a new dependency 2026-11-27 16:43:30 -05:00
bobby added a new dependency 2026-11-27 16:43:51 -05:00
bobby added a new dependency 2026-11-27 16:43:58 -05:00
bobby added a new dependency 2026-11-27 16:44:05 -05:00
bobby added a new dependency 2026-11-27 16:44:11 -05:00
bobby added a new dependency 2026-11-27 16:44:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: bobby/hapi#88