authreq

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

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

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

Documentation

Index

Constants

View Source
const DefaultCacheDuration = "200 202 401 5m"

DefaultCacheDuration is the fallback value if no cache duration is provided

Variables

This section is empty.

Functions

func NewParser

NewParser creates a new authentication request annotation parser

func ParseStringToCacheDurations

func ParseStringToCacheDurations(input string) ([]string, error)

ParseStringToCacheDurations parses and validates the provided string into a list of cache durations. It will always return at least one duration (the default duration)

func ValidCacheDuration

func ValidCacheDuration(duration string) bool

ValidCacheDuration checks if the provided string is a valid cache duration spec: [code ...] [time ...]; with: code is an http status code

time must match the time regex and may appear multiple times, e.g. `1h 30m`

func ValidHeader

func ValidHeader(header string) bool

ValidHeader checks is the provided string satisfies the header's name regex

func ValidMethod

func ValidMethod(method string) bool

ValidMethod checks is the provided string a valid HTTP method

Types

type Config

type Config struct {
	URL string `json:"url"`
	// Host contains the hostname defined in the URL
	Host              string            `json:"host"`
	SigninURL         string            `json:"signinUrl"`
	Method            string            `json:"method"`
	ResponseHeaders   []string          `json:"responseHeaders,omitempty"`
	RequestRedirect   string            `json:"requestRedirect"`
	AuthSnippet       string            `json:"authSnippet"`
	AuthCacheKey      string            `json:"authCacheKey"`
	AuthCacheDuration []string          `json:"authCacheDuration"`
	ProxySetHeaders   map[string]string `json:"proxySetHeaders,omitempty"`
}

Config returns external authentication configuration for an Ingress rule

func (*Config) Equal

func (e1 *Config) Equal(e2 *Config) bool

Equal tests for equality between two Config types

Jump to

Keyboard shortcuts

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