v1beta1

package
v0.0.0-...-713de3c Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 10 Imported by: 17

Documentation

Overview

Package v1beta1 contains API Schema definitions for the gateway v1beta1 API group +kubebuilder:object:generate=true +groupName=gateway.kyma-project.io

Index

Constants

View Source
const (
	Regex  = "regex"
	Exact  = "exact"
	Prefix = "prefix"
)
View Source
const (
	CookieMutator = "cookie"
	HeaderMutator = "header"
)
View Source
const (
	AccessStrategyAllow                   string = "allow"
	AccessStrategyNoAuth                  string = "no_auth"
	AccessStrategyJwt                     string = "jwt"
	AccessStrategyNoop                    string = "noop"
	AccessStrategyUnauthorized            string = "unauthorized"
	AccessStrategyAnonymous               string = "anonymous"
	AccessStrategyCookieSession           string = "cookie_session"
	AccessStrategyOauth2ClientCredentials string = "oauth2_client_credentials"
	AccessStrategyOauth2Introspection     string = "oauth2_introspection"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "gateway.kyma-project.io", Version: "v1beta1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func ConvertHttpMethodsToStrings

func ConvertHttpMethodsToStrings(methods []HttpMethod) []string

Types

type APIRule

type APIRule struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   APIRuleSpec   `json:"spec,omitempty"`
	Status APIRuleStatus `json:"status,omitempty"`
}

APIRule is the Schema for ApiRule APIs. +kubebuilder:storageversion +kubebuilder:object:root=true +kubebuilder:resource:categories={kyma-api-gateway} +kubebuilder:subresource:status +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.APIRuleStatus.code" +kubebuilder:printcolumn:name="Host",type="string",JSONPath=".spec.host"

func (*APIRule) DeepCopy

func (in *APIRule) DeepCopy() *APIRule

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

func (*APIRule) DeepCopyInto

func (in *APIRule) DeepCopyInto(out *APIRule)

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

func (*APIRule) DeepCopyObject

func (in *APIRule) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*APIRule) Hub

func (*APIRule) Hub()

Hub marks this type as a conversion hub since this is the storage version.

func (*APIRule) SetupWebhookWithManager

func (r *APIRule) SetupWebhookWithManager(mgr ctrl.Manager) error

type APIRuleList

type APIRuleList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []APIRule `json:"items"`
}

APIRuleList contains a list of ApiRule

func (*APIRuleList) DeepCopy

func (in *APIRuleList) DeepCopy() *APIRuleList

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

func (*APIRuleList) DeepCopyInto

func (in *APIRuleList) DeepCopyInto(out *APIRuleList)

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

func (*APIRuleList) DeepCopyObject

