options

package
v1.5.3-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 8 Imported by: 1

Documentation

Overview

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

View Source
const MaxRetries uint32 = 255
View Source
const (
	SchemeCloudEntity = "cloudentity"
)

Variables

This section is empty.

Functions

func StringToPtr added in v1.2.0

func StringToPtr(str string) *string

func ToCompactJSON added in v1.2.0

func ToCompactJSON(o interface{}) string

Types

type AuthOptions added in v1.1.0

type AuthOptions struct {
	// OPTIONAL
	// +optional
	OAuth2 *OAuth2 `json:"oauth2,omitempty" yaml:"oauth2,omitempty"`
	// OPTIONAL
	// +optional
	Custom *Custom `json:"custom,omitempty" yaml:"custom,omitempty"`
	// OPTIONAL
	// +optional
	Cloudentity *Cloudentity `json:"cloudentity,omitempty" yaml:"cloudentity,omitempty"`
	// OPTIONAL
	// +optional
	JWT *JWT `json:"jwt,omitempty" yaml:"jwt,omitempty"`
}

+kubebuilder:object:generate=true

func (*AuthOptions) DeepCopy added in v1.3.20

func (in *AuthOptions) DeepCopy() *AuthOptions

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthOptions.

func (*AuthOptions) DeepCopyInto added in v1.3.20

func (in *AuthOptions) DeepCopyInto(out *AuthOptions)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (AuthOptions) String added in v1.2.0

func (o AuthOptions) String() string

func (AuthOptions) Validate added in v1.1.0

func (o AuthOptions) Validate() error

type AuthUpstreamHost added in v1.1.0

type AuthUpstreamHost struct {
	// REQUIRED.
	// +required
	Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"`
	// REQUIRED.
	// +required
	Port uint32 `json:"port,omitempty" yaml:"port,omitempty"`
	// OPTIONAL.
	// +optional
	Path *string `json:"path,omitempty" yaml:"path,omitempty"`
}

+kubebuilder:object:generate=true

func (*AuthUpstreamHost) DeepCopy added in v1.3.20

func (in *AuthUpstreamHost) DeepCopy() *AuthUpstreamHost

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthUpstreamHost.

func (*AuthUpstreamHost) DeepCopyInto added in v1.3.20

func (in *AuthUpstreamHost) DeepCopyInto(out *AuthUpstreamHost)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (AuthUpstreamHost) Validate added in v1.1.0

func (o AuthUpstreamHost) Validate() error

type CORSOptions

type CORSOptions struct {
	Origins       []string `yaml:"origins,omitempty" json:"origins,omitempty"`
	Methods       []string `yaml:"methods,omitempty" json:"methods,omitempty"`
	Headers       []string `yaml:"headers,omitempty" json:"headers,omitempty"`
	ExposeHeaders []string `yaml:"expose_headers,omitempty" json:"expose_headers,omitempty"`

	Credentials *bool `yaml:"credentials,omitempty" json:"credentials,omitempty"`
	MaxAge      int   `yaml:"max_age,omitempty" json:"max_age,omitempty"`
}

func (*CORSOptions) DeepCopy

func (in *CORSOptions) DeepCopy() *CORSOptions

DeepCopy creates a copy of an object

func (CORSOptions) Validate

func (o CORSOptions) Validate() error

type CacheOptions added in v1.1.0

type CacheOptions struct {
	Enabled *bool `json:"enabled" yaml:"enabled"`
	MaxAge  *int  `json:"max_age" yaml:"max_age"`
}

func (CacheOptions) Validate added in v1.1.0

func (o CacheOptions) Validate() error

type ClientSecretRef added in v1.3.2

type ClientSecretRef struct {
	// REQUIRED.
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
	// REQUIRED.
	Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
}

+kubebuilder:object:generate=true

func (*ClientSecretRef) DeepCopy added in v1.3.20

func (in *ClientSecretRef) DeepCopy() *ClientSecretRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientSecretRef.

func (*ClientSecretRef) DeepCopyInto added in v1.3.20

