Skip to content

Commit

Permalink
Fix support for tribes.create
Browse files Browse the repository at this point in the history
  • Loading branch information
Powersource committed Nov 21, 2023
1 parent 50a6aa2 commit d845c64
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ module.exports = {
const [input, cb] = args

if (
input.encryptionFormat !== undefined ||
isEncrypted(input.content) ||
(hasRecps(input.content) && !isAllowPublic2(input)) ||
allowedTypes.has(input.content.type)
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
"homepage": "https://github.com/ssbc/ssb-recps-guard#readme",
"devDependencies": {
"scuttle-testbot": "^2.2.0",
"ssb-box": "^1.0.1",
"ssb-box2": "^7.4.0",
"ssb-classic": "^1.1.0",
"ssb-config": "^3.4.6",
"ssb-db2": "github:cooldracula/ssb-db2#add-hook",
"ssb-private1": "^1.0.1",
"ssb-tribes": "github:ssbc/ssb-tribes#pass-along-publish-opts",
"tap-spec": "^5.0.0",
Expand Down
3 changes: 2 additions & 1 deletion test/db2.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ test('db2', async t => {
test('can create a group', async t => {
const server = Server({db1: false})

await p(server.tribes.create)({})
const group = await p(server.tribes.create)({})
t.equal(typeof group.groupId, 'string', 'created group with groupId')

await p(server.close)()
})
9 changes: 8 additions & 1 deletion test/test-bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,19 @@ module.exports = function (opts = {}) {
})
}
return Server // eslint-disable-line
.use(require('ssb-db2/core'))
.use(require('ssb-classic'))
.use(require('ssb-box'))
.use(require('ssb-box2'))
.use(require('ssb-db2/compat'))
.use(require('ssb-db2/compat/feedstate'))
.use(require('ssb-tribes'))
.use(require('../')) // ssb-recps-guard
.call(null, {
box2: {
legacyMode: true
},
...opts
...opts,
noDefaultUse: true
})
}

0 comments on commit d845c64

Please sign in to comment.