kubo/plugin/keystore.go
Steven Allen bdb9e4e21a pluggable keystores
This patch allows keystores to be configured via the config and plugins.

It's completely untested for now, but I started this so I figured I'd get it to
a point where we could consider finishing it.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-03-11 15:30:27 -07:00

25 lines
641 B
Go

package plugin
import (
keystore "github.com/ipfs/go-ipfs/keystore"
prompt "github.com/ipfs/go-prompt"
)
// PluginKeystore is an interface that can be implemented to new keystore
// backends.
type PluginKeystore interface {
Plugin
// KeystoreTypeName returns the the keystore's type. In addition to
// loading the keystore plugin, the user must configure their go-ipfs
// node to use the specified keystore backend.
KeystoreTypeName() string
// Open opens the keystore. Prompter may be nil if non-interactive.
Open(
repoPath string,
config map[string]interface{},
prompter prompt.Prompter,
) (keystore.Keystore, error)
}