Documentation ¶
Overview ¶
Package client implements an agency client, an Edge Agent. It is used for for integration tests, where it allows run client and server code in same process which helps for example debugging a lot.
Similar functionality can be found from cmds package which is preferred way to build CLI. Please see findy-cli for more information.
Please note, that this client implementation is interim. For that reason the code is not cleaned up or streamlined. When we decide if this API is permanent, refactoring will proceed.
Index ¶
- type Client
- func (edge *Client) ContinueIssuingProtocol(taskID string, allow bool) (err error)
- func (edge *Client) ContinueProtocol(taskID string, allow bool) (err error)
- func (edge *Client) CreateCredDef(schID string, tag string) (credDefID string, err error)
- func (edge *Client) CreateDID() (DID string, err error)
- func (edge *Client) CreatePW(endpoint, endpKey, edgePw string) (tID string, err error)
- func (edge *Client) CreateSchema(schema *ssi.Schema) (schID string, err error)
- func (edge *Client) CredOffer(edgePw, credDefID, email string) (tID string, err error)
- func (edge *Client) CredReq(edgePw, credDefID, email, verID string) (tID string, err error)
- func (edge *Client) ExportLocalWallet(filePath, exportKey, theirDid string, handshakePayload *mesg.Payload) (err error)
- func (edge *Client) GetCredDef(credDefID string) (err error)
- func (edge *Client) GetSchema(schemaID string) (err error)
- func (edge *Client) GetWallet() (name string, err error)
- func (edge *Client) Handshake() (theirDid string, finalPL *mesg.Payload, eaEnp service.Addr, err error)
- func (edge *Client) IsInit() bool
- func (edge *Client) JWT() (jwt string, err error)
- func (edge *Client) Listen(f trans2.EchoListener) (err error)
- func (edge *Client) MsgToCA(t string, msg *mesg.Msg) (in mesg.Msg, err error)
- func (edge *Client) PingAPIEndp() (err error)
- func (edge *Client) PingCA() (err error)
- func (edge *Client) ProofProp(edgePw, email string) (tID string, err error)
- func (edge *Client) ProofRequest(edgePw, credDefID string) (tID string, err error)
- func (edge *Client) PwAndCredReq(endpoint, endpKey, edgePw, credDefID, email, veriID string) (tID string, err error)
- func (edge *Client) PwAndProofProp(endpoint, endpKey, edgePw, credDefID, email string) (tID string, err error)
- func (edge *Client) PwAndTrustPing(endpoint, endpKey, edgePw string) (tID string, err error)
- func (edge *Client) PwFromInvitation(i *didexchange.Invitation) (tID string, err error)
- func (edge *Client) SendMsg(edgePw, ID, msg string) (tID string, err error)
- func (edge *Client) ServicePing() (err error)
- func (edge *Client) SetAPIEndp(endp service.Addr) (err error)
- func (edge *Client) SetAgent(a *cloud.Agent)
- func (edge *Client) SetSAImpl(ImplID string) (err error)
- func (edge *Client) TaskReady(taskID string) (yes bool, err error)
- func (edge *Client) TaskStatus(taskID string) (err error)
- func (edge *Client) TrustPingPW(edgePw string) (tID string, err error)
- type EndpointInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Email string // Email address used for handshake/onboarding BaseAddress string // URL for agency which serves this client (EA) Wallet *ssi.Wallet // EA's local wallet // contains filtered or unexported fields }
Client is a helper struct which implements an EA. The EA can be used to connect agency and perform CA API calls to EA's CA's. Note that all of the protocol calls are async. They return task ID which can be used to query how task is proceeded.
func (*Client) ContinueIssuingProtocol ¶
ContinueIssuingProtocol calls agency to tell a certain protocol (taskID) does user accept to continue issuing protocol.
func (*Client) ContinueProtocol ¶
ContinueProtocol calls agency to tell a certain protocol (taskID) does user accept to continue proofing protocol.
func (*Client) CreateCredDef ¶
CreateCredDef calls agency to create a cred def and write it to the ledger.
func (*Client) CreateSchema ¶
CreateSchema calls create schema API from agency which writes it to ledger as well.
func (*Client) CredOffer ¶
CredOffer asks agency to start issuing protocol with offer i.e. from issuer's side.
func (*Client) CredReq ¶
CredReq asks agency to start issuing protocol with propose i.e. from holder's side.
func (*Client) ExportLocalWallet ¶
func (edge *Client) ExportLocalWallet(filePath, exportKey, theirDid string, handshakePayload *mesg.Payload) (err error)
ExportLocalWallet exports local wallet.
func (*Client) GetCredDef ¶
GetCredDef calls agency to return cred def from the ledger.
func (*Client) GetWallet ¶
GetWallet prepares worker EA's (cloud allocated agent) wallet for download and returns the download URL.
func (*Client) Handshake ¶
func (edge *Client) Handshake() (theirDid string, finalPL *mesg.Payload, eaEnp service.Addr, err error)
Handshake is a function to on-board the EA to this Agency. It creates the client side wallet and implements EA's part of the pairwise protocol. The currently implemented protocol is a version of old indy a2a protocol, which was a precursor of the Aries connection/didexhange protocol. todo: we move this later, this is here for tests at the moment
func (*Client) Listen ¶
func (edge *Client) Listen(f trans2.EchoListener) (err error)
Listen is a helper function to be used from services to be able to listen web socket to receive realtime notifications from CA. It needs a callback as an argument. Currently it's called from SA implementations who use us as a framework.
func (*Client) PingAPIEndp ¶
PingAPIEndp asks an agency to ping service API endpoint.
func (*Client) ProofProp ¶
ProofProp asks agency to start proof protocol with propose proof from prover's side.
func (*Client) ProofRequest ¶
ProofRequest asks agency to start proof protocol with proof request from verifier's sid.
func (*Client) PwAndCredReq ¶
func (edge *Client) PwAndCredReq( endpoint, endpKey, edgePw, credDefID, email, veriID string) (tID string, err error)
PwAndCredReq asks agency to perform two protocols in a row. 1st make pairwise, 2nd start issuing protocol with propose, all from holder's side.
func (*Client) PwAndProofProp ¶
func (edge *Client) PwAndProofProp( endpoint, endpKey, edgePw, credDefID, email string) (tID string, err error)
PwAndProofProp asks agency to perform two protocols in a row. 1st make pairwise, 2nd start proof protocol with propose, all from holder/prover side.
func (*Client) PwAndTrustPing ¶
PwAndTrustPing asks agency to perform two protocols in a row. 1st make pairwise, 2nd make a trust ping.
func (*Client) PwFromInvitation ¶
func (edge *Client) PwFromInvitation(i *didexchange.Invitation) (tID string, err error)
PwFromInvitation calls agency to create pairwise to other agent.
func (*Client) SendMsg ¶
SendMsg asks agency to send basic message to other agent defined by pairwise.
func (*Client) ServicePing ¶
ServicePing pings the agency. It's used to check if an agency is running and well.
func (*Client) SetAPIEndp ¶
SetAPIEndp calls an agency to set service API endpoint for an agent.
func (*Client) SetSAImpl ¶
SetSAImpl calls agency to set EA's (service agent) current SA implementation. Please note this is more useful for integration tests. See SetAPIEndg for real use.
func (*Client) TaskStatus ¶
TaskStatus is a Client function just for to send CA API message as a test. Note that this function is only intended to be used as part of the integration tests.
type EndpointInfo ¶
type EndpointInfo struct { CAEndpoint string `json:"caEndpoint"` Pairwise service.Addr `json:"pairwise"` }
EndpointInfo is helper struct for ExportLocalWallet.