Skip to content

Conversation

@alanshaw
Copy link
Member

@alanshaw alanshaw commented Aug 12, 2025

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
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
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.

3 participants