Documentation ¶
Index ¶
- type Comms
- func (r *Comms) AuthenticateToken(ctx context.Context, msg *messages.AuthenticatedMessage) (*messages.Ack, error)
- func (r *Comms) CheckRegistration(ctx context.Context, msg *pb.RegisteredNodeCheck) (*pb.RegisteredNodeConfirmation, error)
- func (r *Comms) Poll(ctx context.Context, msg *messages.AuthenticatedMessage) (*pb.PermissionPollResponse, error)
- func (r *Comms) PollNdf(ctx context.Context, ndfHash *pb.NDFHash) (*pb.NDF, error)
- func (r *Comms) RegisterNode(ctx context.Context, msg *pb.NodeRegistration) (*messages.Ack, error)
- func (r *Comms) RegisterUser(ctx context.Context, msg *pb.ClientRegistration) (*pb.SignedClientRegistrationConfirmations, error)
- func (r *Comms) RequestToken(context.Context, *messages.Ping) (*messages.AssignToken, error)
- type Handler
- type Implementation
- func (s *Implementation) CheckRegistration(msg *pb.RegisteredNodeCheck) (..., error)
- func (s *Implementation) Poll(msg *pb.PermissioningPoll, auth *connect.Auth) (*pb.PermissionPollResponse, error)
- func (s *Implementation) PollNdf(ndfHash []byte) (*pb.NDF, error)
- func (s *Implementation) RegisterNode(salt []byte, ...) error
- func (s *Implementation) RegisterUser(msg *pb.ClientRegistration) (confirmation *pb.SignedClientRegistrationConfirmations, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comms ¶
type Comms struct { *connect.ProtoComms *pb.UnimplementedRegistrationServer *messages.UnimplementedGenericServer // contains filtered or unexported fields }
Registration object used to implement endpoints and top-level comms functionality
func StartRegistrationServer ¶
func StartRegistrationServer(id *id.ID, localServer string, handler Handler, certPEMblock, keyPEMblock []byte, preloadedHosts []*connect.Host) *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) CheckRegistration ¶
func (r *Comms) CheckRegistration(ctx context.Context, msg *pb.RegisteredNodeCheck) (*pb.RegisteredNodeConfirmation, error)
Server -> Permissioning unified polling
func (*Comms) Poll ¶
func (r *Comms) Poll(ctx context.Context, msg *messages.AuthenticatedMessage) (*pb.PermissionPollResponse, error)
Server -> Permissioning unified polling
func (*Comms) RegisterNode ¶
Handle a node registration event
func (*Comms) RegisterUser ¶
func (r *Comms) RegisterUser(ctx context.Context, msg *pb.ClientRegistration) ( *pb.SignedClientRegistrationConfirmations, error)
RegisterUser event handler which registers a user with the platform
func (*Comms) RequestToken ¶
Handles reception of reverse-authentication token requests
type Handler ¶
type Handler interface { RegisterUser(msg *pb.ClientRegistration) (confirmation *pb.SignedClientRegistrationConfirmations, err error) RegisterNode(salt []byte, serverAddr, serverTlsCert, gatewayAddr, gatewayTlsCert, registrationCode string) error PollNdf(ndfHash []byte) (*pb.NDF, error) Poll(msg *pb.PermissioningPoll, auth *connect.Auth) (*pb. PermissionPollResponse, error) CheckRegistration(msg *pb.RegisteredNodeCheck) (*pb.RegisteredNodeConfirmation, 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) CheckRegistration ¶
func (s *Implementation) CheckRegistration(msg *pb.RegisteredNodeCheck) (*pb. RegisteredNodeConfirmation, error)
func (*Implementation) Poll ¶
func (s *Implementation) Poll(msg *pb.PermissioningPoll, auth *connect.Auth) (*pb.PermissionPollResponse, error)
func (*Implementation) RegisterNode ¶
func (s *Implementation) RegisterNode(salt []byte, serverAddr, serverTlsCert, gatewayAddr, gatewayTlsCert, registrationCode string) 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