grpctransport

package
v0.0.0-...-d08f37e Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigDefaults = &Config{
	Address:                confutil.P("0.0.0.0"),
	DirectCertVerification: confutil.P(true),
}

Functions

func NewGRPCTransport

func NewGRPCTransport(callbacks plugintk.TransportCallbacks) plugintk.TransportAPI

func NewPlugin

func NewPlugin(ctx context.Context) plugintk.PluginBase

Types

type Config

type Config struct {
	// optional remote hostname to return in local transport details
	ExternalHostname *string `json:"externalHostname"`
	// TLS configuration details
	TLS pldconf.TLSConfig `json:"tls"`
	// address to listen on
	Address *string `json:"address"`
	// port to listen on
	Port *int `json:"port"`
	// If true (default) a network can be built by publishing self-signed certs to a registry without a common CA.
	// This disables the default certificate verification chain, and instead performs a direct comparison
	// of the certificate against the registered certificate for the extracted node name.
	DirectCertVerification *bool `json:"directCertVerification,omitempty"`
	// By default directCertVerification will expect the CN of the subject to be the exact registered node name.
	// Optionally certSubjectMatcher can supply a regexp containing a SINGLE CAPTURE GROUP that can be used to extract the name from the subject string
	CertSubjectMatcher *string `json:"certSubjectMatcher,omitempty"`
}

type PublishedTransportDetails

type PublishedTransportDetails struct {
	Endpoint string `json:"endpoint"` // a GRPC target string that other nodes can use to connect to this node
	// A node specific PEM certificate/certificate-set to use to validate the certificate provided by a node
	// - used in direct certificate validation mode only
	// - can be the certificate itself for self-signed
	// - must be the direct parent (not the root of a chain - for that use normal CA verification)
	Issuers string `json:"issuers,omitempty"`
}

This is the JSON structure that any node in the network must share to be connectable by this plugin. We require the local node's registered information to be available at configuration time otherwise we cannot start up.

type Server

type Server interface {
	Start() error
	Stop()
}

Jump to

Keyboard shortcuts

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