Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
dholms committed Mar 5, 2024
1 parent f6238fa commit 15c4d0a
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions packages/bsky/tests/admin/admin-auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,31 @@ describe('admin auth', () => {
bskyDid = network.bsky.ctx.cfg.serverDid

modServiceKey = await Secp256k1Keypair.create()
const origResolve = network.bsky.ctx.idResolver.did.resolveAtprotoKey
network.bsky.ctx.idResolver.did.resolveAtprotoKey = async (

const origResolve = network.bsky.ctx.idResolver.did.resolve
network.bsky.ctx.idResolver.did.resolve = async function (
did: string,
forceRefresh?: boolean,
) => {
) {
if (did === modServiceDid || did === altModDid) {
return modServiceKey.did()
return {
'@context': [
'https://www.w3.org/ns/did/v1',
'https://w3id.org/security/multikey/v1',
'https://w3id.org/security/suites/secp256k1-2019/v1',
],
id: did,
verificationMethod: [
{
id: `${did}#atproto`,
type: 'Multikey',
controller: did,
publicKeyMultibase: modServiceKey.did().replace('did:key:', ''),
},
],
}
}
return origResolve(did, forceRefresh)
return origResolve.call(this, did, forceRefresh)
}

agent = network.bsky.getClient()
Expand Down

0 comments on commit 15c4d0a

Please sign in to comment.