dweb-secret-storage

1.0.0 • Public • Published

dweb-secret-storage

Store secret keys for dwebfs archives in the user's home directory.

npm travis standard

Install

npm install dweb-secret-storage

Usage

Return for the secret_key storage in dwebfs/ddatabase. To avoid local ownership conflicts, pass the local directory as the first argument. dweb-secret-storage will check for a non-empty ownership file in the source directory storage.

var secretStore = require('dweb-secret-storage')
 
var storage = {
  metadata: function (name, opts) {
    if (name === 'secret_key') return secretStore()(path.join(dir, '.dweb/metadata.ogd'), opts)
    return // other storage
  },
  content: function (name, opts) {
    return // other storage
  }
}
 
// store secret key in ~/.dweb/secret_keys
var archive = dwebfs(storage)

API

secretStorage([dir])(ownershipFile, opts)

  • dir: directory to store keys under dir/.dweb/secret_keys. Defaults to users home directory.
  • ownershipFile: non-empty file that denotes ownership. This helps avoid local ownership conflicts of the same dweb.

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i dweb-secret-storage

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

4.12 kB

Total Files

6

Last publish

Collaborators

  • shikhars3711