resolver

package
v1.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthSSLCert

type AuthSSLCert struct {
	// Secret contains the name of the secret this was fetched from
	Secret string `json:"secret"`
	// CAFileName contains the path to the secrets 'ca.crt'
	CAFileName string `json:"caFilename"`
	// CASHA contains the SHA1 hash of the 'ca.crt' or combinations of (tls.crt, tls.key, tls.crt) depending on certs in secret
	CASHA string `json:"caSha"`
	// CRLFileName contains the path to the secrets 'ca.crl'
	CRLFileName string `json:"crlFileName"`
	// CRLSHA contains the SHA1 hash of the 'ca.crl' file
	CRLSHA string `json:"crlSha"`
	// PemFileName contains the path to the secrets 'tls.crt' and 'tls.key'
	PemFileName string `json:"pemFilename"`
}

AuthSSLCert contains the necessary information to do certificate based authentication of an ingress location

func (*AuthSSLCert) Equal

func (asslc1 *AuthSSLCert) Equal(assl2 *AuthSSLCert) bool

Equal tests for equality between two AuthSSLCert types

type Mock

type Mock struct {
	ConfigMaps map[string]*apiv1.ConfigMap
}

Mock implements the Resolver interface

func (Mock) GetAuthCertificate

func (m Mock) GetAuthCertificate(string) (*AuthSSLCert, error)

GetAuthCertificate resolves a given secret name into an SSL certificate. The secret must contain 3 keys named:

ca.crt: contains the certificate chain used for authentication

func (Mock) GetConfigMap

func (m Mock) GetConfigMap(name string) (*apiv1.ConfigMap, error)

GetConfigMap searches for configMaps contenating the namespace and name using a the character /

func (Mock) GetDefaultBackend

func (m Mock) GetDefaultBackend() defaults.Backend

GetDefaultBackend returns the backend that must be used as default

func (Mock) GetSecret

func (m Mock) GetSecret(string) (*apiv1.Secret, error)

GetSecret searches for secrets contenating the namespace and name using a the character /

func (Mock) GetService

func (m Mock) GetService(string) (*apiv1.Service, error)

GetService searches for services contenating the namespace and name using a the character /

type Resolver

type Resolver interface {
	// GetDefaultBackend returns the backend that must be used as default
	GetDefaultBackend() defaults.Backend

	// GetConfigMap searches for configmap containing the namespace and name usting the character /
	GetConfigMap(string) (*apiv1.ConfigMap, error)

	// GetSecret searches for secrets containing the namespace and name using a the character /
	GetSecret(string) (*apiv1.Secret, error)

	//   ca.crt: contains the certificate chain used for authentication
	//   ca.crl: contains the revocation list used for authentication
	GetAuthCertificate(string) (*AuthSSLCert, error)

	// GetService searches for services containing the namespace and name using a the character /
	GetService(string) (*apiv1.Service, error)
}

Resolver is an interface that knows how to extract information from a controller

Jump to

Keyboard shortcuts

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