plugin

package
v0.0.0-...-865e90e Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ListenerProtocolUnknown is an unknown type of listener.
	ListenerProtocolUnknown = iota
	// ListenerProtocolTCP is a TCP listener.
	ListenerProtocolTCP
	// ListenerProtocolHTTP is an HTTP listener.
	ListenerProtocolHTTP

	// Authn is the name of the authentication plugin passed through the command line
	Authn = "authn"
	// Authz is the name of the rbac plugin passed through the command line
	Authz = "authz"
	// Envoyfilter is the name of the envoyfilter plugin passed through the command line
	Envoyfilter = "envoyfilter"
	// Health is the name of the health plugin passed through the command line
	Health = "health"
	// Mixer is the name of the mixer plugin passed through the command line
	Mixer = "mixer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterChain

type FilterChain struct {
	// HTTP is the set of HTTP filters for this filter chain
	HTTP []*http_conn.HttpFilter
	// TCP is the set of network (TCP) filters for this filter chain.
	TCP []listener.Filter
}

FilterChain describes a set of filters (HTTP or TCP) with a shared TLS context.

type InputParams

type InputParams struct {
	// ListenerProtocol is the protocol/class of listener (TCP, HTTP etc.). Must be set.
	ListenerProtocol ListenerProtocol
	// Env is the model environment. Must be set.
	Env *model.Environment
	// Node is the node the response is for.
	Node *model.Proxy
	// ProxyInstances is a slice of all proxy service instances in the mesh.
	ProxyInstances []*model.ServiceInstance
	// ServiceInstance is the service instance colocated with the listener (applies to sidecar).
	ServiceInstance *model.ServiceInstance
	// Service is the service colocated with the listener (applies to sidecar).
	// For outbound TCP listeners, it is the destination service.
	Service *model.Service
	// Port is the port for which the listener is being built
	// For outbound/inbound sidecars this is the service port (not endpoint port)
	// For inbound listener on gateway, this is the gateway server port
	Port *model.Port
}

InputParams is a set of values passed to Plugin callback methods. Not all fields are guaranteed to be set, it's up to the callee to validate required fields are set and emit error if they are not. These are for reading only and should not be modified.

type ListenerProtocol

type ListenerProtocol int

ListenerProtocol is the protocol associated with the listener.

func ModelProtocolToListenerProtocol

func ModelProtocolToListenerProtocol(protocol model.Protocol) ListenerProtocol

ModelProtocolToListenerProtocol converts from a model.Protocol to its corresponding plugin.ListenerProtocol

type MutableObjects

type MutableObjects struct {
	// Listener is the listener being built. Must be initialized before Plugin methods are called.
	Listener *xdsapi.Listener

	// FilterChains is the set of filter chains that will be attached to Listener
	FilterChains []FilterChain
}

MutableObjects is a set of objects passed to On*Listener callbacks. Fields may be nil or empty. Any lists should not be overridden, but rather only appended to. Non-list fields may be mutated; however it's not recommended to do this since it can affect other plugins in the chain in unpredictable ways.

type Plugin

type Plugin interface {
	// OnOutboundListener is called whenever a new outbound listener is added to the LDS output for a given service.
	// Can be used to add additional filters on the outbound path.
	OnOutboundListener(in *InputParams, mutable *MutableObjects) error

	// OnInboundListener is called whenever a new listener is added to the LDS output for a given service
	// Can be used to add additional filters.
	OnInboundListener(in *InputParams, mutable *MutableObjects) error

	// OnOutboundCluster is called whenever a new cluster is added to the CDS output.
	OnOutboundCluster(env model.Environment, node model.Proxy, service *model.Service, servicePort *model.Port,
		cluster *xdsapi.Cluster)

	// OnInboundCluster is called whenever a new cluster is added to the CDS output.
	OnInboundCluster(env model.Environment, node model.Proxy, service *model.Service, servicePort *model.Port,
		cluster *xdsapi.Cluster)

	// OnOutboundRouteConfiguration is called whenever a new set of virtual hosts (a set of virtual hosts with routes) is
	// added to RDS in the outbound path.
	OnOutboundRouteConfiguration(in *InputParams, routeConfiguration *xdsapi.RouteConfiguration)

	// OnInboundRouteConfiguration is called whenever a new set of virtual hosts are added to the inbound path.
	OnInboundRouteConfiguration(in *InputParams, routeConfiguration *xdsapi.RouteConfiguration)
}

Plugin is called during the construction of a xdsapi.Listener which may alter the Listener in any way. Examples include AuthenticationPlugin that sets up mTLS authentication on the inbound Listener and outbound Cluster, the mixer plugin that sets up policy checks on the inbound listener, etc.

Directories

Path Synopsis
Package authz converts Istio RBAC (role-based-access-control) policies (ServiceRole and ServiceRoleBinding) to corresponding filter config that is used by the envoy RBAC filter to enforce access control to the service co-located with envoy.
Package authz converts Istio RBAC (role-based-access-control) policies (ServiceRole and ServiceRoleBinding) to corresponding filter config that is used by the envoy RBAC filter to enforce access control to the service co-located with envoy.
Package registry represents a registry of plugins that can be used by a config generator.
Package registry represents a registry of plugins that can be used by a config generator.

Jump to

Keyboard shortcuts

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