caller

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotAuthorised = errors.New("not authorised to perform operation")
	ErrLoginFailed   = errors.New("login failed")
)

Functions

This section is empty.

Types

type AccountAdminPatch

type AccountAdminPatch struct {
	State string `json:"state,omitempty"`
}

copied from admin package

type AccountPatch

type AccountPatch struct {
	Email                string `json:"email,omitempty"`
	OldEncryptedPassword string `json:"oldEncryptedPassword,omitempty"`
	NewEncryptedPassword string `json:"newEncryptedPassword,omitempty"`
	Name                 string `json:"name,omitempty"`
	GivenName            string `json:"givenName,omitempty"`
	FamilyName           string `json:"familyName,omitempty"`
}

type AccountRecoveryResponse

type AccountRecoveryResponse struct {
	Account *account.Account `json:"account"`
}

type GetRecoveryCodeResponse

type GetRecoveryCodeResponse struct {
	Code string `json:"code"`
}

type LoginForm

type LoginForm struct {
	Username          string `json:"username"`
	Password          string `json:"password"`
	Audience          string `json:"audience"`
	AudiencePublicKey string `json:"audienceKey"`
}

type LoginResponse

type LoginResponse struct {
	Expire time.Time `json:"expire"`
	Token  string    `json:"token"`
}

type MetaLockerHTTPCaller

type MetaLockerHTTPCaller struct {
	// contains filtered or unexported fields
}

func NewMetaLockerHTTPCaller

func NewMetaLockerHTTPCaller(url string, userAgent string) (*MetaLockerHTTPCaller, error)

func (*MetaLockerHTTPCaller) AdminGetAccountList

func (c *MetaLockerHTTPCaller) AdminGetAccountList() ([]account.Account, error)

func (*MetaLockerHTTPCaller) AdminPatchAccount

func (c *MetaLockerHTTPCaller) AdminPatchAccount(id string, patch AccountAdminPatch) error

func (*MetaLockerHTTPCaller) AdminStoreAccount

func (c *MetaLockerHTTPCaller) AdminStoreAccount(acc *account.Account) error

func (*MetaLockerHTTPCaller) AdminStoreIdentity

func (c *MetaLockerHTTPCaller) AdminStoreIdentity(didDoc *model.DIDDocument) error

func (*MetaLockerHTTPCaller) AuthenticatedAccountID

func (c *MetaLockerHTTPCaller) AuthenticatedAccountID() string

func (*MetaLockerHTTPCaller) BlobManager

func (c *MetaLockerHTTPCaller) BlobManager() model.BlobManager

func (*MetaLockerHTTPCaller) Close

func (c *MetaLockerHTTPCaller) Close() error

func (*MetaLockerHTTPCaller) CloseNotificationService

func (c *MetaLockerHTTPCaller) CloseNotificationService() error

func (*MetaLockerHTTPCaller) ConnectionURL

func (c *MetaLockerHTTPCaller) ConnectionURL() string

func (*MetaLockerHTTPCaller) CreateAccessKey

func (c *MetaLockerHTTPCaller) CreateAccessKey(key *model.AccessKey) (*model.AccessKey, error)

func (*MetaLockerHTTPCaller) CreateAccount

func (c *MetaLockerHTTPCaller) CreateAccount(acct *account.Account, registrationCode string) error

func (*MetaLockerHTTPCaller) CreateDIDDocument

func (c *MetaLockerHTTPCaller) CreateDIDDocument(didDoc *model.DIDDocument) error

func (*MetaLockerHTTPCaller) CreateSubAccount

func (c *MetaLockerHTTPCaller) CreateSubAccount(acct *account.Account) (*account.Account, error)

func (*MetaLockerHTTPCaller) DIDProvider

func (c *MetaLockerHTTPCaller) DIDProvider() model.DIDProvider

func (*MetaLockerHTTPCaller) DeleteAccessKey

func (c *MetaLockerHTTPCaller) DeleteAccessKey(keyID string) error

func (*MetaLockerHTTPCaller) DeleteAccount

func (c *MetaLockerHTTPCaller) DeleteAccount(id string) error

func (*MetaLockerHTTPCaller) DeleteProperty

func (c *MetaLockerHTTPCaller) DeleteProperty(hash string) error

func (*MetaLockerHTTPCaller) GetAccessKey

func (c *MetaLockerHTTPCaller) GetAccessKey(keyID string) (*model.AccessKey, error)

func (*MetaLockerHTTPCaller) GetAccount

func (c *MetaLockerHTTPCaller) GetAccount(id string) (*account.Account, error)

func (*MetaLockerHTTPCaller) GetAccountRecoveryCode

func (c *MetaLockerHTTPCaller) GetAccountRecoveryCode(username string) (string, error)

