Documentation ¶
Index ¶
- type Comms
- func (r *Comms) AuthenticateToken(ctx context.Context, msg *messages.AuthenticatedMessage) (*messages.Ack, error)
- func (r *Comms) Authorize(ctx context.Context, auth *pb.AuthorizerAuth) (ack *messages.Ack, err error)
- func (r *Comms) RequestCert(ctx context.Context, msg *pb.AuthorizerCertRequest) (*messages.Ack, error)
- func (r *Comms) RequestEABCredentials(ctx context.Context, msg *pb.EABCredentialRequest) (*pb.EABCredentialResponse, error)
- func (r *Comms) RequestToken(context.Context, *messages.Ping) (*messages.AssignToken, error)
- type Handler
- type Implementation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comms ¶
type Comms struct { *connect.ProtoComms *pb.UnimplementedAuthorizerServer *messages.UnimplementedGenericServer // contains filtered or unexported fields }
Authorizer object used to implement endpoints and top-level comms functionality
func StartAuthorizerServer ¶
func StartAuthorizerServer(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) Authorize ¶
func (r *Comms) Authorize(ctx context.Context, auth *pb.AuthorizerAuth) (ack *messages.Ack, err error)
Authorizes a node to talk to permissioning
func (*Comms) RequestCert ¶
func (r *Comms) RequestCert(ctx context.Context, msg *pb.AuthorizerCertRequest) (*messages.Ack, error)
Request a signed certificate for HTTPS
func (*Comms) RequestEABCredentials ¶
func (r *Comms) RequestEABCredentials(ctx context.Context, msg *pb.EABCredentialRequest) (*pb.EABCredentialResponse, error)
Request ACME key for HTTPS
func (*Comms) RequestToken ¶
Handles reception of reverse-authentication token requests
type Handler ¶
type Handler interface { Authorize(auth *pb.AuthorizerAuth, ipAddr string) (err error) RequestCert(msg *pb.AuthorizerCertRequest) (*messages.Ack, error) RequestEABCredentials(msg *pb.EABCredentialRequest) (*pb.EABCredentialResponse, 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) Authorize ¶
func (s *Implementation) Authorize(auth *pb.AuthorizerAuth, ipAddr string) (err error)
Authorizes a node to talk to permissioning
func (*Implementation) RequestCert ¶
func (s *Implementation) RequestCert(msg *pb.AuthorizerCertRequest) (*messages.Ack, error)
Request a signed certificate for HTTPS
func (*Implementation) RequestEABCredentials ¶
func (s *Implementation) RequestEABCredentials(msg *pb.EABCredentialRequest) (*pb.EABCredentialResponse, error)
Request ACME key for HTTPS