operation

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Overview

Package operation provides wallet adapter REST features.

Index

Constants

View Source
const (
	CreateInvitationPath  = operationID + "/create-invitation"
	RequestAppProfilePath = operationID + "/request-app-profile"
	SendCHAPIRequestPath  = operationID + "/send-chapi-request"
	SavePreferencesPath   = operationID + "/save-preferences"
	GetPreferencesPath    = operationID + "/get-preferences/{id}"
)

constants for endpoints of wallet bridge controller.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationProfileRequest

type ApplicationProfileRequest struct {
	// UserID of wallet application profile.
	// required: true
	UserID string `json:"userID"`

	// Wait for connection to be completed before returning wallet application profile.
	// in: body
	WaitForConnection bool `json:"waitForConnection"`

	// Timeout (in nanoseconds) waiting for connection completed.
	// in: body
	Timeout time.Duration `json:"timeout"`
}

ApplicationProfileRequest model

Request for querying wallet application profile ID for given user from wallet server.

swagger:parameters applicationProfileRequest

type ApplicationProfileResponse

type ApplicationProfileResponse struct {
	// InvitationID of invitation used to create profile.
	// in: body
	InvitationID string `json:"invitationID"`

	// ConnectionStatus is DIDComm connection status of the profile.
	// in: body
	ConnectionStatus string `json:"status"`
}

ApplicationProfileResponse model

Response containing wallet application profile of user requested.

swagger:response appProfileResponse

type CHAPIRequest

type CHAPIRequest struct {
	// UserID of wallet application profile.
	UserID string `json:"userID"`
	// Request is credential handler request to be sent out.
	Payload json.RawMessage `json:"request"`
	// Timeout (in nanoseconds) waiting for reply.
	Timeout time.Duration `json:"timeout,omitempty"`
}

CHAPIRequest model

CHAPI request to be sent to given wallet application.

swagger:parameters chapiRequest

type CHAPIResponse

type CHAPIResponse struct {
	// in: body
	Data json.RawMessage `json:"data"`
}

CHAPIResponse model

CHAPI response from requested wallet application.

swagger:response chapiResponse

type Config

type Config struct {
	AriesCtx              aries.CtxProvider
	MsgRegistrar          command.MessageHandler
	WalletAppURL          string
	DefaultLabel          string
	AdapterTransientStore storage.Store
}

Config defines configuration for wallet adapter operations.

type CreateInvitationRequest

type CreateInvitationRequest struct {
	// required: true
	UserID string `json:"userID"`
}

CreateInvitationRequest model

Request for creating wallet server invitation.

swagger:parameters createInvitation

type CreateInvitationResponse

type CreateInvitationResponse struct {
	// in: body
	URL string `json:"url"`
}

CreateInvitationResponse model

Response of out-of-band invitation from wallet server.

swagger:response createInvitationResponse

type Handler

type Handler interface {
	Path() string
	Method() string
	Handle() http.HandlerFunc
}

Handler http handler for each controller API endpoint.

type Operation

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

Operation is REST service operation controller for wallet bridge features.

func New

func New(config *Config) (*Operation, error)

New returns new wallet bridge REST controller instance.

func (*Operation) CreateInvitation

func (o *Operation) CreateInvitation(rw http.ResponseWriter, req *http.Request)

CreateInvitation swagger:route POST /wallet-bridge/create-invitation wallet-bridge createInvitation

Creates out-of-band invitation to connect to this wallet server. Response contains URL to application with invitation to load during startup.

Responses:

default: genericError
200: createInvitationResponse

func (*Operation) GetRESTHandlers

func (o *Operation) GetRESTHandlers() []restapi.Handler

GetRESTHandlers get all controller API handler available for this protocol service.

func (*Operation) GetWalletPreferences

func (o *Operation) GetWalletPreferences(rw http.ResponseWriter, req *http.Request)

GetWalletPreferences swagger:route GET /wallet-bridge/get-preferences/{id} wallet-bridge getPreferences

Gets wallet preferences by user.

Responses:

default: genericError
200: walletPreferencesResponse

func (*Operation) RequestApplicationProfile

func (o *Operation) RequestApplicationProfile(rw http.ResponseWriter, req *http.Request)

RequestApplicationProfile swagger:route POST /wallet-bridge/request-app-profile wallet-bridge applicationProfileRequest

Requests wallet application profile of given user. Response contains wallet application profile of given user.

Responses:

default: genericError
200: appProfileResponse

func (*Operation) SaveWalletPreferences

func (o *Operation) SaveWalletPreferences(rw http.ResponseWriter, req *http.Request)

SaveWalletPreferences swagger:route POST /wallet-bridge/save-preferences wallet-bridge savePreferences

Saves wallet preferences by user.

Responses:

default: genericError

func (*Operation) SendCHAPIRequest

func (o *Operation) SendCHAPIRequest(rw http.ResponseWriter, req *http.Request)

SendCHAPIRequest swagger:route POST /wallet-bridge/send-chapi-request wallet-bridge chapiRequest

Sends CHAPI request to given wallet application ID. Response contains CHAPI request.

Responses:

default: genericError
200: chapiResponse

type SaveWalletPreferencesRequest

type SaveWalletPreferencesRequest struct {
	// UserID of the user.
	// required: true
	UserID string `json:"userID"`

	// Wallet type, supported types 'browser, remote'
	// required: true
	WalletType WalletType `json:"walletType"`
}

SaveWalletPreferencesRequest model

Request for saving user's wallet preferences.

swagger:parameters savePreferences

type WalletPreferencesResponse

type WalletPreferencesResponse struct {
	// Wallet type, supported types 'browser, remote'
	// required: true
	WalletType WalletType `json:"walletType"`
}

WalletPreferencesResponse model

Response for request user wallet preferences.

swagger:parameters walletPreferencesResponse

type WalletType

type WalletType string

WalletType supported wallet types

const (
	// Browser wallet type
	Browser WalletType = "browser"
	// Remote wallet type
	Remote = "remote"
)

func (WalletType) IsValid

func (lt WalletType) IsValid() error

IsValid checks if underlying wallet type is supported

Jump to

Keyboard shortcuts

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