func (in *APIRuleList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type APIRuleResourceStatus

type APIRuleResourceStatus struct {
	Code        StatusCode `json:"code,omitempty"`
	Description string     `json:"desc,omitempty"`
}

Describes the status of APIRule.

func (*APIRuleResourceStatus) DeepCopy

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

func (*APIRuleResourceStatus) DeepCopyInto

func (in *APIRuleResourceStatus) DeepCopyInto(out *APIRuleResourceStatus)

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

type APIRuleSpec

type APIRuleSpec struct {
	// Specifies the URL of the exposed service.
	// +kubebuilder:validation:MinLength=3
	// +kubebuilder:validation:MaxLength=256
	// +kubebuilder:validation:Pattern=^([a-zA-Z0-9][a-zA-Z0-9-_]*\.)*[a-zA-Z0-9]*[a-zA-Z0-9-_]*[[a-zA-Z0-9]+$
	Host *string `json:"host"`
	// Describes the service to expose.
	// +optional
	Service *Service `json:"service,omitempty"`
	// Specifies the Istio Gateway to be used.
	// +kubebuilder:validation:Pattern=`^[0-9a-z-_]+(\/[0-9a-z-_]+|(\.[0-9a-z-_]+)*)$`
	Gateway *string `json:"gateway"`
	// Specifies CORS headers configuration that will be sent downstream
	// +optional
	CorsPolicy *CorsPolicy `json:"corsPolicy,omitempty"`
	// Represents the array of Oathkeeper access rules to be applied.
	// +kubebuilder:validation:MinItems=1
	Rules []Rule `json:"rules"`
	// +optional
	Timeout *Timeout `json:"timeout,omitempty"`
}

Defines the desired state of ApiRule.

func (*APIRuleSpec) DeepCopy

func (in *APIRuleSpec) DeepCopy() *APIRuleSpec

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

func (*APIRuleSpec) DeepCopyInto

func (in *APIRuleSpec) DeepCopyInto(out *APIRuleSpec)

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

type APIRuleStatus

type APIRuleStatus struct {
	LastProcessedTime    metav1.Time            `json:"lastProcessedTime,omitempty"`
	ObservedGeneration   int64                  `json:"observedGeneration,omitempty"`
	APIRuleStatus        *APIRuleResourceStatus `json:"APIRuleStatus,omitempty"`
	VirtualServiceStatus *APIRuleResourceStatus `json:"virtualServiceStatus,omitempty"`
	// +optional
	AccessRuleStatus *APIRuleResourceStatus `json:"accessRuleStatus,omitempty"`
	// +optional
	RequestAuthenticationStatus *APIRuleResourceStatus `json:"requestAuthenticationStatus,omitempty"`
	// +optional
	AuthorizationPolicyStatus *APIRuleResourceStatus `json:"authorizationPolicyStatus,omitempty"`
}

Describes the observed state of ApiRule.

func (*APIRuleStatus) ApiRuleStatusVersion

func (s *APIRuleStatus) ApiRuleStatusVersion() versions.Version

func (*APIRuleStatus) DeepCopy

func (in *APIRuleStatus) DeepCopy() *APIRuleStatus

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

func (*APIRuleStatus) DeepCopyInto

func (in *APIRuleStatus) DeepCopyInto(out *APIRuleStatus)

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

type Authenticator

type Authenticator struct {
	*Handler `json:",inline"`
}

Represents a handler that authenticates provided credentials. See the corresponding type in the oathkeeper-maester project.

func (*Authenticator) DeepCopy

func (in *Authenticator) DeepCopy() *Authenticator

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

func (*Authenticator) DeepCopyInto

func (in *Authenticator) DeepCopyInto(out *Authenticator)

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

type CookieMutatorConfig

type CookieMutatorConfig struct {
	Cookies map[string]string `json:"cookies"`
}

func (*CookieMutatorConfig) DeepCopy

func (in *CookieMutatorConfig) DeepCopy() *CookieMutatorConfig

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

func (*CookieMutatorConfig) DeepCopyInto

func (in *CookieMutatorConfig) DeepCopyInto(out *CookieMutatorConfig)

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

func (*CookieMutatorConfig) HasCookies

func (c *CookieMutatorConfig) HasCookies() bool

func (*CookieMutatorConfig) ToString

func (c *CookieMutatorConfig) ToString() string

type CorsPolicy

type CorsPolicy struct {
	AllowHeaders     []string    `json:"allowHeaders,omitempty"`
	AllowMethods     []string    `json:"allowMethods,omitempty"`
	AllowOrigins     StringMatch `json:"allowOrigins,omitempty"`
	AllowCredentials *bool       `json:"allowCredentials,omitempty"`
	ExposeHeaders    []string    `json:"exposeHeaders,omitempty"`
	// +kubebuilder:validation:Format=duration
	MaxAge *metav1.Duration `json:"maxAge,omitempty"`
}

CorsPolicy allows configuration of CORS headers received downstream. If this is not defined, the default values are applied. If CorsPolicy is configured, CORS headers received downstream will be only those defined on the APIRule

func (*CorsPolicy) DeepCopy

func (in *CorsPolicy) DeepCopy() *CorsPolicy

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

func (*CorsPolicy) DeepCopyInto

func (in *CorsPolicy) DeepCopyInto(out *CorsPolicy)

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

type Handler

type Handler struct {
	// Specifies the name of the handler.
	Name string `json:"handler"`
	// Configures the handler. Configuration keys vary per handler.
	// +kubebuilder:validation:Type=object
	// +kubebuilder:pruning:PreserveUnknownFields
	Config *runtime.RawExtension `json:"config,omitempty"`
}

Handler provides configuration for different Oathkeeper objects. It is used to either validate a request (Authenticator, Authorizer) or modify it (Mutator). See the corresponding type in the oathkeeper-maester project.

func (*Handler) DeepCopy

func (in *Handler) DeepCopy() *Handler

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

func (*Handler) DeepCopyInto

func (in *Handler) DeepCopyInto(out *Handler)

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

type HeaderMutatorConfig

type HeaderMutatorConfig struct {
	Headers map[string]string `json:"headers"`
}

func (*HeaderMutatorConfig) DeepCopy

func (in *HeaderMutatorConfig) DeepCopy() *HeaderMutatorConfig

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

func (*HeaderMutatorConfig) DeepCopyInto

func (in *HeaderMutatorConfig) DeepCopyInto(out *HeaderMutatorConfig)

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

func (*HeaderMutatorConfig) HasHeaders

func (h *HeaderMutatorConfig) HasHeaders() bool

type HttpMethod

type HttpMethod string

HttpMethod specifies the HTTP request method. The list of supported methods is defined in RFC 9910: HTTP Semantics and RFC 5789: PATCH Method for HTTP. +kubebuilder:validation:Enum=GET;HEAD;POST;PUT;DELETE;CONNECT;OPTIONS;TRACE;PATCH

type JwtAuthentication

type JwtAuthentication struct {
	Issuer  string `json:"issuer"`
	JwksUri string `json:"jwksUri"`
	// +optional
	FromHeaders []*JwtHeader `json:"fromHeaders,omitempty"`
	// +optional
	FromParams []string `json:"fromParams,omitempty"`
}

JwtAuthentication Config for Jwt Istio authentication

func (*JwtAuthentication) DeepCopy

func (in *JwtAuthentication) DeepCopy() *JwtAuthentication

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

func (*JwtAuthentication) DeepCopyInto

func (in *JwtAuthentication) DeepCopyInto(out *JwtAuthentication)

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

type JwtAuthorization

type JwtAuthorization struct {
	RequiredScopes []string `json:"requiredScopes"`
	Audiences      []string `json:"audiences"`
}

JwtAuthorization contains an array of required scopes

func (*JwtAuthorization) DeepCopy

func (in *JwtAuthorization) DeepCopy() *JwtAuthorization

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

func (*JwtAuthorization) DeepCopyInto

func (in *JwtAuthorization) DeepCopyInto(out *JwtAuthorization)

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

func (*JwtAuthorization) HasRequiredScopes

func (a *JwtAuthorization) HasRequiredScopes() bool

type JwtConfig

type JwtConfig struct {
	Authentications []*JwtAuthentication `json:"authentications,omitempty"`
	Authorizations  []*JwtAuthorization  `json:"authorizations,omitempty"`
}

JwtConfig is an array of JwtAuthorization type used by raw field Config of Istio jwt Handler +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*JwtConfig) DeepCopy

