Repository navigation
fix(typescript): accept case-insensitive DID fingerprints in verifyPeer - #3375
Dhinesh Ponnarasan (DhineshPonnarasan) wants to merge 2 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
🤖 AI Agent: breaking-change-detector — API Compatibility
API CompatibilityNo breaking changes detected. |
🤖 AI Agent: docs-sync-checker — Docs Sync
Docs Sync
|
🤖 AI Agent: security-scanner — View details
No security issues found. |
🤖 AI Agent: test-generator — `agent-governance-typescript/src/trust.ts`
|
🤖 AI Agent: code-reviewer — View details
TL;DR: 0 blockers, 0 warnings. The changes improve DID fingerprint validation and add comprehensive tests; no issues found.
No issues found. Clean change. |
PR Review Summary
Verdict: AI review comments are untrusted advisory output. The summary reports workflow-generated completion status only, not model-authored pass/fail claims. |
|
🟡 Contributor Check: MEDIUM
Automated check by AGT Contributor Check. |
|
Gentle nudge: this PR has been open without a code-owner review for more than 3 business days. MohammadHaroonAbuomar liamcrumm could one of you take a look when you have a moment? Thanks. |
MohammadHaroonAbuomar
left a comment
There was a problem hiding this comment.
- agent-governance-typescript/src/trust.ts:162: prefer canonical-form rejection over comparison widening: generate() only emits lowercase fingerprints, and accepting case variants creates alias DIDs that pass verifyPeer while dodging registries/deny-lists/revocation keyed on the exact string (identity.ts:420,438). Drop the /i flag (reject non-canonical) or normalize at construction like .NET's NormalizeDid.
- DCO fails at head; cspell needs the PR's own test string
nothex(or rename it).
Minor:
- adjacent pre-existing, tracking issues: TS verifyPeer is self-attesting (the .NET sibling hard-deprecated this); loadFromDisk swallows corrupt trust records and a forged future lastUpdate pins scores forever.
MohammadHaroonAbuomar
left a comment
There was a problem hiding this comment.
- agent-governance-typescript/src/trust.ts:162: prefer canonical-form rejection over comparison widening: generate() only emits lowercase fingerprints, and accepting case variants creates alias DIDs that pass verifyPeer while dodging registries/deny-lists/revocation keyed on the exact string (identity.ts:420,438). Drop the /i flag (reject non-canonical) or normalize at construction like .NET's NormalizeDid.
- DCO fails at head; cspell needs the PR's own test string
nothex(or rename it).
Minor:
- adjacent pre-existing, tracking issues: TS verifyPeer is self-attesting (the .NET sibling hard-deprecated this); loadFromDisk swallows corrupt trust records and a forged future lastUpdate pins scores forever.
|
Several requests remain unaddressed for over a week, so I'm closing the PR. Feel free to reopen once they're addressed. |
Summary
Fix TypeScript peer verification to accept valid DID fingerprints regardless of hex letter casing while preserving existing fingerprint integrity checks.
Problem
DID fingerprint validation allowed uppercase and mixed-case hex, but the equality check compared against a lowercase digest value without normalizing the DID fingerprint. This could incorrectly reject valid identities when the DID used uppercase or mixed-case hex.
Changes
agent-governance-typescript/src/trust.tsdidFingerprintwithtoLowerCase()before comparing to the SHA-256 hex-derivedexpectedFingerprint.agent-governance-typescript/tests/trust.test.tsTesting
cd agent-governance-typescriptnpm test -- trust.test.tscloses #3374