Skip to content

Gate device services using image capabilities - #73

Merged
pjeweb merged 2 commits into
osb/integrationfrom
osb/board-capabilities
Nov 14, 2026
Merged

pjeweb merged 2 commits into
osb/integrationfrom
osb/board-capabilities

Conversation

@pjeweb

@pjeweb pjeweb commented Nov 13, 2026 •

Copy link
Copy Markdown

Why

The app decides which services a box may use, such as sharing internet with connected clients, by guessing from a short list of known hardware (the legacy RK3588/x86 mini-PC list). A board outside that list misses services it actually has, for example client internet.

What it adds

  • When the image carries a valid board record, the box enables the services that record lists, including client internet on boards outside the legacy list.
  • Each part of the app asks for the one capability it needs: network, modem, SIM, regulatory, update, add-on, display, audio or control.
  • Older images whose record only carries branding keep the existing detector. A record that is present but malformed denies permissions instead.
  • The record does not add engine drivers, sensor mappings, OTA channels or hardware qualification for a new board family.

How

One capability module reads the image's board record, /etc/ceralive/release. A valid record is authoritative, even with an empty list. Development/mock mode and explicit overrides keep their precedence. Device control stays fail-closed (it refuses when it cannot verify), now under the explicit name requireVerifiedControl. Mocks and test fixtures use the same capability-named permissions, and a source check rejects direct production imports of the legacy classifier.

Targets the fork integration branch. Companion image PR: openstreambox/image-building-pipeline#24. #75 builds on this PR.

Technical detail

A valid image board record enables the services its profile supplies, including client internet on boards outside the legacy RK3588/x86 mini-PC list. A single capability module reads /etc/ceralive/release; subsystem gates ask for their actual network, modem, SIM, regulatory, update, add-on, display, audio or control capability.

Injected contracts, mock providers and fixtures also use permission names such as canRouteClients, canUnlockSim, canManageAddons and canManageModems. Control verification retains its fail-closed policy under the explicit name requireVerifiedControl. A source regression rejects direct production imports of the legacy classifier and old injected gate calls.

Branding-only older images retain the existing detector. Development/mocks and explicit overrides keep their precedence. A valid record is authoritative, including an empty list; an attempted but malformed record denies permissions. The legacy detector stays exported for compatibility. The record does not add engine drivers, sensor mappings, OTA channels or hardware qualification for a new family.

Validation

Validation: Bun 1.4.4 backend with one isolated worker: 12,663 pass, 19 skip, zero failures across 1,100 files. Node 24 frontend with one worker: 7,650/7,650 across 459 files, plus four hardware-preflight tests. Lint/types, debt and production build pass. Coverage includes non-RK3588 client internet, unknown-board legacy fallback, four family fixtures, selective permissions, development/mock precedence, malformed/unreadable records and the source guard. No hardware qualification was performed.

Review fixes
  • Separate device-control admission from token verification. A denied production channel never dials; unsigned control authentication is available only in explicit development/mock mode.
  • Reject whitespace-malformed board assignments before legacy fallback, sharing the record verdict between synchronous submission and asynchronous capability checks.
  • Refuse denied update submission, discovery, scheduled/startup work and staging before APT, RAUC or service effects. Capability denial cannot select legacy transport or report staging ready.
  • Require network-ingest at both the ingest RPC and service-mutation boundary. Cover both asymmetric capability profiles with fake service runners.
  • Add negative admission and parser regressions, and isolate kiosk/development test environments.

Validation: Bun 1.4.4 backend, one isolated worker: 12,675 pass / 19 skip / 0 fail across 1,101 files. Node 24 frontend, one worker: 7,650/7,650 across 459 files. RPC 827, i18n 797, sender 123, hardware preflight 4 pass. Lint/types (Svelte: zero errors/warnings), debt and production build pass. Regressions cover malformed-record legacy fallback, denied control/update effects, both asymmetric ingest RPC profiles and test-environment isolation. Image companion unchanged; no hardware qualification claimed.

@pjeweb
pjeweb merged commit 412e7e8 into osb/integration Nov 14, 2026
3 checks passed
pjeweb added a commit that referenced this pull request Nov 16, 2026
@pjeweb pjeweb added the upstream: waits for intent Needs an issue or maintainer agreement before an upstream proposal. label Nov 16, 2026
pjeweb added a commit that referenced this pull request Nov 17, 2026
pjeweb added a commit that referenced this pull request Nov 17, 2026
pjeweb added a commit that referenced this pull request Nov 18, 2026
pjeweb added a commit that referenced this pull request Nov 18, 2026
pjeweb added a commit that referenced this pull request Nov 19, 2026
pjeweb added a commit that referenced this pull request Nov 21, 2026
pjeweb added a commit that referenced this pull request Nov 22, 2026
pjeweb added a commit that referenced this pull request Nov 23, 2026
pjeweb added a commit that referenced this pull request Nov 24, 2026
pjeweb added a commit that referenced this pull request Nov 24, 2026
@pjeweb

pjeweb commented Nov 25, 2026

Copy link
Copy Markdown
Author

Still carried in the integration train and not upstream, so it continues as #240.

pjeweb added a commit that referenced this pull request Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upstream: waits for intent Needs an issue or maintainer agreement before an upstream proposal.

Development

Successfully merging this pull request may close these issues.

1 participant