envoyconf

package
v0.0.0-...-0c1943d Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Overview

Package envoyconf generates the envoyconfiguration for listeners, virtual hosts, routes, clusters, and endpoints.

Index

Constants

View Source
const (
	APILevelInterceptor       string = "api"
	ResourceLevelInterceptor  string = "resource"
	OperationLevelInterceptor string = "operation"
)

interceptor levels

View Source
const (

	// Azure tracer's name
	TracerTypeAzure = "azure"
	TracerTypeOtlp  = "otlp"
)

tracing configuration constants

Variables

This section is empty.

Functions

func CreateAwsLambdaCluster

func CreateAwsLambdaCluster(conf *config.Config) (*clusterv3.Cluster, []*corev3.Address, error)

CreateAwsLambdaCluster creates AWS Lambda cluster configuration.

func CreateHealthEndpoint

func CreateHealthEndpoint() *routev3.Route

CreateHealthEndpoint generates a route for the jwt /health endpoint Replies with direct response.

func CreateJwksEndpoint

func CreateJwksEndpoint() *routev3.Route

CreateJwksEndpoint generates a route for JWKS /.wellknown/jwks endpoint

func CreateListenersWithRds

func CreateListenersWithRds() []*listenerv3.Listener

CreateListenersWithRds create two listeners or one listener with the Route Configuration stated as RDS. (routes are not assigned directly to the listener.) RouteConfiguration name is assigned using its default value. Route Configuration would be resolved via ADS.

If SecuredListenerPort and ListenerPort both are mentioned, two listeners would be added. If neither of the two properies are assigned with non-zero values, adapter would panic.

HTTPConnectionManager with HTTP Filters, Accesslog configuration, TransportSocket Configuration is included within the implementation.

Listener Address, ListenerPort Value, SecuredListener Address, and SecuredListenerPort Values are fetched from the configuration accordingly.

The relevant private keys and certificates (for securedListener) are fetched from the filepath mentioned in the adapter configuration. These certificate, key values are added as inline records (base64 encoded).

func CreateLuaCluster

func CreateLuaCluster(interceptorCerts map[string][]byte, endpoint model.InterceptEndpoint) (*clusterv3.Cluster, []*corev3.Address, error)

CreateLuaCluster creates lua cluster configuration.

func CreateReadyEndpoint

func CreateReadyEndpoint() *routev3.Route

CreateReadyEndpoint generates a route for the router /ready endpoint Replies with direct response.

func CreateRoutesConfigForRds

func CreateRoutesConfigForRds(vHosts []*routev3.VirtualHost) *routev3.RouteConfiguration

CreateRoutesConfigForRds generates the default RouteConfiguration. Only the provided virtual hosts will be assigned inside the configuration. This is used to provide the configuration for RDS.

func CreateRoutesWithClusters

func CreateRoutesWithClusters(mgwSwagger model.MgwSwagger, upstreamCerts map[string][]byte, interceptorCerts map[string][]byte, vHost string, organizationID string) (routesP []*routev3.Route,
	clustersP []*clusterv3.Cluster, addressesP []*corev3.Address, err error)

CreateRoutesWithClusters creates envoy routes along with clusters and endpoint instances. This creates routes for all the swagger resources and link to clusters. Create clusters for api level production and sandbox endpoints. If a resource has resource level endpoint, it create another cluster and link it. If resources doesn't has resource level endpoints, those clusters are linked to the api level clusters.

First set of routes, clusters, addresses represents the production endpoints related configurations. Next set represents the sandbox endpoints related configurations.

func CreateTokenRoute

func CreateTokenRoute() *routev3.Route

CreateTokenRoute generates a route for the jwt /testkey endpoint

func CreateTracingCluster

func CreateTracingCluster(conf *config.Config) (*clusterv3.Cluster, []*corev3.Address, error)

CreateTracingCluster creates a cluster definition for router's tracing server.

func CreateVirtualHosts

func CreateVirtualHosts(vhostToRouteArrayMap map[string][]*routev3.Route) []*routev3.VirtualHost

CreateVirtualHosts creates VirtualHost configurations for envoy which serves request from the vHost domain. The routes array will be included as the routes for the created virtual host.

Types

type CombinedTemplateValues

type CombinedTemplateValues struct {
	WireLogValues
	interceptor.Interceptor
}

CombinedTemplateValues holds combined values for both WireLogValues properties and Interceptor properties in the same level

type WireLogValues

type WireLogValues struct {
	LogConfig *config.WireLogConfig
}

WireLogValues holds debug logging related template values

Jump to

Keyboard shortcuts

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