Skip to content

feat: validate indexer claim/cache delegation - #188

Draft
alanshaw wants to merge 1 commit into
mainfrom
feat/validate-claim-cache-delegation
Draft

feat: validate indexer claim/cache delegation#188
alanshaw wants to merge 1 commit into
mainfrom
feat/validate-claim-cache-delegation

Conversation

@alanshaw

@alanshaw alanshaw commented Aug 12, 2025

Copy link
Copy Markdown
Member

This PR adds a validation method for the configured delegation that enables piri nodes to cache claims with the indexer.

The delegation is validated at server startup to prevent failures from occurring after data is stored on the node.

The delegation is validated by calling the ucanto validator Access method with a dummy invocation.

}, nil
}

func validateClaimCacheDelegation(ctx context.Context, id ucan.Signer, serviceID ucan.Principal, proofs []delegation.Proof, options ...principalresolver.Option) error {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between a principal.Signer and ucan.Signer? It looks like principal.Signer is a ucan.Signer, plus some other methods? Would it be possible to align on just a single interface here and everywhere else?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only need something that can sign a message here, we don't need the other methods that signers that are principals also have (like accessing the DID or encoding the key to bytes etc.).

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