cloud

package
v0.24.11 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	ssi.DIDAgent
	Tr txp.Trans // Our transport layer for communication
	// contains filtered or unexported fields
}

Agent is the main abstraction of the package together with Agency. The agent started as a CA but has been later added support for EAs and worker/cloud-EA as well. This might be something we will change later. Agent's most important task is/WAS to receive Payloads and process Messages inside them. And there are lots of stuff to support that. That part of code is heavily under construction.

More concrete parts of the Agent are support for wallet, root DID, did cache. Web socket connections are more like old relic, and that will change in future for something else. It WAS part of the protocol STATE management.

Please be noted that Agent or more precisely CA is singleton by its nature per EA it serves. So, Cloud Agent is a gateway to world for EA it serves. EAs are mostly in mobile devices and handicapped by their nature. In our latest architecture CA serves EA by creating a worker EA which lives in the cloud as well. For now, in the most cases we have pair or agents serving each mobile EAs here in the cloud: CA and w-EA.

There is Agent.Type where this Agent can be EA only. That type is used for test and CLI Go clients.

func NewEA

func NewEA() *Agent

NewEA creates a new EA without any initialization.

func NewTransportReadyEA

func NewTransportReadyEA(walletCfg *ssi.Wallet) *Agent

NewTransportReadyEA creates a new EA and opens its wallet and inits its transport layer for CA communication.

func (*Agent) AddPipeToPWMap

func (a *Agent) AddPipeToPWMap(p sec.Pipe, name string)

func (*Agent) AddToPWMap

func (a *Agent) AddToPWMap(me, you *ssi.DID, name string) sec.Pipe

func (*Agent) AddWs

func (a *Agent) AddWs(msgDID string, ws *websocket.Conn)

func (*Agent) AttachAPIEndp

func (a *Agent) AttachAPIEndp(endp service.Addr) error

AttachAPIEndp sets the API endpoint for remove EA i.e. real EA not w-EA.

func (*Agent) AttachSAImpl

func (a *Agent) AttachSAImpl(implID string, persistent bool)

AttachSAImpl sets implementation ID for SA to use for mocks and auto accepts.

func (*Agent) AutoPermission

func (a *Agent) AutoPermission() bool

func (*Agent) BuildEndpURL

func (a *Agent) BuildEndpURL() (endAddr string)

func (*Agent) CAEndp

func (a *Agent) CAEndp(wantWorker bool) (endP *endp.Addr)

CAEndp returns endpoint of the CA or CA's w-EA's endp when wantWorker = true.

func (*Agent) CallEA

func (a *Agent) CallEA(plType string, im didcomm.Msg) (om didcomm.Msg, err error)

CallEA makes a remove call for real EA and its API (issuer and verifier).

func (*Agent) ExportWallet

func (a *Agent) ExportWallet(key string, exportPath string) string

func (*Agent) InOutPL

func (a *Agent) InOutPL(cnxAddr *endp.Addr, ipl didcomm.Payload) (opl didcomm.Payload, nonce string)

InOutPL handles messages of handshake protocol at the moment. Future will show if it stays or even expands. The messages processed here are the CA's. The EA end is handled by clients.

func (*Agent) LoadPwOnInit

func (a *Agent) LoadPwOnInit() (err error)

func (*Agent) MasterSecret

func (a *Agent) MasterSecret() (string, error)

func (*Agent) MyCA

func (a *Agent) MyCA() comm.Receiver

func (*Agent) NotifyEA

func (a *Agent) NotifyEA(plType string, im didcomm.MessageHdr)

NotifyEA notifies the corresponding EA via web socket. Consider other options like apns, http, even rpc, etc.

func (*Agent) ProcessPL

func (a *Agent) ProcessPL(ipl didcomm.Payload) (opl didcomm.Payload, err error)

ProcessPL is helper method to implement a CA client aka EA. This is not called by CA itself which is running on server. This for agents which are connecting Agency run CAs

func (*Agent) Pw

func (a *Agent) Pw() pairwise.Saver

func (*Agent) PwPipe

func (a *Agent) PwPipe(pw string) (cp sec.Pipe, err error)

func (*Agent) SecPipe

func (a *Agent) SecPipe(meDID string) sec.Pipe

func (*Agent) Trans

func (a *Agent) Trans() txp.Trans

func (*Agent) WDID

func (a *Agent) WDID() string

WDID returns DID string of the WEA.

func (*Agent) WEA

func (a *Agent) WEA() (wa *Agent)

WEA returns CA's worker EA. It creates and inits it correctly if needed. The w-EA is a cloud allocated EA. Note! The TR is attached to worker EA here!

func (*Agent) WorkerEA

func (a *Agent) WorkerEA() comm.Receiver

type PipeMap

type PipeMap map[string]sec.Pipe

type SeedAgent

type SeedAgent struct {
	RootDID string
	CADID   string
	*ssi.Wallet
}

func NewSeedAgent

func NewSeedAgent(rootDid, caDid string, cfg *ssi.Wallet) *SeedAgent

func (*SeedAgent) Prepare

func (s *SeedAgent) Prepare() (h comm.Handler, err error)

Jump to

Keyboard shortcuts

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