Fork of github.com/did-method-plc/did-method-plc
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor did:key check to reuse extractMultikey util logic

+6 -3
+6 -3
packages/server/src/constraints.ts
··· 1 1 import { DAY, HOUR, cborEncode } from '@atproto/common' 2 2 import * as plc from '@did-plc/lib' 3 3 import { ServerError } from './error' 4 - import { parseDidKey } from '@atproto/crypto' 4 + import { extractMultikey, parseDidKey } from '@atproto/crypto' 5 5 6 6 const MAX_OP_BYTES = 4000 7 7 const MAX_AKA_ENTRIES = 10 ··· 111 111 `Verification Method id too long (max ${MAX_ID_LENGTH}): ${id}`, 112 112 ) 113 113 } 114 - // perform only minimal did:key syntax checking 115 - if (!key.startsWith('did:key:')) { 114 + try { 115 + // perform only minimal did:key syntax checking, with no restrictions on 116 + // key types 117 + extractMultikey(key) 118 + } catch (err) { 116 119 throw new ServerError(400, `Invalid verificationMethod key: ${key}`) 117 120 } 118 121 }