utils

package
v1.6.0-beta24 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: Apache-2.0 Imports: 26 Imported by: 16

Documentation

Index

Constants

View Source
const (
	MetadataPluginName = "envoy.grpc_credentials.file_based_metadata"
)

Variables

View Source
var (
	TlsVersionNotFoundError = func(v v1.SslParameters_ProtocolVersion) error {
		return eris.Errorf("tls version %v not found", v)
	}

	SslSecretNotFoundError = func(err error) error {
		return eris.Wrapf(err, "SSL secret not found")
	}

	NotTlsSecretError = func(ref *core.ResourceRef) error {
		return eris.Errorf("%v is not a TLS secret", ref)
	}

	NoCertificateFoundError = eris.New("no certificate information found")

	MissingValidationContextError = eris.Errorf("must provide validation context name if verifying SAN")

	RootCaMustBeProvidedError = eris.Errorf("a root_ca must be provided if verify_subject_alt_name is not empty")
)
View Source
var (
	InvalidRouteActionError = errors.New("cannot use this plugin on non-Route_Route route actions")
)

Functions

func AnyToMessage added in v1.5.0

func AnyToMessage(a *pany.Any) (proto.Message, error)

func EnsureRouteAction added in v0.18.22

func EnsureRouteAction(out *envoy_config_route_v3.Route) error

func EnvoyPathAsString added in v1.0.0

func EnvoyPathAsString(matcher *envoy_config_route_v3.RouteMatch) string

func FilterLogLevel added in v0.19.2

func FilterLogLevel(r io.ReadCloser, level LogLevel) strings.Builder

Filter JSON logs with level

func GogoMessageToAnyGoProto added in v1.5.0

func GogoMessageToAnyGoProto(msg proto.Message) (*pany.Any, error)

gogoprotos converted directly to goproto any can't be marshalled unless you wrap the contents of the gogoproto in a typed struct

func MessageToAny added in v1.5.0

func MessageToAny(msg proto.Message) (*pany.Any, error)

func MustAnyToMessage added in v1.5.0

func MustAnyToMessage(a *pany.Any) proto.Message

func MustGogoMessageToAnyGoProto added in v1.5.0

func MustGogoMessageToAnyGoProto(msg proto.Message) *pany.Any

gogoprotos converted directly to goproto any can't be marshalled unless you wrap the contents of the gogoproto in a typed struct

func MustMessageToAny added in v1.5.0

func MustMessageToAny(msg proto.Message) *pany.Any

func NewSslConfigTranslator

func NewSslConfigTranslator() *sslConfigTranslator

func PathAsString

func PathAsString(matcher *matchers.Matcher) string

func SanitizeForEnvoy added in v0.14.0

func SanitizeForEnvoy(ctx context.Context, resourceName, resourceTypeName string) string

func SortGatewayRoutesByPath added in v0.18.32

func SortGatewayRoutesByPath(routes []*gatewayv1.Route)

func SortRoutesByPath

func SortRoutesByPath(routes []*v1.Route)

Matchers sort according to the following rules: 1. exact path < regex path < prefix path 2. lexicographically greater path string < lexicographically greater path string

Types

type CertSource

type CertSource interface {
	GetSecretRef() *core.ResourceRef
	GetSslFiles() *v1.SSLFiles
	GetSds() *v1.SDSConfig
	GetVerifySubjectAltName() []string
	GetParameters() *v1.SslParameters
	GetAlpnProtocols() []string
}

type LogLevel added in v0.19.2

type LogLevel int8

A Level is a logging priority. Higher levels are more important.

const (
	LogLevelInfo LogLevel = iota - 1
	LogLevelWarn
	LogLevelError
	LogLevelAll
)

func (LogLevel) String added in v0.19.2

func (l LogLevel) String() string

String returns a lower-case ASCII representation of the log level.

type SslConfigTranslator

type SslConfigTranslator interface {
	ResolveUpstreamSslConfig(secrets v1.SecretList, uc *v1.UpstreamSslConfig) (*envoyauth.UpstreamTlsContext, error)
	ResolveDownstreamSslConfig(secrets v1.SecretList, dc *v1.SslConfig) (*envoyauth.DownstreamTlsContext, error)
	ResolveCommonSslConfig(cs CertSource, secrets v1.SecretList, mustHaveCert bool) (*envoyauth.CommonTlsContext, error)
}

Directories

Path Synopsis
Package mock_utils is a generated GoMock package.
Package mock_utils is a generated GoMock package.

Jump to

Keyboard shortcuts

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