func (*MetaLockerHTTPCaller) GetAssetHead

func (c *MetaLockerHTTPCaller) GetAssetHead(headID string) (*model.Record, error)

func (*MetaLockerHTTPCaller) GetBlob

func (c *MetaLockerHTTPCaller) GetBlob(res *model.StoredResource, accessToken string) (io.ReadCloser, error)

func (*MetaLockerHTTPCaller) GetBlock

func (c *MetaLockerHTTPCaller) GetBlock(bn int64) (*model.Block, error)

func (*MetaLockerHTTPCaller) GetBlockRecords

func (c *MetaLockerHTTPCaller) GetBlockRecords(bn int64) ([][]string, error)

func (*MetaLockerHTTPCaller) GetChain

func (c *MetaLockerHTTPCaller) GetChain(startNumber int64, depth int) ([]*model.Block, error)

func (*MetaLockerHTTPCaller) GetDIDDocument

func (c *MetaLockerHTTPCaller) GetDIDDocument(id string) (*model.DIDDocument, error)

func (*MetaLockerHTTPCaller) GetDataAssetState

func (c *MetaLockerHTTPCaller) GetDataAssetState(id string) (model.DataAssetState, error)

func (*MetaLockerHTTPCaller) GetGenesisBlock

func (c *MetaLockerHTTPCaller) GetGenesisBlock() (*model.Block, error)

func (*MetaLockerHTTPCaller) GetIdentity

func (c *MetaLockerHTTPCaller) GetIdentity(hash string) (*account.DataEnvelope, error)

func (*MetaLockerHTTPCaller) GetLocker

func (c *MetaLockerHTTPCaller) GetLocker(hash string) (*account.DataEnvelope, error)

func (*MetaLockerHTTPCaller) GetOperation

func (c *MetaLockerHTTPCaller) GetOperation(opAddr string) ([]byte, error)

func (*MetaLockerHTTPCaller) GetOwnAccount

func (c *MetaLockerHTTPCaller) GetOwnAccount() (*account.Account, error)

func (*MetaLockerHTTPCaller) GetProperty

func (c *MetaLockerHTTPCaller) GetProperty(hash string) (*account.DataEnvelope, error)

func (*MetaLockerHTTPCaller) GetRecord

func (c *MetaLockerHTTPCaller) GetRecord(rid string) (*model.Record, error)

func (*MetaLockerHTTPCaller) GetRecordState

func (c *MetaLockerHTTPCaller) GetRecordState(rid string) (*model.RecordState, error)

func (*MetaLockerHTTPCaller) GetServerControls

func (c *MetaLockerHTTPCaller) GetServerControls() (*ServerControls, error)

func (*MetaLockerHTTPCaller) GetToken

func (c *MetaLockerHTTPCaller) GetToken() string

func (*MetaLockerHTTPCaller) GetTopBlock

func (c *MetaLockerHTTPCaller) GetTopBlock() (*model.Block, error)

func (*MetaLockerHTTPCaller) GetVaultMap

func (c *MetaLockerHTTPCaller) GetVaultMap() (map[string]*model.VaultProperties, error)

func (*MetaLockerHTTPCaller) InitContextForwarding

func (c *MetaLockerHTTPCaller) InitContextForwarding()

func (*MetaLockerHTTPCaller) Ledger

func (c *MetaLockerHTTPCaller) Ledger() model.Ledger

func (*MetaLockerHTTPCaller) ListAccessKeys

func (c *MetaLockerHTTPCaller) ListAccessKeys() ([]*model.AccessKey, error)

func (*MetaLockerHTTPCaller) ListDIDDocuments

func (c *MetaLockerHTTPCaller) ListDIDDocuments() ([]*model.DIDDocument, error)

func (*MetaLockerHTTPCaller) ListIdentities

func (c *MetaLockerHTTPCaller) ListIdentities() ([]*account.DataEnvelope, error)

func (*MetaLockerHTTPCaller) ListLockerHashes

func (c *MetaLockerHTTPCaller) ListLockerHashes() ([]string, error)

func (*MetaLockerHTTPCaller) ListLockers

func (c *MetaLockerHTTPCaller) ListLockers() ([]*account.DataEnvelope, error)

func (*MetaLockerHTTPCaller) ListProperties

func (c *MetaLockerHTTPCaller) ListProperties() ([]*account.DataEnvelope, error)

func (*MetaLockerHTTPCaller) ListSubAccounts

func (c *MetaLockerHTTPCaller) ListSubAccounts(id string) ([]*account.Account, error)

func (*MetaLockerHTTPCaller) LoginWithAccessKeys

