Documentation ¶
Overview ¶
Package envoyconf generates the envoyconfiguration for listeners, virtual hosts, routes, clusters, and endpoints.
Index ¶
- Constants
- func CreateAwsLambdaCluster(conf *config.Config) (*clusterv3.Cluster, []*corev3.Address, error)
- func CreateHealthEndpoint() *routev3.Route
- func CreateJwksEndpoint() *routev3.Route
- func CreateListenersWithRds() []*listenerv3.Listener
- func CreateLuaCluster(interceptorCerts map[string][]byte, endpoint model.InterceptEndpoint) (*clusterv3.Cluster, []*corev3.Address, error)
- func CreateReadyEndpoint() *routev3.Route
- func CreateRoutesConfigForRds(vHosts []*routev3.VirtualHost) *routev3.RouteConfiguration
- func CreateRoutesWithClusters(mgwSwagger model.MgwSwagger, upstreamCerts map[string][]byte, ...) (routesP []*routev3.Route, clustersP []*clusterv3.Cluster, ...)
- func CreateTokenRoute() *routev3.Route
- func CreateTracingCluster(conf *config.Config) (*clusterv3.Cluster, []*corev3.Address, error)
- func CreateVirtualHosts(vhostToRouteArrayMap map[string][]*routev3.Route) []*routev3.VirtualHost
- type CombinedTemplateValues
- type WireLogValues
Constants ¶
const ( APILevelInterceptor string = "api" ResourceLevelInterceptor string = "resource" OperationLevelInterceptor string = "operation" )
interceptor levels
const ( // Azure tracer's name TracerTypeAzure = "azure" TracerTypeOtlp = "otlp" )
tracing configuration constants
Variables ¶
This section is empty.
Functions ¶
func CreateAwsLambdaCluster ¶
CreateAwsLambdaCluster creates AWS Lambda cluster configuration.
func CreateHealthEndpoint ¶
CreateHealthEndpoint generates a route for the jwt /health endpoint Replies with direct response.
func CreateJwksEndpoint ¶
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 ¶
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 ¶
CreateTokenRoute generates a route for the jwt /testkey endpoint
func CreateTracingCluster ¶
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