func (in *ClientSecretRef) DeepCopyInto(out *ClientSecretRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (ClientSecretRef) String added in v1.3.2

func (o ClientSecretRef) String() string

func (ClientSecretRef) Validate added in v1.3.2

func (o ClientSecretRef) Validate() error

type Cloudentity added in v1.3.5

type Cloudentity struct {
	// REQUIRED.
	Host AuthUpstreamHost `json:"host,omitempty" yaml:"host,omitempty"`
	// OPTIONAL.
	PathPrefix *string `json:"path_prefix,omitempty" yaml:"path_prefix,omitempty"`
}

+kubebuilder:object:generate=true

func (*Cloudentity) DeepCopy added in v1.3.20

func (in *Cloudentity) DeepCopy() *Cloudentity

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cloudentity.

func (*Cloudentity) DeepCopyInto added in v1.3.20

func (in *Cloudentity) DeepCopyInto(out *Cloudentity)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Cloudentity) String added in v1.3.5

func (o Cloudentity) String() string

func (Cloudentity) Validate added in v1.3.5

func (o Cloudentity) Validate() error

type CookieNames added in v1.2.0

type CookieNames struct {
	// Defaults to BearerToken.
	BearerToken string `json:"bearer_token,omitempty" yaml:"bearer_token,omitempty"`
	// Defaults to OauthHMAC.
	OauthHMAC string `json:"oauth_hmac,omitempty" yaml:"oauth_hmac,omitempty"`
	// Defaults to OauthExpires.
	ExpiresOauth string `json:"oauth_expires,omitempty" yaml:"oauth_expires,omitempty"`
}

CookieNames - By default, OAuth2 filter sets some cookies with the following names: BearerToken, OauthHMAC, and OauthExpires. These cookie names can be customized by setting cookie_names. +kubebuilder:object:generate=true

func (*CookieNames) DeepCopy added in v1.3.20

func (in *CookieNames) DeepCopy() *CookieNames

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CookieNames.

func (*CookieNames) DeepCopyInto added in v1.3.20

func (in *CookieNames) DeepCopyInto(out *CookieNames)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (CookieNames) Validate added in v1.2.0

func (o CookieNames) Validate() error

type Credentials added in v1.2.0

type Credentials struct {
	// REQUIRED.
	ClientID string `json:"client_id,omitempty" yaml:"client_id,omitempty"`
	// REQUIRED, if `client_secret_ref` is not set, i.e., mutually exclusive with `client_secret_ref`.
	ClientSecret *string `json:"client_secret,omitempty" yaml:"client_secret,omitempty"`
	// REQUIRED, if `client_secret` is not set, i.e., mutually exclusive with `client_secret`.
	ClientSecretRef *ClientSecretRef `json:"client_secret_ref,omitempty" yaml:"client_secret_ref,omitempty"`
	// OPTIONAL.
	HmacSecret string `json:"hmac_secret,omitempty" yaml:"hmac_secret,omitempty"`
	// OPTIONAL.
	CookieNames CookieNames `json:"cookie_names,omitempty" yaml:"cookie_names,omitempty"`
}

+kubebuilder:object:generate=true

func (*Credentials) DeepCopy added in v1.3.20

func (in *Credentials) DeepCopy() *Credentials

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Credentials.

func (*Credentials) DeepCopyInto added in v1.3.20

func (in *Credentials) DeepCopyInto(out *Credentials)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Credentials) String added in v1.3.2

func (o Credentials) String() string

func (Credentials) Validate added in v1.2.0

func (o Credentials) Validate() error

type Crunch42 added in v1.5.1

type Crunch42 struct {
	Token ClientSecretRef `yaml:"token,omitempty" json:"token,omitempty"`
}

type Custom added in v1.3.5

type Custom struct {
	// REQUIRED.
	Host AuthUpstreamHost `json:"host,omitempty" yaml:"host,omitempty"`
	// OPTIONAL.
	PathPrefix *string `json:"path_prefix,omitempty" yaml:"path_prefix,omitempty"`
}

+kubebuilder:object:generate=true

func (*Custom) DeepCopy added in v1.3.20

func (in *Custom) DeepCopy() *Custom

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Custom.

func (*Custom) DeepCopyInto added in v1.3.20

func (in *Custom) DeepCopyInto(out *Custom)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Custom) String added in v1.3.5

func (o Custom) String() string

func (Custom) Validate added in v1.3.5

func (o Custom) Validate() error

type HTTPMethod

type HTTPMethod string

HTTPMethod defines HTTP Method like GET, POST...

type Host

type Host string