func (c *MetaLockerHTTPCaller) LoginWithAccessKeys(apiKey, clientSecret string) error

func (*MetaLockerHTTPCaller) LoginWithAdminKeys

func (c *MetaLockerHTTPCaller) LoginWithAdminKeys(adminKey, adminSecret string) error

func (*MetaLockerHTTPCaller) LoginWithCredentials

func (c *MetaLockerHTTPCaller) LoginWithCredentials(email string, password string) error

func (*MetaLockerHTTPCaller) LoginWithJWT

func (c *MetaLockerHTTPCaller) LoginWithJWT(jwtToken string) error

func (*MetaLockerHTTPCaller) Logout

func (c *MetaLockerHTTPCaller) Logout()

Logout - clearing authorisation info

func (*MetaLockerHTTPCaller) NewInstance

func (c *MetaLockerHTTPCaller) NewInstance(email, passphrase string, isHash bool) (wallet.NodeClient, error)

func (*MetaLockerHTTPCaller) NotificationService

func (c *MetaLockerHTTPCaller) NotificationService() (notification.Service, error)

func (*MetaLockerHTTPCaller) OffChainStorage

func (c *MetaLockerHTTPCaller) OffChainStorage() model.OffChainStorage

func (*MetaLockerHTTPCaller) PatchAccount

func (c *MetaLockerHTTPCaller) PatchAccount(email, oldEncryptedPassword, newEncryptedPassword, name, givenName, familyName string) error

func (*MetaLockerHTTPCaller) PurgeBlob

func (c *MetaLockerHTTPCaller) PurgeBlob(res *model.StoredResource) error

func (*MetaLockerHTTPCaller) PurgeOperation

func (c *MetaLockerHTTPCaller) PurgeOperation(opAddr string) error

func (*MetaLockerHTTPCaller) RecoverAccount

func (c *MetaLockerHTTPCaller) RecoverAccount(userID string, privKey ed25519.PrivateKey, recoveryCode, newPassphrase string) (*account.Account, error)

func (*MetaLockerHTTPCaller) SecureClient

func (c *MetaLockerHTTPCaller) SecureClient() *httpsecure.Client

func (*MetaLockerHTTPCaller) SendBlob

func (c *MetaLockerHTTPCaller) SendBlob(data io.Reader, cleartext bool, vaultName string) (*model.StoredResource, error)

func (*MetaLockerHTTPCaller) SendOperation

func (c *MetaLockerHTTPCaller) SendOperation(opData []byte) (string, error)

func (*MetaLockerHTTPCaller) StoreIdentity

func (c *MetaLockerHTTPCaller) StoreIdentity(idy *account.DataEnvelope) error

func (*MetaLockerHTTPCaller) StoreLocker

func (c *MetaLockerHTTPCaller) StoreLocker(locker *account.DataEnvelope) error

func (*MetaLockerHTTPCaller) StoreProperty

func (c *MetaLockerHTTPCaller) StoreProperty(prop *account.DataEnvelope) error

func (*MetaLockerHTTPCaller) SubAccountInstance

func (c *MetaLockerHTTPCaller) SubAccountInstance(subAccountID string) (wallet.NodeClient, error)

func (*MetaLockerHTTPCaller) SubmitRecord

func (c *MetaLockerHTTPCaller) SubmitRecord(r *model.Record) error

func (*MetaLockerHTTPCaller) UpdateAccount

func (c *MetaLockerHTTPCaller) UpdateAccount(acc *account.Account) error

type NewAccountForm

type NewAccountForm struct {
	Account          *account.Account `json:"account"`
	RegistrationCode string           `json:"registrationCode"`
}

type ProxyDocumentLoader

type ProxyDocumentLoader struct {
	// contains filtered or unexported fields
}

ProxyDocumentLoader redirects 'well-known' context URLs to the given URLs. This is useful for redirecting Piprate context calls to a MetaLocker instance.

func NewProxyDocumentLoader

func NewProxyDocumentLoader(nextLoader ld.DocumentLoader, proxyMapping map[string]string) *ProxyDocumentLoader

NewProxyDocumentLoader creates a new instance of ProxyDocumentLoader.

func (*ProxyDocumentLoader) LoadDocument

func (pdl *ProxyDocumentLoader) LoadDocument(u string) (*ld.RemoteDocument, error)

LoadDocument returns a RemoteDocument containing the contents of the JSON resource from the given URL.

type ServerControls

type ServerControls struct {
	Status           string `json:"status"`
	MaintenanceMode  bool   `json:"maintenanceMode"`
	JWTPublicKey     string `json:"jwtPublicKey"`
	GenesisBlockHash string `json:"genesis"`
	TopBlock         int64  `json:"top"`
}

Jump to

Keyboard shortcuts

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