feat: add PackageTrustLink.status for Public Secure link state (W-23970571) - #920
Open
sshyamala-sfdc wants to merge 3 commits into
Conversation
…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
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.
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
PkgVrfyAuthOrgTrustRelarecord (the Tooling API query is scoped to the connected org, so it isn't filtered by verified org):{ Status: 'Not Linked', linked: false }.Status(Pending,Accepted,Declined,Revoked, orFailed),linked: true, the link Id, verified org ID, and only the timestamps that are set:RequestedDate(recordCreatedDate),EstablishedDate,RevokedDate. Unset timestamps are omitted so--jsonstays clean.Files
src/package/packageTrustLink.ts— newstatus()method; shared query extended withEstablishedDate,RevokedDate,CreatedDate.src/interfaces/packagingInterfacesAndType.ts— newPackageTrustLinkStatusResulttype.test/package/packageTrustLink.test.ts— 5 unit tests.Testing
yarn build(compile + lint) clean;PackageTrustLinkunit 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 (thesf package trust link statuscommand) pins the prerelease published from this branch.