Host is a vHost (and domain name) definition that is used during request routing. Could be wildcard ("*" - all vhosts), prefix/suffix wildcard (*-example.com, example.*, but not both *example*), or simple domain (www.example.com)

func (Host) Validate

func (h Host) Validate() error

type JWT added in v1.5.0

type JWT struct {
	// Providers to use for verifying JSON Web Tokens (JWTs) on the virtual host.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinItems=1
	JWTProviders []JWTProvider `json:"providers" yaml:"providers"`
}

+kubebuilder:object:generate=true

func (*JWT) DeepCopy added in v1.5.0

func (in *JWT) DeepCopy() *JWT

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JWT.

func (*JWT) DeepCopyInto added in v1.5.0

func (in *JWT) DeepCopyInto(out *JWT)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (JWT) String added in v1.5.0

func (o JWT) String() string

func (JWT) Validate added in v1.5.0

func (o JWT) Validate() error

type JWTProvider added in v1.5.0

type JWTProvider struct {
	// Unique name for the provider.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name" yaml:"name"`

	// Whether the provider should apply to all
	// routes in the HTTPProxy/its includes by
	// default. At most one provider can be marked
	// as the default. If no provider is marked
	// as the default, individual routes must explicitly
	// identify the provider they require.
	// +optional
	Default bool `json:"default,omitempty" yaml:"default,omitempty"`

	// Issuer that JWTs are required to have in the "iss" field.
	// If not provided, JWT issuers are not checked.
	// +optional
	Issuer string `json:"issuer,omitempty" yaml:"issuer,omitempty"`

	// Audiences that JWTs are allowed to have in the "aud" field.
	// If not provided, JWT audiences are not checked.
	// +optional
	Audiences []string `json:"audiences,omitempty" yaml:"audiences,omitempty"`

	// Remote JWKS to use for verifying JWT signatures.
	// The URI for the JWKS.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	JWKS string `json:"jwks" yaml:"jwks"`

	// Whether the JWT should be forwarded to the backend
	// service after successful verification. By default,
	// the JWT is not forwarded.
	// +optional
	ForwardJWT bool `json:"forwardJWT,omitempty" yaml:"forwardJWT,omitempty"`
}

JWTProvider defines how to verify JWTs on requests. +kubebuilder:object:generate=true

func (*JWTProvider) DeepCopy added in v1.5.0

func (in *JWTProvider) DeepCopy() *JWTProvider

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JWTProvider.

func (*JWTProvider) DeepCopyInto added in v1.5.0

func (in *JWTProvider) DeepCopyInto(out *JWTProvider)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (JWTProvider) String added in v1.5.0

func (o JWTProvider) String() string

func (JWTProvider) Validate added in v1.5.0

func (o JWTProvider) Validate() error

type MockingOptions

type MockingOptions struct {
	Enabled *bool `json:"enabled" yaml:"enabled"`
}

func (MockingOptions) Validate

func (o MockingOptions) Validate() error

type OAuth2 added in v1.2.0

type OAuth2 struct {
	// Endpoint on the authorization server to retrieve the access token from.
	// REQUIRED.
	TokenEndpoint string `json:"token_endpoint,omitempty" yaml:"token_endpoint,omitempty"`
	// The endpoint redirect to for authorization in response to unauthorized requests.
	// REQUIRED.
	AuthorizationEndpoint string `json:"authorization_endpoint,omitempty" yaml:"authorization_endpoint,omitempty"`
	// Credentials used for OAuth.
	// REQUIRED.
	Credentials Credentials `json:"credentials,omitempty" yaml:"credentials,omitempty"`
	// The redirect URI passed to the authorization endpoint. Supports header formatting tokens.
	// REQUIRED.
	RedirectURI string `json:"redirect_uri,omitempty" yaml:"redirect_uri,omitempty"`
	// Matching criteria used to determine whether a path appears to be the result of a redirect from the authorization server.
	// REQUIRED.
	RedirectPathMatcher string `json:"redirect_path_matcher,omitempty" yaml:"redirect_path_matcher,omitempty"`
	// The path to sign a user out, clearing their credential cookies.
	// REQUIRED.
	SignoutPath string `json:"signout_path,omitempty" yaml:"signout_path,omitempty"`
	// Forward the OAuth token as a Bearer to upstream web service.
	// When the authn server validates the client and returns an authorization token back to the OAuth filter, no matter what format that token is, if forward_bearer_token is set to true the filter will send over a cookie named BearerToken to the upstream. Additionally, the Authorization header will be populated with the same value.
	// REQUIRED.
	ForwardBearerToken bool `json:"forward_bearer_token,omitempty" yaml:"forward_bearer_token,omitempty"`
	// Optional list of OAuth scopes to be claimed in the authorization request.
	// If not specified, defaults to “user” scope. OAuth RFC https://tools.ietf.org/html/rfc6749#section-3.3.
	// OPTIONAL.
	AuthScopes []string `json:"auth_scopes,omitempty" yaml:"auth_scopes,omitempty"`
	// Optional resource parameter for authorization request RFC: https://tools.ietf.org/html/rfc8707.
	// OPTIONAL.
	Resources []string `json:"resources,omitempty" yaml:"resources,omitempty"`
	// Any request that matches any of the provided matchers will be passed through without OAuth validation.
	// OPTIONAL.
	PassThroughMatcher []string `json:"pass_through_matcher,omitempty" yaml:"pass_through_matcher,omitempty"`
}

