handshake

package
v0.24.1 Latest Latest
Warning

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

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

Documentation

Overview

Package handshake is abstraction for agency level handshake protocol which on-boards new clients to the agency. These clients are called EAs (Edge Agents). Each EA has one CA to present it on the network. User can have many EAs which all are connected to one CA.

Index

Constants

View Source
const (
	PingHandlerEndpoint = "ping"
	HandlerEndpoint     = "handshake"
)

These are the named endpoints for pre-cases which are handled without pre-encryption. Both, these constants and below table endpoints() are needed.

View Source
const (
	AlreadyExistError = "UNKNOWN_TYPE" // Going to production so we don't tell this
	UnknownTypeError  = "UNKNOWN_TYPE"
)

Server's error messages

Variables

This section is empty.

Functions

func LoadRegistered

func LoadRegistered(filename string) (err error)

LoadRegistered is usually called only once, in the startup of the service.

func RegisterGobs

func RegisterGobs()

func SetSteward

func SetSteward(st *cloud.Agent)

SetSteward sets the steward agent of this Agency.

func SetStewardFromWallet

func SetStewardFromWallet(wallet *ssi.Wallet, DID string)

SetStewardFromWallet sets steward DID for us from pre-created wallet and named DID string.

Types

type Agency

type Agency struct{}

Agency is a singleton to encapsulate agency's settings data. It is the master class for all of the services offered by the agency. It includes registers for service handlers, aka endpoint handlers*. Most of the services are forwarded to CAs and just few of them are offered by the agency it self, like on-boarding.

The Agency is still in heavy construction. There are some fields which are obsolete or not used. The code base is not clean yet.

The Agency holds DID for the steward which it gets from the startup. It keeps track for CAs (handlers) and their wallets (register).

*Endpoint handler was very early concept of the development, when all of the endpoints, both agency endpoints and CA endpoints were routed by this agency and which where served by same URL root. The selection between agency endpoints and CA endpoints were done by reserved keywords for agency endpoints and DID values for CA endpoints. NOW the routing is done by URL paths where and /api/ endpoints are routed to Agency.APICall()

Please see server.go for more information about service endpoints.

var Hub *Agency

func (*Agency) InOutPL

func (a *Agency) InOutPL(
	endpointAddress *endp.Addr,
	payload didcomm.Payload) (response didcomm.Payload, nonce string)

InOutPL is Handler implementation which means that Agency can serve certain APIs. Most of the other HTTP call are routed to CAs.

Jump to

Keyboard shortcuts

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