Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

hyperdrive storage module for dat secret keys [ DEPRECATED - More info on active projects and modules at https://dat-ecosystem.org/ ]

License

Notifications You must be signed in to change notification settings

dat-ecosystem-archive/dat-secret-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deprecated

More info on active projects and modules at dat-ecosystem.org


dat-secret-storage

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

npm travis standard

Install

npm install dat-secret-storage

Usage

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

var secretStore = require('dat-secret-storage')

var storage = {
  metadata: function (name, opts) {
    if (name === 'secret_key') return secretStore()(path.join(dir, '.dat/metadata.ogd'), opts)
    return // other storage
  },
  content: function (name, opts) {
    return // other storage
  }
}

// store secret key in ~/.dat/secret_keys
var archive = hyperdrive(storage)

API

secretStorage([dir])(ownershipFile, opts)

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

License

MIT

About

hyperdrive storage module for dat secret keys [ DEPRECATED - More info on active projects and modules at https://dat-ecosystem.org/ ]

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •