peer

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertsConsumer added in v0.3.0

type CertsConsumer interface {
	SetPeerCertificates(parsedCertData *tls.ParsedCertData, rawCertData *tls.RawCertData) error
}

CertsConsumer represents a consumer of peer TLS certificates.

type CertsWatcher added in v0.3.0

type CertsWatcher struct {
	// contains filtered or unexported fields
}

CertsWatcher watches certificate updates.

func NewWatcher added in v0.3.0

func NewWatcher(caPath, certPath, keyPath string) *CertsWatcher

NewWatcher returns a new certificate files watcher.

func (*CertsWatcher) AddConsumer added in v0.3.0

func (w *CertsWatcher) AddConsumer(consumer CertsConsumer)

AddConsumer adds a new peer certificates consumer. This function is not thread-safe.

func (*CertsWatcher) GracefulStop added in v0.3.0

func (w *CertsWatcher) GracefulStop() error

GracefulStop does a graceful stop of the watcher.

func (*CertsWatcher) Name added in v0.3.0

func (w *CertsWatcher) Name() string

Name of the watcher.

func (*CertsWatcher) ReadCertsAndUpdateConsumers added in v0.3.0

func (w *CertsWatcher) ReadCertsAndUpdateConsumers() error

ReadCertsAndUpdateConsumers reads the peer certificates and updates the consumers.

func (*CertsWatcher) Start added in v0.3.0

func (w *CertsWatcher) Start() error

Start the certs watcher.

func (*CertsWatcher) Stop added in v0.3.0

func (w *CertsWatcher) Stop() error

Stop the watcher.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client for accessing a remote peer.

func NewClient

func NewClient(peer *v1alpha1.Peer, tlsConfig *tls.Config) *Client

NewClient returns a new Peer API client.

func (*Client) Authorize

func (c *Client) Authorize(req *api.AuthorizationRequest) (string, error)

Authorize a request for accessing a peer exported service, yielding an access token.

func (*Client) GetHeartbeat

func (c *Client) GetHeartbeat() error

GetHeartbeat get a heartbeat from other peers.

func (*Client) Peer added in v0.3.0

func (c *Client) Peer() *v1alpha1.Peer

Peer object this client corresponds to.

type RemoteServerAuthorizationResponse

type RemoteServerAuthorizationResponse struct {
	// ServiceExists is true if the requested service exists.
	ServiceExists bool
	// Allowed is true if the request is allowed.
	Allowed bool
	// AccessToken is a token that allows accessing the requested service.
	AccessToken string
}

RemoteServerAuthorizationResponse represents an authorization response received from a remote controlplane server.

Jump to

Keyboard shortcuts

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