localRPC

package
v0.0.0-...-3e63800 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2021 License: GPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScryptSaltBytes = 8
	ScryptN         = 32768
	ScryptR         = 8
	ScryptP         = 1
	ScryptKeyLen    = 32
	AesKeyLen       = 32
	PrivateKeyLen   = 64
)

Scrypt values as recommended here: https://godoc.org/golang.org/x/crypto/scrypt

Variables

This section is empty.

Functions

func ListenandServe

func ListenandServe(router *mux.Router)

ListenandServe starts the local websocket listener

Types

type AddAccountArgs

type AddAccountArgs struct {
	UniqueID string
	Account  string
	Username string
	Password string
}

type AddAccountReply

type AddAccountReply struct {
}

type DeleteUserArgs

type DeleteUserArgs struct {
	Username string
	Password string
}

type DeleteUserReply

type DeleteUserReply struct {
	Error string
}

type GetKeystoreArgs

type GetKeystoreArgs struct {
	Username string
}

type GetKeystoreReply

type GetKeystoreReply struct {
	Keystore string
}

type GetSeedArgs

type GetSeedArgs struct {
	Username string
	Password string
}

type GetSeedReply

type GetSeedReply struct {
	Seed  string
	Error string
}

type GetUserDetailsReply

type GetUserDetailsReply struct {
	FirstName string
	LastName  string
}

type GetUsernamesReply

type GetUsernamesReply struct {
	Usernames []string
	Passwords []string
}

type MedRecLocal

type MedRecLocal struct {
}

MedRecLocal interface for all the rpc methods

func (*MedRecLocal) AddAccount

func (client *MedRecLocal) AddAccount(r *http.Request, args *AddAccountArgs, reply *AddAccountReply) error

should add test to check that: unique ID is not a duplicate unique id matches an entry in the database

func (*MedRecLocal) DeleteUser

func (client *MedRecLocal) DeleteUser(r *http.Request, args *DeleteUserArgs, reply *DeleteUserReply) error

DeleteUser retrieves a user's decrypts and retrives a user's private key

func (*MedRecLocal) GetKeystore

func (client *MedRecLocal) GetKeystore(r *http.Request, args *GetKeystoreArgs, reply *GetKeystoreReply) error

func (*MedRecLocal) GetSeed

func (client *MedRecLocal) GetSeed(r *http.Request, args *GetSeedArgs, reply *GetSeedReply) error

GetSeed ecrypts and retrives a user's private key seed

func (*MedRecLocal) GetUserDetails

func (client *MedRecLocal) GetUserDetails(r *http.Request, args *UserDetailsArgs, reply *GetUserDetailsReply) error

GetUserDetails queries the sql databse for the list of local users

func (*MedRecLocal) GetUsernames

func (client *MedRecLocal) GetUsernames(r *http.Request, args *common.NoArgs, reply *GetUsernamesReply) error

GetUsernames queries the sql databse for the list of local users

func (*MedRecLocal) NewUser

func (client *MedRecLocal) NewUser(r *http.Request, args *NewUserArgs, reply *NewUserReply) error

NewUser adds a new user to the database

func (*MedRecLocal) SaveKeystore

func (client *MedRecLocal) SaveKeystore(r *http.Request, args *SaveKeystoreArgs, reply *SaveKeystoreReply) error

TODO this should take a password and check the password matches

func (*MedRecLocal) SetWalletPassword

func (client *MedRecLocal) SetWalletPassword(r *http.Request, args *SetWalletPasswordArgs, reply *SetWalletPasswordReply) error

type NewUserArgs

type NewUserArgs struct {
	FirstName string
	LastName  string
	Username  string
	Password  string
	Seed      string
}

type NewUserReply

type NewUserReply struct {
	Error string
}

type SaveKeystoreArgs

type SaveKeystoreArgs struct {
	Keystore string
	Username string
}

type SaveKeystoreReply

type SaveKeystoreReply struct {
}

type SetWalletPasswordArgs

type SetWalletPasswordArgs struct {
	WalletPassword string //wallet password
}

type SetWalletPasswordReply

type SetWalletPasswordReply struct {
}

type UserDetailsArgs

type UserDetailsArgs struct {
	Username string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL