Skip to content

Conversation

@MichaelMure
Copy link
Member

@MichaelMure MichaelMure commented Dec 4, 2025

The spec should be clarified before merging this.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for self-signed invocations where the issuer and subject are the same entity. This allows invocations to be executed without requiring delegation proofs when the invoker is acting on itself.

Key changes:

  • Added NewSelfSigned constructor for creating self-signed invocations
  • Modified proof verification logic to allow self-signed invocations (issuer == subject) without proofs
  • Added IsSelfSigned() helper method to check if an invocation is self-signed

Reviewed changes

Copilot reviewed 11 out of 17 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
token/invocation/invocation.go Added NewSelfSigned constructor and IsSelfSigned method; improved error message for issuer parsing
token/invocation/proof.go Updated proof verification to allow self-signed invocations without proofs; updated documentation comments
token/invocation/invocation_test.go Refactored tests to table-driven format; added test cases for self-signed invocations
token/invocation/schema_test.go Updated test to use embedded full example data and renamed constants for clarity
token/invocation/testdata/*.dagjson Added new test data files for self-signed and full example invocations
token/delegation/delegation.go Improved error message for issuer parsing (consistency)
token/delegation/delegationtest/token_gen.go Added self-delegation test tokens for all personas
token/delegation/delegationtest/generator/*.go Added generator logic for self-delegations
token/delegation/delegationtest/data/*.dagcbor Added binary test data for self-delegation tokens

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// d. The public key can be extracted from the `did:key`.
// e. The public key type is supported by go-ucan.
// c. The Payload contains an iss field that contains a valid DID.
// d. One or more public keys can be derived from the DID.
Copy link
Collaborator

Choose a reason for hiding this comment

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

More than one public key?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, method other than did:key can resolve to multiple public keys at the same time. So go-ucan try to find one matching the signature.

@smoyer64 smoyer64 self-requested a review December 8, 2025 13:05
Copy link
Collaborator

@smoyer64 smoyer64 left a comment

Choose a reason for hiding this comment

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

As written, none of the tests are passing (and oddly look like they're timing out)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 19 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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