Skip to content

feat: add PackageTrustLink.status for Public Secure link state (W-23970571) - #920

Open
sshyamala-sfdc wants to merge 3 commits into
packaging-distribution/spifrom
prerelease/t/packaging-distribution/w-23970571/trust-link-status
Open

feat: add PackageTrustLink.status for Public Secure link state (W-23970571)#920
sshyamala-sfdc wants to merge 3 commits into
packaging-distribution/spifrom
prerelease/t/packaging-distribution/w-23970571/trust-link-status

Conversation

@sshyamala-sfdc

Copy link
Copy Markdown
Collaborator

What & Why

Implements the library side of sf package trust link status (W-23970571, SPI / Public Secure).

Adds a read-only PackageTrustLink.status() that reports the connected authoring org's Public Secure (VerifiedDev) trust-link state so the developer can see where a link stands in the two-way handshake. Trust and enforcement remain decoupled — this never mutates anything.

Behavior

Queries the authoring org's single PkgVrfyAuthOrgTrustRela record (the Tooling API query is scoped to the connected org, so it isn't filtered by verified org):

  • No record{ Status: 'Not Linked', linked: false }.
  • Record present → its Status (Pending, Accepted, Declined, Revoked, or Failed), linked: true, the link Id, verified org ID, and only the timestamps that are set: RequestedDate (record CreatedDate), EstablishedDate, RevokedDate. Unset timestamps are omitted so --json stays clean.

Files

  • src/package/packageTrustLink.ts — new status() method; shared query extended with EstablishedDate, RevokedDate, CreatedDate.
  • src/interfaces/packagingInterfacesAndType.ts — new PackageTrustLinkStatusResult type.
  • test/package/packageTrustLink.test.ts — 5 unit tests.

Testing

yarn build (compile + lint) clean; PackageTrustLink unit suite 10 passing (Not Linked, full timestamps, Pending timestamp-omit, Revoked, query-not-scoped-by-verified-org).

Related

Sibling verbs of sf package trust link: request (merged), unlink (#919). Companion plugin PR (the sf package trust link status command) pins the prerelease published from this branch.

sshyamala-sfdc and others added 3 commits August 27, 2026 20:55
…70571)

Add a read-only status method that reports the connected authoring org's
Public Secure (VerifiedDev) trust-link state — Not Linked when no link
exists, otherwise the link's status (Pending/Accepted/Declined/Revoked/
Failed) with the relevant timestamps (requested/established/revoked).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… prerelease/t/packaging-distribution/w-23970571/trust-link-status

# Conflicts:
#	src/interfaces/packagingInterfacesAndType.ts
#	src/package/packageTrustLink.ts
#	test/package/packageTrustLink.test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants