Skip to content

fix(did): accept legacy did:web documents without assertionMethod, temporarily - #50

Merged
sumitvekariya merged 1 commit into
mainfrom
fix/legacy-did-web-documents
Oct 24, 2026
Merged

sumitvekariya merged 1 commit into
mainfrom
fix/legacy-did-web-documents

Conversation

@sumitvekariya

@sumitvekariya sumitvekariya commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Records signed by institutions that still host an older did.json fail here:

FAIL institutional_identity: did:web:<institution>#key-1 is not authorized by assertionMethod

Until 2026-06-30 the GAMI portal generated did:web documents without assertionMethod, with Ed25519VerificationKey2020 keys as bare publicKeyHex listed under authentication. The hosted verifier passes these records under its legacy rule (gami-app src/lib/did-resolve.ts, isAuthorizedForAssertion), so the CLI and the hosted verifier disagree on the same record.

This PR copies that rule into the CLI as a temporary measure:

  • It applies only to did:web documents that declare no assertionMethod at all. A present assertionMethod, even an empty one, keeps the strict rule.
  • The record's key id must be listed under authentication, and the verificationMethod with that id must be an Ed25519VerificationKey2020 given as bare publicKeyHex holding exactly the record's embedded key. A matching id alone is not enough, any other key encoding fails, and the rule refuses to run without an embedded key.
  • The PASS message says the temporary legacy rule was used and that the institution should re-publish.

Removal: once the remaining institutions re-publish their DID documents from the portal, delete isLegacyDocument, decodeLegacyKey, findLegacyMethod and the temporary legacy rule tests.

Checked: pnpm compile, pnpm lint, pnpm format and pnpm test (64/64, eight new). With live DID resolution, a record signed under such a document now passes all five checks; records from documents with assertionMethod are unchanged.

Release note: package.json on main says 0.4.0, while npm has 0.4.1 and the v0.5.0 tag points at a commit whose package.json says 0.4.0. The release workflow's tag check would refuse that tag, which may be why 0.5.0 never reached npm. Releasing this needs a version bump on main first.

@sumitvekariya
sumitvekariya deployed to standalone-preview October 24, 2026 05:58 — with GitHub Actions Active
@sumitvekariya
sumitvekariya deployed to standalone-preview October 24, 2026 05:58 — with GitHub Actions Active
@sumitvekariya
sumitvekariya deployed to standalone-preview October 24, 2026 05:58 — with GitHub Actions Active
@sumitvekariya
sumitvekariya deployed to standalone-preview October 24, 2026 06:00 — with GitHub Actions Active
@sumitvekariya
sumitvekariya deployed to standalone-preview October 24, 2026 06:00 — with GitHub Actions Active
@sumitvekariya
sumitvekariya deployed to standalone-preview October 24, 2026 06:00 — with GitHub Actions Active
@sumitvekariya
sumitvekariya deployed to standalone-preview October 24, 2026 06:00 — with GitHub Actions Active
@sumitvekariya
sumitvekariya deployed to standalone-preview October 24, 2026 06:00 — with GitHub Actions Active
…mporarily

Until 2026-06-30 the GAMI portal generated did:web documents without
assertionMethod, with Ed25519VerificationKey2020 keys as bare publicKeyHex
listed under authentication. Institutions still hosting such a document
fail institutional_identity here, while the hosted verifier passes them
under its legacy rule.

Mirror that rule for did:web documents of exactly that shape: no
assertionMethod at all, the record's key id listed under authentication,
and a verificationMethod with that id holding exactly the record's
embedded key as bare publicKeyHex. An assertionMethod that is present,
even empty, keeps the strict rule. The result says the legacy rule was
used. Remove it once the remaining institutions re-publish.
@sumitvekariya
sumitvekariya force-pushed the fix/legacy-did-web-documents branch from f54b910 to 2f21241 Compare October 24, 2026 06:02
@sumitvekariya
sumitvekariya deployed to standalone-preview October 24, 2026 06:02 — with GitHub Actions Active
@sumitvekariya
sumitvekariya deployed to standalone-preview October 24, 2026 06:02 — with GitHub Actions Active
@sumitvekariya
sumitvekariya deployed to standalone-preview October 24, 2026 06:02 — with GitHub Actions Active
@sumitvekariya
sumitvekariya deployed to standalone-preview October 24, 2026 06:02 — with GitHub Actions Active
@sumitvekariya
sumitvekariya deployed to standalone-preview October 24, 2026 06:02 — with GitHub Actions Active
@sumitvekariya
sumitvekariya merged commit c04d5fe into main Oct 24, 2026
12 checks passed

This branch was successfully deployed

1 active deployment
standalone-preview — 2f212410 Deployed Oct 24, 2026 by sumitvekariya via windows / x64 #34
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.

1 participant