Repository navigation
feat(spec): ConnectorConnectionState declares redirectUri, the derived OAuth redirect URI - #29618
Conversation
…d OAuth redirect URI Claude-Session: https://claude.ai/code/session_01JQwxbXFQf118bS56KJqpQj Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 168 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin e63f91b5642688d387d68af28a56b5f1aeac431e && git checkout e63f91b5642688d387d68af28a56b5f1aeac431e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0bfb225e4d6b359d8481ec3f5351221c634ed35c 555302a1f39e04e55cb8e140ef312a477e2d5f19 && git checkout -B drift-repro 0bfb225e4d6b359d8481ec3f5351221c634ed35c && git merge --no-ff 555302a1f39e04e55cb8e140ef312a477e2d5f19
node scripts/docs-audit/affected-docs.mjs --json 0bfb225e4d6b359d8481ec3f5351221c634ed35c
|
|
domain:spec#5 · os-warren · session_01JQwxbWR3K3h7i1ytwycVg1 Contract-review-claim: session_01JQwxbWR3K3h7i1ytwycVg1 · head 555302a · 2026-11-02T21:59Z The seat runs the at-tier review (a widening of |
|
domain:spec#5 · os-warren · session_01JQwxbWR3K3h7i1ytwycVg1 Contract reviewServed-tier: Inputs read: card #29574 (body, triage 6586696710, Claim 6587703954, dev report 6589522107); ruling B on #28702 (6566728470) in place; route ruling 6585200349 on #29463 and that card's body; #28869's body and its blocked report 6581473243; the ① Derived judgments
② Semver levelThe changeset is ③ Boundary flags
④ Design judgmentJudged on the
Findings.
Implemented-by: VERDICT: PASS |
|
domain:spec#5 · os-warren · session_01JQwxbWR3K3h7i1ytwycVg1 维护者速读
席位核对ACCEPT ·
|
Requested by Warren · project thread
Fixes #29574
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
ConnectorConnectionState新增一个可选只读键redirectUri,承载本部署推导出的 OAuth 回调地址;只改 spec 契约,不改服务端。clientIdis fixed by the package and the redirect URI is per deployment #28702 裁决 B),Console 的连接步骤需要在有 client 之前就显示它;此前没有任何回答带它。packages/spec/src/contracts/automation-service.ts(新键及 TSDoc)、packages/spec/src/contracts/connector-connection-redirect-uri.pin.test.ts、.changeset/29574-connector-redirect-uri.md。pnpm --filter @objectstack/spec exec vitest run src/contracts/connector-connection-redirect-uri.pin.test.ts,预期 2 passed。redirectUri(或改选下方 Open questions 里的其它拼法);批准原文须引入本 PR 正文后才能入队。What changes
ConnectorConnectionState(@objectstack/spec/contracts,packages/spec/src/contracts/automation-service.ts) declares one optional key,redirectUri?: string: the absolute URL ofGET /api/v1/automation/connectors/oauth/callbackthat the administrator registers with the vendor's OAuth client. Its TSDoc states:connectorOAuthRedirectUrioption, else that path underOS_AUTH_URL, else underOS_BASE_URL(the chainServiceAutomationPlugin.connectorOAuthRedirectUri()already implements).getConnectorConnection's answer whenever the server can derive it, whateverstatussays.503), never guessed from the request's origin; and for every grant other thanauthorization_code, structurally, since only anauthorization_codeinstance has a connection (the door refuses any other400).Blocked-bythis card), no answer carries it. connector connection state: answer the derived OAuth redirect URI so the Console can show it before an installer registers a client #29463's PR deletes that sentence when it lands.No server change, no docs change (the card leaves
content/docs/automation/connectors.mdxto #29463), noapi/protocol.zod.ts/identity/protocol.ts/ metadata-protocolprotocol.tsedit (freeze until 2026-11-03 06:00Z). The interface has no Zod wire mirror inpackages/spec/src/api/, so no schema or generated reference moves.Why
#28702 ruling B (6566728470) has each deployment's administrator register their own OAuth client against this deployment's callback, and asks the Console's Connect step (#28869) to show that exact URI with a copy button. The server derives it but answers it nowhere a client can read before a client exists. Split from #29463 on route ruling 6585200349; triage 6586696710 (p1).
Open questions
redirectUri. Reasoning, by the method theclientruling 6580268872 used (reuse the words the contract layer already uses for the concept):redirect_uriparameter, camelCased per the config-key rule.redirectUri: the plugin optionconnectorOAuthRedirectUri, and the request fields ofservices/service-automation/src/oauth2-grant/authorization.tsandmcp-authorization.ts. The vendor consoles an administrator pastes it into call it "Redirect URI".redirectUrl: in the spec that word is the action handler-return navigation convention ({ redirectUrl, openIn? },ui/action.zod.ts), a different concept a reader would conflate.callbackUrl: no precedent in the spec, and it names the route rather than the OAuth term the vendor asks for.client.redirectUri:clientis absent until the installer enters one, which is exactly when the URI is needed.redirectUrionce named an inline key of the retiredConnectorOAuth2Schema(connector.authentication, migration entryconnector-auth-config-oauth2-retired). That was an authorable metadata key; this is a read-only answer field on a service contract, never authored, so nothing collides with that retirement.redirectUri(recommended, for the reasons above) · BcallbackUrl· CredirectUrl.Tests
packages/spec/src/contracts/connector-connection-redirect-uri.pin.test.ts, compiled bycheck:test-typecheckundertsconfig.test.json: the key is exactlystring | undefinedand optional;ConnectorConnectionRequesthas no such key; every prior key of the state keeps its type; a structured value does not compile (@ts-expect-error); the TSDoc names the callback path, the derivation chain and both absence conditions.number(scripts/ablation-replace.mjs),check:test-typecheckwent red with "2 type error(s)" in the pin file; restored blob equals HEAD (31cf455e60bc).Acceptance notes
readonlymodifier: "read-only" here means no request carries it (pinned); the interface's sibling keys carry none either.Metadata-protocol: none:ConnectorConnectionStateis a service answer, not something a metadata author writes.Clause-②: yes (widening): the published contract gains a key.Verification
All readings at head
555302a1f(this branch merged withorigin/mainat the time of the run), inobjectstack-ai/objectstack:pnpm --filter @objectstack/spec build:: exit 0 (lock VERDICT command-exit 0).pnpm --filter @objectstack/spec check:generated:: exit 0, "All 14 generated artifacts are up to date"; nothing regenerated, nothing committed (the interface has no Zod mirror, and the api-surface rowConnectorConnectionState (interface)names the interface, not its members).pnpm --filter @objectstack/spec test:: exit 0, Test Files 802 passed (802), Tests 23700 passed, 1 todo.pnpm --filter @objectstack/spec typecheck:: exit 0 (includescheck:test-typecheck, which compiles the new pin).node scripts/pm/dispatch-gates.mjs --commands: 79 derived families; all 79 run, each exit 0;--ranreconciliation: "79 derived famil(ies) accounted for — 79 run, 0 NOT-MEASURED". Prerequisite builds:turbo run build --filter=@objectstack/formula --filter=@objectstack/lint --filter=@objectstack/objectql, andgit fetch origin 621a4876for the teardown-shape self-test's pinned control.!in the title, no(narrowing)arm).Human Minimum
packages/specholds no runtime logic. (A contract interface with no Zod mirror, as its siblings.)pnpm lintpasses. (Repo-wide lint is CI's.)main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (check:generated: all 14 up to date, nothing moved.)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code
Maintainer approval
Warren approved the key name
redirectUri(onConnectorConnectionState, option A;callbackUrlandredirectUrlwere not taken) on 2026-11-03 at 00:08 UTC. He chose 「全部批准」 on decision card cmsg_01U5RdnAAmkSQmZbqh6FtqZ8Rr7w8AxYJLZP6jP9v41T4n, whose question was 「六个命名/措辞全部按推荐批准吗?」, in the project thread "Decide pending spec name approvals". The post above that card recommendedredirectUrias spelled.