caller

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 23 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 {
	Code   int       `json:"code"`
	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(ctx context.Context) ([]account.Account, error)

func (*MetaLockerHTTPCaller) AdminPatchAccount

func (c *MetaLockerHTTPCaller) AdminPatchAccount(ctx context.Context, id string, patch AccountAdminPatch) error

func (*MetaLockerHTTPCaller) AdminStoreAccount

func (c *MetaLockerHTTPCaller) AdminStoreAccount(ctx context.Context, acc *account.Account) error

func (*MetaLockerHTTPCaller) AdminStoreIdentity

func (c *MetaLockerHTTPCaller) AdminStoreIdentity(ctx context.Context, 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(ctx context.Context, key *model.AccessKey) (*model.AccessKey, error)

func (*MetaLockerHTTPCaller) CreateAccount

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

func (*MetaLockerHTTPCaller) CreateDIDDocument

func (c *MetaLockerHTTPCaller) CreateDIDDocument(ctx context.Context, didDoc *model.DIDDocument) error

func (*MetaLockerHTTPCaller) CreateSubAccount

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

func (*MetaLockerHTTPCaller) DIDProvider

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

func (*MetaLockerHTTPCaller) DeleteAccessKey

func (c *MetaLockerHTTPCaller) DeleteAccessKey(ctx context.Context, keyID string) error

func (*MetaLockerHTTPCaller) DeleteAccount

func (c *MetaLockerHTTPCaller) DeleteAccount(ctx context.Context, id string) error

func (*MetaLockerHTTPCaller) DeleteProperty

func (c *MetaLockerHTTPCaller) DeleteProperty(ctx context.Context, hash string) error

func (*MetaLockerHTTPCaller) GetAccessKey

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

func (*MetaLockerHTTPCaller) GetAccount

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

func (*MetaLockerHTTPCaller) GetAccountRecoveryCode

func (c *MetaLockerHTTPCaller) GetAccountRecoveryCode(ctx context.Context, username string) (string, error)

func (*MetaLockerHTTPCaller) GetAssetHead

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

func (*MetaLockerHTTPCaller) GetBlob

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

func (*MetaLockerHTTPCaller) GetBlock

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

func (*MetaLockerHTTPCaller) GetBlockRecords

func (c *MetaLockerHTTPCaller) GetBlockRecords(ctx context.Context, bn int64) ([][]string, error)

func (*MetaLockerHTTPCaller) GetChain

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

func (*MetaLockerHTTPCaller) GetDIDDocument

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

func (*MetaLockerHTTPCaller) GetDataAssetState

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

func (*MetaLockerHTTPCaller) GetGenesisBlock

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

func (*MetaLockerHTTPCaller) GetIdentity

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

func (*MetaLockerHTTPCaller) GetLocker

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

func (*MetaLockerHTTPCaller) GetOperation

func (c *MetaLockerHTTPCaller) GetOperation(ctx context.Context, opAddr string) ([]byte, error)

func (*MetaLockerHTTPCaller) GetOwnAccount

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

func (*MetaLockerHTTPCaller) GetProperty

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

func (*MetaLockerHTTPCaller) GetRecord

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

func (*MetaLockerHTTPCaller) GetRecordState

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

func (*MetaLockerHTTPCaller) GetServerControls

func (c *MetaLockerHTTPCaller) GetServerControls(ctx context.Context) (*ServerControls, error)

func (*MetaLockerHTTPCaller) GetToken

func (c *MetaLockerHTTPCaller) GetToken() string

func (*MetaLockerHTTPCaller) GetTopBlock

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

func (*MetaLockerHTTPCaller) GetVaultMap

func (*MetaLockerHTTPCaller) InitContextForwarding

func (c *MetaLockerHTTPCaller) InitContextForwarding()

func (*MetaLockerHTTPCaller) Ledger

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

func (*MetaLockerHTTPCaller) ListAccessKeys

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

func (*MetaLockerHTTPCaller) ListDIDDocuments

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

func (*MetaLockerHTTPCaller) ListIdentities

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

func (*MetaLockerHTTPCaller) ListLockers

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

func (*MetaLockerHTTPCaller) ListProperties

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

func (*MetaLockerHTTPCaller) ListSubAccounts

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

func (*MetaLockerHTTPCaller) LoginWithAccessKeys

func (c *MetaLockerHTTPCaller) LoginWithAccessKeys(ctx context.Context, apiKey, clientSecret string) error

func (*MetaLockerHTTPCaller) LoginWithAdminKeys

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

func (*MetaLockerHTTPCaller) LoginWithCredentials

func (c *MetaLockerHTTPCaller) LoginWithCredentials(ctx context.Context, 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(ctx context.Context, 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(ctx context.Context, email, oldEncryptedPassword, newEncryptedPassword, name, givenName, familyName string) error

func (*MetaLockerHTTPCaller) PurgeBlob

func (*MetaLockerHTTPCaller) PurgeOperation

func (c *MetaLockerHTTPCaller) PurgeOperation(ctx context.Context, opAddr string) error

func (*MetaLockerHTTPCaller) RecoverAccount

func (c *MetaLockerHTTPCaller) RecoverAccount(ctx context.Context, 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(ctx context.Context, data io.Reader, cleartext bool, vaultName string) (*model.StoredResource, error)

func (*MetaLockerHTTPCaller) SendOperation

func (c *MetaLockerHTTPCaller) SendOperation(ctx context.Context, opData []byte) (string, error)

func (*MetaLockerHTTPCaller) StoreIdentity

func (c *MetaLockerHTTPCaller) StoreIdentity(ctx context.Context, idy *account.DataEnvelope) error

func (*MetaLockerHTTPCaller) StoreLocker

func (c *MetaLockerHTTPCaller) StoreLocker(ctx context.Context, locker *account.DataEnvelope) error

func (*MetaLockerHTTPCaller) StoreProperty

func (c *MetaLockerHTTPCaller) StoreProperty(ctx context.Context, prop *account.DataEnvelope) error

func (*MetaLockerHTTPCaller) SubAccountInstance

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

func (*MetaLockerHTTPCaller) SubmitRecord

func (c *MetaLockerHTTPCaller) SubmitRecord(ctx context.Context, r *model.Record) error

func (*MetaLockerHTTPCaller) UpdateAccount

func (c *MetaLockerHTTPCaller) UpdateAccount(ctx context.Context, 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