Documentation ¶
Index ¶
- type BlockchainKeystore
- type CreateUserArgs
- type CreateUserReply
- type ExportUserArgs
- type ExportUserReply
- type ImportUserArgs
- type ImportUserReply
- type KeyValuePair
- type Keystore
- func (ks *Keystore) CreateHandler() *common.HTTPHandler
- func (ks *Keystore) CreateUser(_ *http.Request, args *CreateUserArgs, reply *CreateUserReply) error
- func (ks *Keystore) ExportUser(_ *http.Request, args *ExportUserArgs, reply *ExportUserReply) error
- func (ks *Keystore) GetDatabase(bID ids.ID, username, password string) (database.Database, error)
- func (ks *Keystore) ImportUser(r *http.Request, args *ImportUserArgs, reply *ImportUserReply) error
- func (ks *Keystore) Initialize(log logging.Logger, db database.Database)
- func (ks *Keystore) ListUsers(_ *http.Request, args *ListUsersArgs, reply *ListUsersReply) error
- func (ks *Keystore) NewBlockchainKeyStore(blockchainID ids.ID) *BlockchainKeystore
- type ListUsersArgs
- type ListUsersReply
- type User
- type UserDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockchainKeystore ¶
type BlockchainKeystore struct {
// contains filtered or unexported fields
}
BlockchainKeystore ...
func (*BlockchainKeystore) GetDatabase ¶
func (bks *BlockchainKeystore) GetDatabase(username, password string) (database.Database, error)
GetDatabase ...
type CreateUserArgs ¶
CreateUserArgs are arguments for passing into CreateUser requests
type CreateUserReply ¶
type CreateUserReply struct {
Success bool `json:"success"`
}
CreateUserReply is the response from calling CreateUser
type ExportUserArgs ¶
ExportUserArgs are the arguments to ExportUser
type ExportUserReply ¶
type ExportUserReply struct {
User formatting.CB58 `json:"user"`
}
ExportUserReply is the reply from ExportUser
type ImportUserArgs ¶
type ImportUserArgs struct { Username string `json:"username"` Password string `json:"password"` User formatting.CB58 `json:"user"` }
ImportUserArgs are arguments for ImportUser
type ImportUserReply ¶
type ImportUserReply struct {
Success bool `json:"success"`
}
ImportUserReply is the response for ImportUser
type KeyValuePair ¶
KeyValuePair ...
type Keystore ¶
type Keystore struct {
// contains filtered or unexported fields
}
Keystore is the RPC interface for keystore management
func (*Keystore) CreateHandler ¶
func (ks *Keystore) CreateHandler() *common.HTTPHandler
CreateHandler returns a new service object that can send requests to thisAPI.
func (*Keystore) CreateUser ¶
func (ks *Keystore) CreateUser(_ *http.Request, args *CreateUserArgs, reply *CreateUserReply) error
CreateUser creates an empty user with the provided username and password
func (*Keystore) ExportUser ¶
func (ks *Keystore) ExportUser(_ *http.Request, args *ExportUserArgs, reply *ExportUserReply) error
ExportUser exports a serialized encoding of a user's information complete with encrypted database values
func (*Keystore) GetDatabase ¶
GetDatabase ...
func (*Keystore) ImportUser ¶
func (ks *Keystore) ImportUser(r *http.Request, args *ImportUserArgs, reply *ImportUserReply) error
ImportUser imports a serialized encoding of a user's information complete with encrypted database values, integrity checks the password, and adds it to the database
func (*Keystore) Initialize ¶
Initialize the keystore
func (*Keystore) ListUsers ¶
func (ks *Keystore) ListUsers(_ *http.Request, args *ListUsersArgs, reply *ListUsersReply) error
ListUsers lists all the registered usernames
func (*Keystore) NewBlockchainKeyStore ¶
func (ks *Keystore) NewBlockchainKeyStore(blockchainID ids.ID) *BlockchainKeystore
NewBlockchainKeyStore ...
type ListUsersReply ¶
type ListUsersReply struct {
Users []string `json:"users"`
}
ListUsersReply is the reply from ListUsers
type User ¶
type User struct { Password [32]byte `serialize:"true"` // The salted, hashed password Salt [16]byte `serialize:"true"` // The salt }
User describes a user of the keystore
type UserDB ¶
type UserDB struct { User `serialize:"true"` Data []KeyValuePair `serialize:"true"` }
UserDB describes the full content of a user