func (in *JwtConfig) DeepCopy() *JwtConfig

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

func (*JwtConfig) DeepCopyInto

func (in *JwtConfig) DeepCopyInto(out *JwtConfig)

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

func (*JwtConfig) DeepCopyObject

func (in *JwtConfig) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*JwtConfig) GetObjectKind

func (j *JwtConfig) GetObjectKind() schema.ObjectKind

type JwtHeader

type JwtHeader struct {
	Name string `json:"name"`
	// +optional
	Prefix string `json:"prefix,omitempty"`
}

JwtHeader for specifying from header for the Jwt token

func (*JwtHeader) DeepCopy

func (in *JwtHeader) DeepCopy() *JwtHeader

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

func (*JwtHeader) DeepCopyInto

func (in *JwtHeader) DeepCopyInto(out *JwtHeader)

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

type Mutator

type Mutator struct {
	*Handler `json:",inline"`
}

Mutator represents a handler that transforms the HTTP request before forwarding it. See the corresponding in the oathkeeper-maester project.

func (*Mutator) DeepCopy

func (in *Mutator) DeepCopy() *Mutator

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

func (*Mutator) DeepCopyInto

func (in *Mutator) DeepCopyInto(out *Mutator)

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

type Rule

type Rule struct {
	// Specifies the path of the exposed service.
	// +kubebuilder:validation:Pattern=^([0-9a-zA-Z./*()?!\\_-]+)
	Path string `json:"path"`
	// Describes the service to expose. Overwrites the **spec** level service if defined.
	// +optional
	Service *Service `json:"service,omitempty"`
	// Represents the list of allowed HTTP request methods available for the **spec.rules.path**.
	// +kubebuilder:validation:MinItems=1
	Methods []HttpMethod `json:"methods"`
	// Specifies the list of access strategies.
	// All strategies listed in [Oathkeeper documentation](https://www.ory.sh/docs/oathkeeper/pipeline/authn) are supported.
	// +kubebuilder:validation:MinItems=1
	AccessStrategies []*Authenticator `json:"accessStrategies"`
	// Specifies the list of [Ory Oathkeeper](https://www.ory.sh/docs/oathkeeper/pipeline/mutator) mutators.
	// +optional
	Mutators []*Mutator `json:"mutators,omitempty"`
	// +optional
	Timeout *Timeout `json:"timeout,omitempty"`
}

