Skip to content

Collapse hardware ID into device ID - #1251

Open
floitsch wants to merge 3 commits into
floitsch/build-artemis-service.s-new.091from
floitsch/build-artemis-service.s-new.100
Open

Collapse hardware ID into device ID#1251
floitsch wants to merge 3 commits into
floitsch/build-artemis-service.s-new.091from
floitsch/build-artemis-service.s-new.100

Conversation

@floitsch

Copy link
Copy Markdown
Member

Depends on #1245.

Summary

  • Uses device-id as the single canonical device identity throughout the CLI, service, broker APIs, and test infrastructure.
  • Stops generating and passing a distinct hardware ID during provisioning.
  • Makes the combined Supabase backend insert device-id into both public.devices.id and public.devices.alias for newly provisioned devices.
  • Keeps hardware_id only as a serialized compatibility alias equal to device_id, so older Artemis service images and CLI versions can still read newly produced identities and initial state.
  • Leaves existing Supabase rows with distinct id/alias values untouched and readable.

No database migration is needed: public.devices.id and alias already allow the same UUID, and the broker schema continues to use the alias/device-id.

Direction after this PR

The current b edge function is a transport multiplexer for goals, fleet state/events, artifacts, and pods. A follow-up should add capability-oriented edge functions while retaining b for older clients. Those functions can continue calling the existing RPCs and storage layout and share common Supabase auth/response helpers.

That would reduce CombinedBackend from a required monolithic adapter to a Supabase provider profile/factory that supplies several capability implementations. Some combined-deployment coupling remains around provisioning and RLS: public.devices links a device to its organization, and broker authorization resolves ownership through its alias. That coupling can remain internal to the Supabase profile.

Verification

  • Static analysis of all source and test Toit files.
  • Static analysis of the HTTP Artemis and broker test servers.
  • Dedicated HTTP broker integration test.
  • Shared-tenancy HTTP broker integration test.
  • Local CLI build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant