refactor(capabilities/pdp): add pdp capabilities#22
Closed
frrist wants to merge 3 commits into
Closed
Conversation
capabilities/pdp/types.go imports github.com/fil-forge/libforge/merkletree for the InclusionProof field but that package did not exist, so go build ./... failed. Restore the package as a thin wrapper around github.com/filecoin-project/go-data-segment/merkletree.ProofData (the canonical implementation we already depend on elsewhere). CBOR is delegated to the upstream type via a zero-cost named-type conversion; DagJSON marshalers are added here because the upstream lacks them. No port of the merkletree algorithm itself. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Mirrors the go-libstoracha access.Grant shape with UCAN 1.0 framing: - Arguments carry an Attenuations list (capabilities the agent wishes to be granted) and an optional Cause CID. cid.Undef on Cause means no cause. - OK aliases ClaimOK — a successful grant resolves into a bundle of delegation CIDs. Delegation envelopes themselves ride in the receipt response container as metadata, following the libforge pattern used by /access/claim and /access/confirm. - Stable receipt failure names match the go-libstoracha originals so existing callers can keep their error matching. This unblocks piri-signing-service's UCAN 1.0 migration: that service gates all /pdp/sign/* abilities behind an /access/grant delegation and needs a libforge binding to switch off go-libstoracha. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
8a1986c to
5c35394
Compare
alanshaw
requested changes
May 20, 2026
| "github.com/fil-forge/ucantone/errors" | ||
| ) | ||
|
|
||
| const GrantCommand = "/access/grant" |
Member
There was a problem hiding this comment.
This string is inlined into the MustNew call for all other commands.
Member
There was a problem hiding this comment.
Needs a rebase - these are in commands dir now.
|
|
||
| // MarshalDagJSON writes the proof as a DagJSON map: {"path": [<bytes>...], "index": N}. | ||
| // Path nodes use DagJSON's canonical bytes encoding ({"/": {"bytes": "<base64>"}}). | ||
| func (p *ProofData) MarshalDagJSON(w io.Writer) error { |
Member
Author
|
closing in favor of #28 |
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.
No description provided.