Skip to content

Commit

Permalink
drop validation of recps when encrypting metafeed/add
Browse files Browse the repository at this point in the history
  • Loading branch information
staltz committed Nov 3, 2022
1 parent ac7a6f3 commit d894b1e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
5 changes: 0 additions & 5 deletions api.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ exports.init = function (sbot, config = {}) {

const { keys, seed } = metafeed
const { purpose, feedFormat, metadata, recps, encryptionFormat } = details
if (recps && (recps.length !== 1 || !isCloakedMsgId(recps[0]))) {
return cb(
new Error('metafeed encryption currently only supports groupId')
)
}

const opts = sbot.metafeeds.messages.optsForAddDerived(
keys,
Expand Down
32 changes: 0 additions & 32 deletions test/api/advanced/find-or-create.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,35 +204,3 @@ test('advanced.findOrCreate (encryption - GroupId)', (t) => {
})
})
})

test('advanced.findOrCreate (encryption - FeedId)', (t) => {
const sbot = Testbot()

const ownKey = Buffer.from(
'30720d8f9cbf37f6d7062826f6decac93e308060a8aaaa77e6a4747f40ee1a76',
'hex'
)
sbot.box2.setOwnDMKey(ownKey)

sbot.metafeeds.advanced.findOrCreate((err, mf) => {
if (err) t.error(err, 'no err')

sbot.metafeeds.advanced.findOrCreate(
mf,
(f) => f.purpose === 'private',
{
purpose: 'private',
feedFormat: 'classic',
recps: [sbot.id],
encryptionFormat: 'box2',
},
(err, f) => {
t.match(
err.message,
/metafeed encryption currently only supports groupId/
)
sbot.close(true, t.end)
}
)
})
})

0 comments on commit d894b1e

Please sign in to comment.