handshake

package
v0.31.65 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 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 AnchorAgent added in v0.24.28

func AnchorAgent(agentName, seed string) (agent *cloud.Agent, caDid core.DID, err error)

AnchorAgent Builds new trust anchor agent and its wallet. This is quite slow process. In future we could build them in advance to pool where we could allocate them when needed. Needs to wallet renaming or indexing.

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) (stwd *cloud.Agent)

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

Jump to

Keyboard shortcuts

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