+kubebuilder:object:generate=true

func (*OAuth2) DeepCopy added in v1.3.20

func (in *OAuth2) DeepCopy() *OAuth2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OAuth2.

func (*OAuth2) DeepCopyInto added in v1.3.20

func (in *OAuth2) DeepCopyInto(out *OAuth2)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (OAuth2) String added in v1.2.0

func (o OAuth2) String() string

func (OAuth2) Validate added in v1.2.0

func (o OAuth2) Validate() error

type Options

type Options struct {
	// Top root of the configuration (top x-kusk settings) provides configuration for all paths/methods
	// Overrides per method+path are in OperationFinalSubOptions map
	SubOptions
	// Host (Host header) to serve for
	// Multiple are possible
	// Hosts are not overridable per path/method intentionally since
	// there is no valid use case for such override per path in the same OpenAPI config
	Hosts []Host `yaml:"hosts,omitempty" json:"hosts,omitempty"`

	// OperationFinalSubOptions is the map of method+path key with value - merged root suboptions + path suboptions + operation suboptions
	// They are filled during the parsing of OpenAPI with extension
	OperationFinalSubOptions map[string]SubOptions `yaml:"-" json:"-"`
}

Options is the container for all parsed from the supplied configuration OpenAPI x-kusk options and any additional options

func (*Options) FillDefaults

func (o *Options) FillDefaults()

func (Options) Validate

func (o Options) Validate() error

type PathOptions

type PathOptions struct {
	// Prefix is the preceding prefix for the route (i.e. /your-prefix/here/rest/of/the/route).
	Prefix string `yaml:"prefix,omitempty" json:"prefix,omitempty"`
}

func (PathOptions) Validate

func (o PathOptions) Validate() error

type QoSOptions

type QoSOptions struct {
	// Retries define how many times to retry calling the backend
	Retries uint32 `yaml:"retries,omitempty" json:"retries,omitempty"`
	// RequestTimeout is total request timeout
	RequestTimeout uint32 `yaml:"request_timeout,omitempty" json:"request_timeout,omitempty"`
	// IdleTimeout is timeout for idle connection
	IdleTimeout uint32 `yaml:"idle_timeout,omitempty" json:"idle_timeout,omitempty"`
}

func (QoSOptions) Validate

func (o QoSOptions) Validate() error

type RateLimitOptions

type RateLimitOptions struct {
	RequestsPerUnit uint32 `json:"requests_per_unit,omitempty" yaml:"requests_per_unit,omitempty"`
	Unit            string `json:"unit,omitempty" yaml:"unit,omitempty"`
	PerConnection   bool   `json:"per_connection,omitempty" yaml:"per_connection,omitempty"`
	ResponseCode    uint32 `yaml:"response_code,omitempty" json:"response_code,omitempty"`
}

func (RateLimitOptions) Validate

func (o RateLimitOptions) Validate() error

type RedirectOptions

