Skip to content

fix(client)!: the spec contract and the SDK direct-grant options state only what the door accepts #34034

Open

Description

@objectstack-fleet

security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f

Follow-up to PR #34031 (review record 6898513749, S2).

Rule: a share written through the direct-grant door is always a manual share. For a non-system caller, SharingService.grant answers VALIDATION_FAILED (REST 400) for any source other than 'manual' and for any sourceId.

Gap: the typed surface still offers what the service always refuses:

  1. Spec contract. The jsdoc on ISharingService.grant in packages/spec/src/contracts/sharing-service.ts lists the non-system refusals but not this one. Add it at the rule level. This is jsdoc only, with no type change: GrantShareInput keeps both fields because the system path uses them.
  2. Client SDK. The shares.grant options in packages/client/src/index.ts declare source?: string and sourceId?: string. The SDK is never the system context, so every SDK caller that sets either is refused. Drop sourceId, and type source as 'manual' or remove it. This is a breaking type change in @objectstack/client with its own changeset and "Who moves".

Leaving the types as they are and documenting the rule only in TSDoc is not recommended: an option that is declared but always refused invites the wrong call.

Size S. Lands after PR #34031.

Activity

  1. changed the title [-]fix(client)!: the SDK direct-grant options name only what the door accepts[/-] [+]fix(client)!: the spec contract and the SDK direct-grant options state only what the door accepts[/+] on Nov 15, 2026
  2. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → domain:spec · p3 · 2026-11-15T17:49Z

    ⛔ Not a claim.

    The ISharingService.grant contract and the SDK's direct-grant options still offer a source other than 'manual' and a sourceId, which the door always refuses for a non-system caller. Narrowing the published types (fix(client)!) matches what the door accepts and stops developers writing calls that can only fail. p3.

  3. added
    domain:spec
    pm:queue
    on Nov 15, 2026
  4. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

    Recorded 2026-11-19T06:28Z.

    Ruled: narrow now (option A) · maintainer Sales (os-sales), on a decision card answered at 2026-11-19T06:26Z in this account's fleet project (thread 「开 objectstack 座位接 area:build」), verbatim option chosen: 「现在收窄」 — "删 sourceId,source 类型收为 'manual',fix(client)! 破坏性 PR;objectstack 与 hotcrm 实测零调用方。"

    • Scope = both halves of this card as written: (1) the jsdoc rule on ISharingService.grant in packages/spec/src/contracts/sharing-service.ts (no type change; GrantShareInput keeps both fields for the system path); (2) @objectstack/client shares.grant options: drop sourceId, type source as 'manual', own changeset with "Who moves".
    • Evidence read at origin/main 24cc61f: client declares both at packages/client/src/index.ts:7247-7248; the service refuses both for non-system callers at packages/plugins/plugin-sharing/src/sharing-service.ts:202-213; zero non-test shares.grant( callers in objectstack and hotcrm. Precedent: fix(plugin-sharing)!: a share granted directly by a non-system caller is always a manual share #34031.
    • Area: area:build → area:data (North Star boundary: data and permissions inside the application). Stays in pm:queue for the seat that takes area:data cards.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:datadomain:specpm:queuepriority:p3

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions