Skip to content

fix: fallback to verificationMethods if capabilityInvocation or capabilityDelegation silent#39

Merged
alanshaw merged 2 commits into
ash/feat/add-did-plc-parse-methodfrom
ash/fix/fallback-to-verificationMethods-if-relationships-silent
Jul 17, 2026
Merged

fix: fallback to verificationMethods if capabilityInvocation or capabilityDelegation silent#39
alanshaw merged 2 commits into
ash/feat/add-did-plc-parse-methodfrom
ash/fix/fallback-to-verificationMethods-if-relationships-silent

Conversation

@alanshaw

@alanshaw alanshaw commented Jul 13, 2026

Copy link
Copy Markdown
Member

If the document is silent about capabilityInvocation or capabilityDelegation then fallback to all verificationMethods, do not fail signature verification entirely.

Context: did:plc documents from the official DID PLC server do not carry these properties and so the signatures are currently unverifiable.

Copilot AI left a comment

Copy link
Copy Markdown

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 adjusts signature verification to treat capabilityInvocation / capabilityDelegation as optional: when a DID document is silent about those relationships, validation should fall back to using all verificationMethod entries instead of failing verification.

Changes:

  • Update token signature verification to fall back to verificationMethod entries when the relevant capability relationship is absent/empty.
  • Add tests covering successful verification against “plc-shaped” documents without capability relationships, plus regression coverage for nil relationship fields.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
validator/validator.go Implements fallback selection of verification methods when capability relationships are not expressed.
validator/validator_test.go Adds regression tests for relationship fallback behavior across invocation/delegation scenarios.

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

Comment thread validator/validator.go
Comment thread validator/validator.go
Comment thread validator/validator_test.go
- Fall back to verificationMethod only when the relationship is absent
  or empty, not when its entries fail to resolve — a populated
  relationship referencing missing methods must not widen authorization.
- Stop reusing err across verification-method loop iterations, which
  caused valid methods to be skipped after one unsupported VM type.
- Add test covering a relationship that references a missing method.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
alanshaw added a commit to fil-forge/sprue that referenced this pull request Jul 17, 2026
This PR allows `did:plc` accounts to provision spaces. This requires a
`did:plc` resolver.

Context: Hilt uses the `/customer/add` method to add it's tenants to
Sprue. Hilts tenants are `did:plc` addressed, so that their keys can be
rotated easily. Unfortunately the addition of `/customer/add` to Sprue
did not also include this change to allow the kinds of DID that were
going to be used (`did:plc`) to provision spaces. Hence this PR.

Depends on:

* fil-forge/ucantone#38
* fil-forge/ucantone#39
@alanshaw
alanshaw merged commit 13a00f8 into ash/feat/add-did-plc-parse-method Jul 17, 2026
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