type RedirectOptions struct {
	// http|https
	SchemeRedirect string `yaml:"scheme_redirect,omitempty" json:"scheme_redirect,omitempty"`

	HostRedirect string `yaml:"host_redirect,omitempty" json:"host_redirect,omitempty"`
	PortRedirect uint32 `yaml:"port_redirect,omitempty" json:"port_redirect,omitempty"`

	// mutually exclusive with rewrite regex redirect
	PathRedirect string `yaml:"path_redirect,omitempty" json:"path_redirect,omitempty"`
	// mutually exclusive with path redirect
	RewriteRegex *RewriteRegex `yaml:"rewrite_regex,omitempty" json:"rewrite_regex,omitempty"`

	ResponseCode uint32 `yaml:"response_code,omitempty" json:"response_code,omitempty"`
	StripQuery   *bool  `yaml:"strip_query,omitempty" json:"strip_query,omitempty"`
}

RedirectOptions provide http redirects see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto#envoy-v3-api-msg-config-route-v3-redirectaction

func (*RedirectOptions) DeepCopy

func (in *RedirectOptions) DeepCopy() *RedirectOptions

DeepCopy is used to copy

func (RedirectOptions) MutuallyExlusivePathRedirectCheck

func (o RedirectOptions) MutuallyExlusivePathRedirectCheck(value interface{}) error

MutuallyExclusivePathRedirectCheck returns error if both path redirect and regex substitution redirect are enabled

func (RedirectOptions) Validate

func (o RedirectOptions) Validate() error

type RemoteJWKS added in v1.5.0

type RemoteJWKS struct {
	// The URI for the JWKS.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	URI string `json:"uri" yaml:"uri"`

	// UpstreamValidation defines how to verify the JWKS's TLS certificate.
	// +optional
	UpstreamValidation *UpstreamValidation `json:"validation,omitempty" yaml:"validation,omitempty"`

	// How long to wait for a response from the URI.
	// If not specified, a default of 1s applies.
	// +optional
	//// +kubebuilder:validation:Pattern=`^(((\d*(\.\d*)?h)|(\d*(\.\d*)?m)|(\d*(\.\d*)?s)|(\d*(\.\d*)?ms)|(\d*(\.\d*)?us)|(\d*(\.\d*)?µs)|(\d*(\.\d*)?ns))+)$`
	// Timeout string `json:"timeout,omitempty"`
	Timeout *time.Duration `json:"timeout,omitempty" yaml:"timeout,omitempty"`

	// How long to cache the JWKS locally. If not specified,
	// Envoy's default of 5m applies.
	// +optional
	//// +kubebuilder:validation:Pattern=`^(((\d*(\.\d*)?h)|(\d*(\.\d*)?m)|(\d*(\.\d*)?s)|(\d*(\.\d*)?ms)|(\d*(\.\d*)?us)|(\d*(\.\d*)?µs)|(\d*(\.\d*)?ns))+)$`
	// CacheDuration string `json:"cacheDuration,omitempty"`
	CacheDuration *time.Duration `json:"cacheDuration,omitempty" yaml:"cacheDuration,omitempty"`

	// The DNS IP address resolution policy for the JWKS URI.
	// When configured as "v4", the DNS resolver will only perform a lookup
	// for addresses in the IPv4 family. If "v6" is configured, the DNS resolver
	// will only perform a lookup for addresses in the IPv6 family.
	// If "auto" is configured, the DNS resolver will first perform a lookup
	// for addresses in the IPv6 family and fallback to a lookup for addresses
	// in the IPv4 family. If not specified, the Contour-wide setting defined
	// in the config file or ContourConfiguration applies (defaults to "auto").
	//
	// See https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/cluster.proto.html#envoy-v3-api-enum-config-cluster-v3-cluster-dnslookupfamily
	// for more information.
	// +optional
	// +kubebuilder:validation:Enum=auto;v4;v6
	DNSLookupFamily string `json:"dnsLookupFamily,omitempty" yaml:"dnsLookupFamily,omitempty"`
}

RemoteJWKS defines how to fetch a JWKS from an HTTP endpoint. +kubebuilder:object:generate=true

func (*RemoteJWKS) DeepCopy added in v1.5.0

func (in *RemoteJWKS) DeepCopy() *RemoteJWKS

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteJWKS.

func (*RemoteJWKS) DeepCopyInto added in v1.5.0

func (in *RemoteJWKS) DeepCopyInto(out *RemoteJWKS)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (RemoteJWKS) String added in v1.5.0

func (o RemoteJWKS) String() string

func (RemoteJWKS) Validate added in v1.5.0

func (o RemoteJWKS) Validate() error

type RequestValidationOptions

type RequestValidationOptions struct {
	Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
}

type RewriteRegex

