mafintosh / hyperdb

Distributed scalable database
MIT License
752 stars 75 forks source link

Unauthorized feed returns true on 'authorized' API #77

Closed hackergrrl closed 6 years ago

hackergrrl commented 6 years ago

A failing test to plug into the hyperdb test suite:

tape('unauthorized writer passes "authorized" api', function (t) {
  var hyperdb = require('..')
  var ram = require('random-access-memory')

  var a = hyperdb(ram, {valueEncoding: 'utf-8'})
  a.ready(function () {
    var b = hyperdb(ram, a.key, {valueEncoding: 'utf-8'})
    b.ready(function () {
      t.equals(b.authorized(b.local.key), false)
      t.end()
    })
  })
})
mafintosh commented 6 years ago

@noffle think this got fixed right? if not reopen