var pull = require('pull-stream')

module.exports = function (opts) {
  return {
    name: 'noauth',
    create: function (_opts) {
      return function (stream, cb) {
        stream.address = 'noauth'
        cb(null, {
          remote: '',
          auth: { allow: null, deny: null },
          source: stream.source,
          sink: stream.sink
        })
      }
    },
    parse: function (str) {
      return {}
    },
    stringify: function () {
      return 'noauth'
    }
  }
}






var pull = require('pull-stream')

module.exports = function (opts) {
  return {
    name: 'noauth',
    create: function (_opts) {
      return function (stream, cb) {
        cb(null, {
          remote: opts.keys.publicKey,
          auth: { allow: null, deny: null },
          source: stream.source,
          sink: stream.sink,
          address: 'noauth:' + opts.keys.publicKey.toString('base64')
        })
      }
    },
    parse: function (str) {
      return {}
    },
    stringify: function () {
      return 'noauth'
    }
  }
}

Make auth work, remote is needed