type RewriteRegex struct {
	Pattern      string `yaml:"pattern,omitempty" json:"pattern"`
	Substitution string `yaml:"substitution,omitempty" json:"substitution"`
}

RewriteRegex is used during the redirects and paths mangling

func (RewriteRegex) Validate

func (r RewriteRegex) Validate() error

type Security added in v1.5.1

type Security struct {
	Crunch42 *Crunch42 `yaml:"42crunch,omitempty" json:"42crunch,omitempty"`
}

Security is used for running security checks on OpenAPI specs

type StaticOperationSubOptions

type StaticOperationSubOptions map[HTTPMethod]*SubOptions

StaticOperationSubOptions maps method (get, post) to related static subopts

type StaticOptions

type StaticOptions struct {
	// Host (Host header) to serve for.
	// Multiple are possible. Each Host creates Envoy's Virtual Host with Domains set to only that Host and routes specified in config.
	// I.e. multiple hosts - multiple vHosts with Domains=Host and with the same routes.
	// Note on Host header matching in Envoy:
	/* courtesy of @hzxuzhonghu (https://github.com/istio/istio/issues/35826#issuecomment-957184380)
	The virtual hosts order does not influence the domain matching order
	It is the domain matters
	Domain search order:
	1. Exact domain names: www.foo.com.
	2. Suffix domain wildcards: *.foo.com or *-bar.foo.com.
	3. Prefix domain wildcards: foo.* or foo-*.
	4. Special wildcard * matching any domain. (edited)
	*/
	Hosts []Host

	Auth *AuthOptions `json:"auth,omitempty" yaml:"auth,omitempty"`
	// Paths allow to specify a specific set of option for a given path and a method.
	// This is a 2-dimensional map[path][method].
	// The map key is the path and the next map key is a HTTP method (operation).
	// This closely follows OpenAPI structure, but was chosen only due to the only way to specify different routing action for
	// different methods in one YAML document.
	// E.g. if GET / goes to frontend, and POST / goes to API, you cannot specify path as a key with the different methods twice in one YAML file.
	//
	// Paths is a multidimensional map of path / method to the routing rules.
	// It should just contain the route path, "/".
	Paths map[string]StaticOperationSubOptions `yaml:"paths,omitempty" json:"paths,omitempty"`
	// Upstream is a set of options of a target service to receive traffic.
	Upstream UpstreamOptions `json:"upstream" yaml:"upstream"`
}

StaticOptions define options for single routing config - domain names to use and path to setup routes for.

func (*StaticOptions) FillDefaultsAndValidate

func (o *StaticOptions) FillDefaultsAndValidate() error

func (StaticOptions) Validate

func (o StaticOptions) Validate() error

type SubOptions

type SubOptions struct {
	Disabled *bool `yaml:"disabled,omitempty" json:"disabled,omitempty"`
	// Upstream is a set of options of a target service to receive traffic.
	Upstream *UpstreamOptions `yaml:"upstream,omitempty" json:"upstream,omitempty"`
	// Upstreams is collection of upstream options with additional properties for traffic splitting
	Upstreams []UpstreamOptions `yaml:"upstreams,omitempty" json:"upstreams,omitempty"`
	// Redirect specifies thre redirect optins, mutually exclusive with Upstream
	Redirect *RedirectOptions `yaml:"redirect,omitempty" json:"redirect,omitempty"`
	// Path is a set of options to configure service endpoints paths.
	Path          *PathOptions       `yaml:"path,omitempty" json:"path,omitempty"`
	QoS           *QoSOptions        `yaml:"qos,omitempty" json:"qos,omitempty"`
	CORS          *CORSOptions       `yaml:"cors,omitempty" json:"cors,omitempty"`
	Websocket     *bool              `json:"websocket,omitempty" yaml:"websocket,omitempty"`
	Validation    *ValidationOptions `json:"validation,omitempty" yaml:"validation,omitempty"`
	Mocking       *MockingOptions    `json:"mocking,omitempty" yaml:"mocking,omitempty"`
	RateLimit     *RateLimitOptions  `json:"rate_limit,omitempty" yaml:"rate_limit,omitempty"`
	Cache         *CacheOptions      `json:"cache,omitempty" yaml:"cache,omitempty"`
	PublicAPIPath string             `json:"public_api_path,omitempty" yaml:"public-api-path,omitempty"`
	Auth          *AuthOptions       `json:"auth,omitempty" yaml:"auth,omitempty"`
	Security      *Security          `json:"security,omitempty" yaml:"security,omitempty"`
}

