Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAccountExists = errors.New("account exists") ErrAccountNotFound = errors.New("account not found") ErrDIDExists = errors.New("DID document exists") ErrDIDNotFound = errors.New("DID document not found") ErrIdentityNotFound = errors.New("identity not found") ErrLockerNotFound = errors.New("locker not found") ErrAccessKeyNotFound = errors.New("access key not found") ErrPropertyNotFound = errors.New("property not found") ErrRecoveryCodeNotFound = errors.New("recovery code not found") )
Functions ¶
func Register ¶
func Register(storageType string, ctor IdentityBackendConstructor)
Types ¶
type AccountBackend ¶
type AccountBackend interface {
CreateAccount(ctx context.Context, acct *account.Account) error
UpdateAccount(ctx context.Context, acct *account.Account) error
GetAccount(ctx context.Context, id string) (*account.Account, error)
DeleteAccount(ctx context.Context, id string) error
ListAccounts(ctx context.Context, parentAccountID, stateFilter string) ([]*account.Account, error)
HasAccountAccess(ctx context.Context, accountID, targetAccountID string) (bool, error)
ListAccessKeys(ctx context.Context, accountID string) ([]*model.AccessKey, error)
StoreAccessKey(ctx context.Context, accessKey *model.AccessKey) error
GetAccessKey(ctx context.Context, keyID string) (*model.AccessKey, error)
DeleteAccessKey(ctx context.Context, keyID string) error
StoreIdentity(ctx context.Context, accountID string, idy *account.DataEnvelope) error
GetIdentity(ctx context.Context, accountID string, hash string) (*account.DataEnvelope, error)
ListIdentities(ctx context.Context, accountID string, lvl model.AccessLevel) ([]*account.DataEnvelope, error)
StoreLocker(ctx context.Context, accountID string, l *account.DataEnvelope) error
GetLocker(ctx context.Context, accountID string, hash string) (*account.DataEnvelope, error)
ListLockers(ctx context.Context, accountID string, lvl model.AccessLevel) ([]*account.DataEnvelope, error)
StoreProperty(ctx context.Context, accountID string, prop *account.DataEnvelope) error
GetProperty(ctx context.Context, accountID string, hash string) (*account.DataEnvelope, error)
ListProperties(ctx context.Context, accountID string, lvl model.AccessLevel) ([]*account.DataEnvelope, error)
DeleteProperty(ctx context.Context, accountID string, hash string) error
}
type DIDBackend ¶
type IdentityBackend ¶
type IdentityBackend interface {
io.Closer
DIDBackend
AccountBackend
RecoveryBackend
}
IdentityBackend stores MetaLocker accounts and related entities such as encrypted identities, lockers, access keys, properties, DID documents and recovery codes. This is the main node-specific storage layer.
func CreateIdentityBackend ¶
func CreateIdentityBackend(cfg *IdentityBackendConfig, resolver cmdbase.ParameterResolver) (IdentityBackend, error)
type IdentityBackendConfig ¶
type IdentityBackendConfig struct {
Type string `json:"type"`
Params Parameters `json:"params"`
}
type IdentityBackendConstructor ¶
type IdentityBackendConstructor func(def Parameters, resolver cmdbase.ParameterResolver) (IdentityBackend, error)
type Parameters ¶
Click to show internal directories.
Click to hide internal directories.