feat(connector): add organization auth identity to run#274
Conversation
The business layer introduced organizations: a user can belong to multiple orgs and authenticate as one. `oo connector run` now picks the run identity via `--organization` (alias `--org`), an `identity.organization` config default, or `--personal` to force the personal identity. Precedence is flag, then config, then personal. Only the action run request carries the identity (an `organization` query parameter plus an `x-oo-organization` header). The schema metadata request and its cache stay identity-free because the action schema is identity-independent. Telemetry records only a privacy-safe `identity_source` enum, never the organization name. Signed-off-by: Kevin Cui <bh@bugs.cc>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (14)
Summary by CodeRabbit
WalkthroughThis PR adds organization identity support to connector execution. Users can now run connector actions under a named organization identity via Sequence DiagramsequenceDiagram
participant User
participant CliHandler
participant IdentityResolver
participant ConfigLoader
participant ActionExecutor
participant ConnectorEndpoint
User->>CliHandler: oo connector run --organization acme
CliHandler->>ConfigLoader: read identity.organization config
ConfigLoader-->>CliHandler: (returns undefined or config value)
CliHandler->>IdentityResolver: resolveConnectorIdentity({personalFlag, organizationFlag, configOrganization})
IdentityResolver-->>CliHandler: {identity: {organization: "acme"}, source: "flag"}
CliHandler->>ActionExecutor: runConnectorAction({identity, ...})
ActionExecutor->>ActionExecutor: applyConnectorIdentityToUrl(url, identity)
ActionExecutor->>ActionExecutor: connectorIdentityHeaders(identity)
ActionExecutor->>ConnectorEndpoint: POST /?organization=acme (with x-oo-organization header)
ConnectorEndpoint-->>ActionExecutor: response
ActionExecutor-->>CliHandler: result
CliHandler-->>User: output
Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
Comment |
The business layer introduced organizations: a user can belong to
multiple orgs and authenticate as one.
oo connector runnow picksthe run identity via
--organization(alias--org), anidentity.organizationconfig default, or--personalto force thepersonal identity. Precedence is flag, then config, then personal.
Only the action run request carries the identity (an
organizationquery parameter plus an
x-oo-organizationheader). The schemametadata request and its cache stay identity-free because the action
schema is identity-independent. Telemetry records only a privacy-safe
identity_sourceenum, never the organization name.