clientregistrar

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comms

type Comms struct {
	*connect.ProtoComms

	*pb.UnimplementedClientRegistrarServer
	*messages.UnimplementedGenericServer
	// contains filtered or unexported fields
}

Registration object used to implement endpoints and top-level comms functionality

func StartClientRegistrarServer

func StartClientRegistrarServer(id *id.ID, localServer string, handler Handler,
	certPEMblock, keyPEMblock []byte) *Comms

Starts a new server on the address:port specified by localServer and a callback interface for server operations with given path to public and private key for TLS connection

func (*Comms) AuthenticateToken

func (r *Comms) AuthenticateToken(ctx context.Context,
	msg *messages.AuthenticatedMessage) (*messages.Ack, error)

Handles validation of reverse-authentication tokens

func (*Comms) RegisterUser

RegisterUser event handler which registers a user with the platform

func (*Comms) RequestToken

func (r *Comms) RequestToken(context.Context, *messages.Ping) (*messages.AssignToken, error)

Handles reception of reverse-authentication token requests

type Handler

type Handler interface {
	RegisterUser(msg *pb.ClientRegistration) (confirmation *pb.SignedClientRegistrationConfirmations, err error)
}

type Implementation

type Implementation struct {
	Functions implementationFunctions
}

Implementation allows users of the client library to set the functions that implement the node functions

func NewImplementation

func NewImplementation() *Implementation

NewImplementation returns a Implementation struct with all of the function pointers returning nothing and printing an error.

func (*Implementation) RegisterUser

func (s *Implementation) RegisterUser(msg *pb.ClientRegistration) (confirmation *pb.SignedClientRegistrationConfirmations, err error)

Registers a user and returns a signed public key

Jump to

Keyboard shortcuts

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