Rule .

func (*Rule) ContainsAccessStrategy

func (r *Rule) ContainsAccessStrategy(strategy string) bool

func (*Rule) DeepCopy

func (in *Rule) DeepCopy() *Rule

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

func (*Rule) DeepCopyInto

func (in *Rule) DeepCopyInto(out *Rule)

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

func (*Rule) GetCookieMutator

func (r *Rule) GetCookieMutator() (CookieMutatorConfig, error)

func (*Rule) GetHeaderMutator

func (r *Rule) GetHeaderMutator() (HeaderMutatorConfig, error)

func (*Rule) GetJwtIstioAuthorizations

func (r *Rule) GetJwtIstioAuthorizations() []*JwtAuthorization

type Service

type Service struct {
	// Specifies the name of the exposed service.
	Name *string `json:"name"`
	// Specifies the Namespace of the exposed service. If not defined, it defaults to the APIRule Namespace.
	// +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
	// +optional
	Namespace *string `json:"namespace,omitempty"`
	// Specifies the communication port of the exposed service.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=65535
	Port *uint32 `json:"port"`
	// Specifies if the service is internal (in cluster) or external.
	// +optional
	IsExternal *bool `json:"external,omitempty"`
}

Service .

func (*Service) DeepCopy

func (in *Service) DeepCopy() *Service

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

func (*Service) DeepCopyInto

func (in *Service) DeepCopyInto(out *Service)

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

type StatusCode

type StatusCode string

Status code describing APIRule.

const (
	//StatusOK is set when the reconciliation finished succefully
	StatusOK StatusCode = "OK"
	//StatusSkipped is set when reconcilation of the APIRule component was skipped
	StatusSkipped StatusCode = "SKIPPED"
	//StatusError is set when an error happened during reconciliation of the APIRule
	StatusError StatusCode = "ERROR"
	//StatusWarning is set if an user action is required
	StatusWarning StatusCode = "WARNING"
)

type StringMatch

type StringMatch []map[string]string

func (StringMatch) DeepCopy

func (in StringMatch) DeepCopy() StringMatch

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

func (StringMatch) DeepCopyInto

func (in StringMatch) DeepCopyInto(out *StringMatch)

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

func (StringMatch) ToIstioStringMatchArray

func (s StringMatch) ToIstioStringMatchArray() (out []*v1beta1.StringMatch)

type Timeout

type Timeout uint16 // We use unit16 instead of a time.Duration because there is a bug with duration that requires additional validation of the format. Issue: checking https://github.com/kubernetes/apiextensions-apiserver/issues/56

Timeout for HTTP requests in seconds. The timeout can be configured up to 3900 seconds (65 minutes). +kubebuilder:validation:Minimum=1 +kubebuilder:validation:Maximum=3900

Jump to

Keyboard shortcuts

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