Drop --scope from BrokerCli method signatures. - #1243
Open
floitsch wants to merge 2 commits into
Open
Conversation
Each BrokerCli instance is constructed with a server-config that carries its own scope (PR #1241). The data-plane methods now read it off server-config_.scope internally instead of taking it per call. - BrokerCli interface: 9 methods lose --scope/Scope. - BrokerCliHttp impl: each method resolves organization-id via server-config_.scope.as-uuid. - BrokerCliSupabase: when the broker-cli wraps a Supabase config, the inner http-config is now built with the same scope. - Broker class: drops --scope=server-config.scope from every BrokerCli call (cleaner; the broker connection already knows its scope). - upload-image previously passed --scope=(Scope.from-organization-id device.organization-id) — collapses to the broker's scope. device.organization-id is always equal to the broker's scope today (each device in this fleet belongs to this fleet's org), so the distinction was theoretical. Documented why we dropped it. - Tests: tests/broker.toit attaches TEST-SCOPE to the test ServerConfigs (HTTP construction; Supabase via 'with --scope'); tests/{broker,pod-registry}-test drop --scope=TEST-SCOPE from each BrokerCli call.
floitsch
force-pushed
the
floitsch/build-artemis-service.s-new.080
branch
from
May 23, 2026 13:09
7210530 to
1f386ba
Compare
Scope no longer exposes 'as-uuid'. Instead it wraps any
JSON-encodable value (string, Map, etc.) and exposes only:
- Scope.from-json: build a scope from a JSON-encodable value.
- Scope.from-organization-id: convenience for today's UUID case (the
UUID is stored as a string internally).
- scope.to-json: read back the wrapped JSON value.
Each backend that consumes a scope knows the shape its auth provider
issues and interprets to-json accordingly. There is no shared
'to-key' or 'to-string' indirection — backends derive whatever stable
representation they need (URL segment, cache key, ...) from the JSON
form directly.
Callers updated:
- HTTP broker impl: uses scope.to-json directly as a URL path segment;
variable renamed from 'organization-id' to 'scope'.
- cache.toit: cache keys interpolate scope.to-json.
- ServerConfig.{from,to}-json: serializes/parses scope as an arbitrary
JSON value rather than a UUID string.
- fleet.toit: FleetFile/Fleet.organization-id getter parses
broker-scope.to-json as a Uuid (the auth-call sites are still
org-id concrete).
floitsch
force-pushed
the
floitsch/build-artemis-service.s-new.080
branch
from
May 23, 2026 13:31
4d99838 to
b64d085
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Each BrokerCli instance is constructed with a server-config that carries its own scope (PR #1241). The data-plane methods now read it off server-config_.scope internally instead of taking it per call.