broker: migrate runtime registration identity to org id#195
Open
benvinegar wants to merge 1 commit intomainfrom
Open
broker: migrate runtime registration identity to org id#195benvinegar wants to merge 1 commit intomainfrom
benvinegar wants to merge 1 commit intomainfrom
Conversation
871f7e8 to
6933b0c
Compare
Greptile SummaryThis PR successfully migrates broker registration from workspace-focused identity ( Key Changes
ValidationComprehensive test coverage validates:
Migration StrategyThe implementation follows a safe multi-phase rollout:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Client/CLI] -->|--org-id or --workspace-id| B[broker-register.mjs]
B -->|Normalizes to orgId| C[Registration Payload]
C -->|Sends both org_id and workspace_id| D[Broker Server /api/register]
E[Runtime Startup] -->|Reads env vars| F[env-aliases.mjs]
F -->|Resolves GATEWAY/SLACK variants| G{Has ORG_ID?}
G -->|Yes| H[Use ORG_ID]
G -->|No| I{Has WORKSPACE_ID?}
I -->|Yes| J[Fallback to WORKSPACE_ID]
I -->|No| K[Error: Missing Config]
J -->|Populate both keys| L[Runtime Config]
H -->|Populate both keys| L
L --> M[broker-bridge.mjs]
M -->|brokerOrgId variable| N[Wire Protocol]
N -->|Outbound: sends both org_id and workspace_id| O[Broker API]
N -->|Inbound: accepts org_id or workspace_id| P[Envelope Verification]
P -->|Uses routing ID for signature| Q[Message Processing]
style C fill:#e1f5ff
style L fill:#e1f5ff
style N fill:#fff4e1
style P fill:#e7ffe1
Last reviewed commit: 6933b0c |
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.
Summary
--org-id)--workspace-idas a backward-compatible alias and keep legacy env aliases populated for migrationorg_idandworkspace_idon wire calls, and accept either on inbound envelopesValidation
npm run lint:jsnpm run test:jsnpm run lint:shellnpm run test:shellnpm testImportant Follow-up (Server)
This PR is the client/runtime compatibility layer. A broker server PR is still required to complete the migration:
org_idas canonical for/api/register,/api/inbox/pull,/api/inbox/ack, and/api/sendworkspace_idcompatibility during rollout