SubOptions allow user to overwrite certain options at path/operation level using x-kusk extension

func (*SubOptions) MergeInSubOptions

func (o *SubOptions) MergeInSubOptions(in *SubOptions)

MergeInSubOptions handles merging other SubOptions (usually - upper level in root/path/method hierarchy)

func (SubOptions) Validate

func (o SubOptions) Validate() error

type UpstreamHost

type UpstreamHost struct {
	// Hostname is the upstream hostname, without port.
	Hostname string `yaml:"hostname" json:"hostname"`

	// Port is the upstream port.
	Port uint32 `yaml:"port" json:"port"`

	// Weight indicates the percentage of traffic to be sent to the given upstream.
	Weight int `yaml:"weight,omitempty" json:"weight,omitempty"`
}

UpstreamHost defines any DNS hostname with port that we can proxy to, even outside of the cluster

func (UpstreamHost) Validate

func (o UpstreamHost) Validate() error

type UpstreamOptions

type UpstreamOptions struct {
	Host    *UpstreamHost    `yaml:"host,omitempty" json:"host,omitempty"`
	Service *UpstreamService `yaml:"service,omitempty" json:"service,omitempty"`

	// Rewrite is the pattern (regex) and a substitution string that will change URL when request is being forwarded
	// to the upstream service.
	// e.g. given that Prefix is set to "/petstore/api/v3", and with
	// Rewrite.Pattern is set to "^/petstore", Rewrite.Substitution is set to ""
	// path that would be generated is "/petstore/api/v3/pets", URL that the upstream service would receive
	// is "/api/v3/pets".
	Rewrite RewriteRegex `yaml:"rewrite,omitempty" json:"rewrite,omitempty"`
}

UpstreamOptions defines upstream that we proxy to Host and Service are mutually exclusive

func (*UpstreamOptions) DeepCopy

func (in *UpstreamOptions) DeepCopy() *UpstreamOptions

DeepCopy creates a copy of an object

func (*UpstreamOptions) FillDefaults added in v1.0.1

func (o *UpstreamOptions) FillDefaults()

func (UpstreamOptions) Validate

func (o UpstreamOptions) Validate() error

type UpstreamService

type UpstreamService struct {
	// Name is the upstream K8s Service's name.
	Name string `yaml:"name" json:"name,omitempty"`

	// Namespace where service is located
	Namespace string `yaml:"namespace" json:"namespace"`

	// Port is the upstream K8s Service's port.
	Port uint32 `yaml:"port" json:"port"`

	// Weight indicates the percentage of traffic to be sent to the given upstream.
	Weight int `yaml:"weight,omitempty" json:"weight,omitempty"`
}

UpstreamService defines K8s Service in the cluster

func (*UpstreamService) FillDefaults added in v1.0.1

func (o *UpstreamService) FillDefaults()

func (UpstreamService) Validate

func (o UpstreamService) Validate() error

type UpstreamValidation added in v1.5.0

type UpstreamValidation struct {
	// Name or namespaced name of the Kubernetes secret used to validate the certificate presented by the backend.
	// The secret must contain key named ca.crt.
	CACertificate string `json:"caSecret" yaml:"caSecret"`

	// Key which is expected to be present in the 'subjectAltName' of the presented certificate.
	SubjectName string `json:"subjectName" yaml:"subjectName"`
}

UpstreamValidation defines how to verify the backend service's certificate +kubebuilder:object:generate=true

func (*UpstreamValidation) DeepCopy added in v1.5.0

func (in *UpstreamValidation) DeepCopy() *UpstreamValidation

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpstreamValidation.

func (*UpstreamValidation) DeepCopyInto added in v1.5.0

func (in *UpstreamValidation) DeepCopyInto(out *UpstreamValidation)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (UpstreamValidation) String added in v1.5.0

func (o UpstreamValidation) String() string

func (UpstreamValidation) Validate added in v1.5.0

func (o UpstreamValidation) Validate() error

type ValidationOptions

type ValidationOptions struct {
	Request *RequestValidationOptions `json:"request,omitempty" yaml:"request,omitempty"`
}

Jump to

Keyboard shortcuts

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