a collection of lightweight TypeScript packages for AT Protocol, the protocol powering Bluesky
atproto bluesky typescript npm

feat(did-plc): add new limits for verificationMethods

mary.my.id 1bdc0bdd 1f7e06e0

verified
Changed files
+20
.changeset
packages
identity
did-plc
+5
.changeset/nine-doodles-pull.md
··· 1 + --- 2 + '@atcute/did-plc': patch 3 + --- 4 + 5 + add new limits for verificationMethods
+15
packages/identity/did-plc/lib/typedefs.ts
··· 92 92 return v.ok(input); 93 93 }), 94 94 verificationMethods: v.record(permissiveDidKeyString).chain((input) => { 95 + const length = Object.keys(input).length; 96 + 97 + if (length > 10) { 98 + return v.err(`too many verification method entries (max 10)`); 99 + } 100 + 95 101 for (const id in input) { 102 + const key = input[id]; 103 + 96 104 if (id.length > 32) { 97 105 return v.err({ 98 106 message: `verification method id too long (max 32 characters)`, 107 + path: [id], 108 + }); 109 + } 110 + 111 + if (key.length > 256) { 112 + return v.err({ 113 + message: `verification method key too long (max 256 characters)`, 99 114 path: [id], 100 115 }); 101 116 }