v1alpha1

package
v0.6.1-nightly.dc94d40 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the tyk v1alpha1 API group +kubebuilder:object:generate=true +groupName=tyk.tyk.io

Index

Constants

View Source
const (

	// WatchNamespace is the constant for env variable WATCH_NAMESPACE
	// which specifies the Namespace to watch.
	// An empty value means the operator is running with cluster scope.
	WatchNamespace = "WATCH_NAMESPACE"

	// TykMode defines what environment the operator is running. The values are ce
	// for community edition and pro for pro version
	TykMode = "TYK_MODE"

	// TykURL holds the url to either tyk gateway or tyk dashboard
	TykURL = "TYK_URL"

	// TykAuth holds the authorization token used to make api calls to the
	// gateway/dashboard
	TykAuth = "TYK_AUTH"

	// TykORG holds the org id which perform api tasks with
	TykORG = "TYK_ORG"

	// SkipVerify the client will skip tls verification if this is true
	SkipVerify = "TYK_TLS_INSECURE_SKIP_VERIFY"

	// IngressClass overides the default class to watch for ingress
	IngressClass = "WATCH_INGRESS_CLASS"

	IngressTLSPort = "TYK_HTTPS_INGRESS_PORT"

	IngressHTTPPort = "TYK_HTTP_INGRESS_PORT"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "tyk.tyk.io", Version: "v1alpha1"}

	// 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

This section is empty.

Types

type APIDefinitionSpec

type APIDefinitionSpec struct {
	model.APIDefinitionSpec `json:",inline"`
	// Context specify namespace/name of the OperatorContext object used for
	// reconciling this APIDefinition
	Context *model.Target `json:"contextRef,omitempty"`
}

APIDefinition represents the configuration for a single proxied API and it's versions. +kubebuilder:object:generate=true

func (*APIDefinitionSpec) DeepCopy

func (in *APIDefinitionSpec) DeepCopy() *APIDefinitionSpec

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

func (*APIDefinitionSpec) DeepCopyInto

func (in *APIDefinitionSpec) DeepCopyInto(out *APIDefinitionSpec)

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

type APILimit

type APILimit struct {
	Rate               int64 `json:"rate"`
	Per                int64 `json:"per"`
	ThrottleInterval   int64 `json:"throttle_interval"`
	ThrottleRetryLimit int   `json:"throttle_retry_limit"`
	MaxQueryDepth      int   `json:"max_query_depth"`
	QuotaMax           int64 `json:"quota_max"`
	QuotaRenews        int64 `json:"quota_renews"`
	QuotaRemaining     int64 `json:"quota_remaining"`
	QuotaRenewalRate   int64 `json:"quota_renewal_rate"`
}

APILimit stores quota and rate limit on ACL level (per API)

func (*APILimit) DeepCopy

func (in *APILimit) DeepCopy() *APILimit

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

func (*APILimit) DeepCopyInto

func (in *APILimit) DeepCopyInto(out *APILimit)

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

type AccessDefinition

type AccessDefinition struct {
	// Namespace of the ApiDefinition resource to target
	Namespace string `json:"namespace"`
	// Name of the ApiDefinition resource to target
	Name string `json:"name"`

	// TODO: APIName should not really be needed, as is auto-set from the APIDefnition Resource
	APIName string `json:"api_name,omitempty"`
	// TODO: APIID should not really be needed, as is auto-set from the APIDefnition Resource
	APIID    string   `json:"api_id,omitempty"`
	Versions []string `json:"versions,omitempty"`
	//RestrictedTypes []graphql.Type `json:"restricted_types"`
	//Limit          APILimit     `json:"limit,omitempty"`
	AllowanceScope string       `json:"allowance_scope,omitempty"`
	AllowedURLs    []AccessSpec `json:"allowed_urls,omitempty"` // mapped string MUST be a valid regex
}

from tyk/session.go AccessDefinition defines which versions of an API a key has access to

func (*AccessDefinition) DeepCopy

func (in *AccessDefinition) DeepCopy() *AccessDefinition

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

func (*AccessDefinition) DeepCopyInto

func (in *AccessDefinition) DeepCopyInto(out *AccessDefinition)

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

type AccessSpec

type AccessSpec struct {
	URL     string   `json:"url"`
	Methods []string `json:"methods"`
}

AccessSpecs define what URLS a user has access to an what methods are enabled

func (*AccessSpec) DeepCopy

func (in *AccessSpec) DeepCopy() *AccessSpec

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

func (*AccessSpec) DeepCopyInto

func (in *AccessSpec) DeepCopyInto(out *AccessSpec)

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

type ApiDefinition

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

	Spec   APIDefinitionSpec   `json:"spec,omitempty"`
	Status ApiDefinitionStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="Domain",type=string,JSONPath=`.spec.domain` +kubebuilder:printcolumn:name="ListenPath",type=string,JSONPath=`.spec.proxy.listen_path` +kubebuilder:printcolumn:name="Proxy.TargetURL",type=string,JSONPath=`.spec.proxy.target_url` +kubebuilder:printcolumn:name="Enabled",type=boolean,JSONPath=`.spec.active` +kubebuilder:resource:shortName=tykapis ApiDefinition is the Schema for the apidefinitions API

func (*ApiDefinition) DeepCopy

func (in *ApiDefinition) DeepCopy() *ApiDefinition

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

func (*ApiDefinition) DeepCopyInto

func (in *ApiDefinition) DeepCopyInto(out *ApiDefinition)

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

func (*ApiDefinition) DeepCopyObject

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

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

func (*ApiDefinition) Default

func (in *ApiDefinition) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*ApiDefinition) SetupWebhookWithManager

func (in *ApiDefinition) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*ApiDefinition) ValidateCreate

func (in *ApiDefinition) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*ApiDefinition) ValidateDelete

func (in *ApiDefinition) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*ApiDefinition) ValidateUpdate

func (in *ApiDefinition) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type ApiDefinitionList

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

ApiDefinitionList contains a list of ApiDefinition +kubebuilder:object:root=true

func (*ApiDefinitionList) DeepCopy

func (in *ApiDefinitionList) DeepCopy() *ApiDefinitionList

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

func (*ApiDefinitionList) DeepCopyInto

func (in *ApiDefinitionList) DeepCopyInto(out *ApiDefinitionList)

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

func (*ApiDefinitionList) DeepCopyObject

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

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

type ApiDefinitionStatus

type ApiDefinitionStatus struct {
	ApiID string `json:"api_id"`

	// LinkedByPolicies is a list policies that references this api definition
	//+optional
	LinkedByPolicies []model.Target `json:"linked_by_policies,omitempty"`

	// LinkedByAPIs is a list of ApiDefinition namespaced/name that links to this
	// resource
	LinkedByAPIs []model.Target `json:"linked_by_apis,omitempty"`

	// LinkedToAPIs is a list of ApiDefinition namespaced/name that this resource
	// links to.
	LinkedToAPIs []model.Target `json:"linked_to_apis,omitempty"`
}

ApiDefinitionStatus defines the observed state of ApiDefinition

func (*ApiDefinitionStatus) DeepCopy

func (in *ApiDefinitionStatus) DeepCopy() *ApiDefinitionStatus

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

func (*ApiDefinitionStatus) DeepCopyInto

func (in *ApiDefinitionStatus) DeepCopyInto(out *ApiDefinitionStatus)

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

type Environment added in v0.7.0

type Environment struct {
	Mode               OperatorContextMode `json:"mode,omitempty"`
	InsecureSkipVerify bool                `json:"insecureSkipVerify,omitempty"`
	URL                string              `json:"url,omitempty"`
	Auth               string              `json:"auth,omitempty"`
	Org                string              `json:"org,omitempty"`
	Ingress            Ingress             `json:"ingress,omitempty"`
}

func (*Environment) DeepCopy added in v0.7.0

func (in *Environment) DeepCopy() *Environment

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

func (*Environment) DeepCopyInto added in v0.7.0

func (in *Environment) DeepCopyInto(out *Environment)

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

type Ingress added in v0.7.0

type Ingress struct {
	HTTPPort  int `json:"httpPort,omitempty"`
	HTTPSPort int `json:"httpsPort,omitempty"`
}

func (*Ingress) DeepCopy added in v0.7.0

func (in *Ingress) DeepCopy() *Ingress

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

func (*Ingress) DeepCopyInto added in v0.7.0

func (in *Ingress) DeepCopyInto(out *Ingress)

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

type OperatorContext added in v0.7.0

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

	Spec   OperatorContextSpec   `json:"spec,omitempty"`
	Status OperatorContextStatus `json:"status,omitempty"`
}

OperatorContext is the Schema for the operatorcontexts API

func (*OperatorContext) DeepCopy added in v0.7.0

func (in *OperatorContext) DeepCopy() *OperatorContext

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

func (*OperatorContext) DeepCopyInto added in v0.7.0

func (in *OperatorContext) DeepCopyInto(out *OperatorContext)

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

func (*OperatorContext) DeepCopyObject added in v0.7.0

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

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

type OperatorContextList added in v0.7.0

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

OperatorContextList contains a list of OperatorContext

func (*OperatorContextList) DeepCopy added in v0.7.0

func (in *OperatorContextList) DeepCopy() *OperatorContextList

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

func (*OperatorContextList) DeepCopyInto added in v0.7.0

func (in *OperatorContextList) DeepCopyInto(out *OperatorContextList)

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

func (*OperatorContextList) DeepCopyObject added in v0.7.0

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

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

type OperatorContextMode added in v0.7.0

type OperatorContextMode string

OperatorContextMode is the mode to which the admin api binding is done values are ce for community edition and pro for dashboard +kubebuilder:validation:Enum=ce;pro

type OperatorContextSpec added in v0.7.0

type OperatorContextSpec struct {
	// Reference to k8s secret resource that we load environment from.
	FromSecret *model.Target `json:"secretRef,omitempty"`
	// Env is the values of the admin api endpoint that the operator will use to
	// reconcile resources
	Env *Environment `json:"env,omitempty"`
}

OperatorContextSpec defines the desired state of OperatorContext

func (*OperatorContextSpec) DeepCopy added in v0.7.0

func (in *OperatorContextSpec) DeepCopy() *OperatorContextSpec

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

func (*OperatorContextSpec) DeepCopyInto added in v0.7.0

func (in *OperatorContextSpec) DeepCopyInto(out *OperatorContextSpec)

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

type OperatorContextStatus added in v0.7.0

type OperatorContextStatus struct{}

OperatorContextStatus defines the observed state of OperatorContext

func (*OperatorContextStatus) DeepCopy added in v0.7.0

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

func (*OperatorContextStatus) DeepCopyInto added in v0.7.0

func (in *OperatorContextStatus) DeepCopyInto(out *OperatorContextStatus)

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

type PolicyPartitions

type PolicyPartitions struct {
	Quota      bool `json:"quota,omitempty"`
	RateLimit  bool `json:"rate_limit,omitempty"`
	Complexity bool `json:"complexity,omitempty"`
	Acl        bool `json:"acl,omitempty"`
	PerAPI     bool `json:"per_api,omitempty"`
}

func (*PolicyPartitions) DeepCopy

func (in *PolicyPartitions) DeepCopy() *PolicyPartitions

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

func (*PolicyPartitions) DeepCopyInto

func (in *PolicyPartitions) DeepCopyInto(out *PolicyPartitions)

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

type SecurityPolicy

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

	Spec   SecurityPolicySpec   `json:"spec,omitempty"`
	Status SecurityPolicyStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:shortName=tykpolicies SecurityPolicy is the Schema for the securitypolicies API

func (*SecurityPolicy) DeepCopy

func (in *SecurityPolicy) DeepCopy() *SecurityPolicy

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

func (*SecurityPolicy) DeepCopyInto

func (in *SecurityPolicy) DeepCopyInto(out *SecurityPolicy)

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

func (*SecurityPolicy) DeepCopyObject

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

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

func (*SecurityPolicy) Default

func (r *SecurityPolicy) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*SecurityPolicy) SetupWebhookWithManager

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

func (*SecurityPolicy) ValidateCreate

func (r *SecurityPolicy) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*SecurityPolicy) ValidateDelete

func (r *SecurityPolicy) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*SecurityPolicy) ValidateUpdate

func (r *SecurityPolicy) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type SecurityPolicyList

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

SecurityPolicyList contains a list of SecurityPolicy +kubebuilder:object:root=true

func (*SecurityPolicyList) DeepCopy

func (in *SecurityPolicyList) DeepCopy() *SecurityPolicyList

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

func (*SecurityPolicyList) DeepCopyInto

func (in *SecurityPolicyList) DeepCopyInto(out *SecurityPolicyList)

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

func (*SecurityPolicyList) DeepCopyObject

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

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

type SecurityPolicySpec

type SecurityPolicySpec struct {
	// Reference to k8s secret resource that we load environment from.
	Context *model.Target `json:"contextRef,omitempty"`

	// MID ("_id") is generated by Tyk once the resource is created.
	// Do NOT fill this in.
	MID string `json:"_id,omitempty"`
	// If you are linking an existing Policy ID to a new YAML CRD, then
	// fill in this ID field with the "_id" field.
	// See policies.md readme for more info
	ID string `json:"id,omitempty"`

	// Name represents the name of the security policy as displayed in the Dashboard
	Name string `json:"name"`

	// OrgID is overwritten - no point setting this
	OrgID string `json:"org_id,omitempty"`

	// +kubebuilder:validation:Enum=active;draft;deny
	// State can be active, draft or deny
	// active: All keys are active and new keys can be created.
	// draft: All keys are active but no new keys can be created.
	// deny: All keys are deactivated and no keys can be created.
	State string `json:"state"`

	// Active must be set to `true` for Tyk to load the security policy into memory.
	Active bool `json:"active"`

	// IsInactive applies to the key itself. Allows enabling or disabling the policy without deleting it.
	IsInactive        bool                        `json:"is_inactive,omitempty"`
	AccessRightsArray []*AccessDefinition         `json:"access_rights_array,omitempty"`
	AccessRights      map[string]AccessDefinition `json:"access_rights,omitempty"`

	// Rate limit per X seconds (x="Per"), omit or "-1" for unlimited
	Rate int64 `json:"rate,omitempty"`

	// To be used in conjunction with "Rate".  Per seconds. 1 minute=60.  1 hour=3600
	// omit or "-1" for unlimited
	Per int64 `json:"per,omitempty"`

	// Value of Quota allowed, omit or "-1" for unlimited
	QuotaMax int64 `json:"quota_max,omitempty"`

	// Value reset length, in seconds, omit or "-1" for unlimited
	QuotaRenewalRate int64 `json:"quota_renewal_rate,omitempty"`

	// If rate limited, how many seconds to retry a request for.  omit or "-1" for unlimited
	ThrottleInterval int64 `json:"throttle_interval,omitempty"`

	// Number of retries before returning error.   omit or "-1" for unlimited
	ThrottleRetryLimit int `json:"throttle_retry_limit,omitempty"`

	// Max depth of a GraphQL query
	MaxQueryDepth                 int  `json:"max_query_depth,omitempty"`
	HMACEnabled                   bool `json:"hmac_enabled,omitempty"`
	EnableHTTPSignatureValidation bool `json:"enable_http_signature_validation,omitempty"`

	// Custom tags to apply to the key, get transfered to the analytics
	Tags []string `json:"tags,omitempty"`

	// KeyExpiresIn is the number of seconds till key expiry. For 1 hour is 3600. Default never expire or 0
	KeyExpiresIn int64             `json:"key_expires_in,omitempty"`
	Partitions   *PolicyPartitions `json:"partitions,omitempty"`

	//LastUpdated                   string                           `json:"last_updated"`
	MetaData map[string]string `json:"meta_data,omitempty"`
}

SecurityPolicySpec defines the desired state of SecurityPolicy

func (*SecurityPolicySpec) DeepCopy

func (in *SecurityPolicySpec) DeepCopy() *SecurityPolicySpec

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

func (*SecurityPolicySpec) DeepCopyInto

func (in *SecurityPolicySpec) DeepCopyInto(out *SecurityPolicySpec)

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

type SecurityPolicyStatus

type SecurityPolicyStatus struct {
	PolID string `json:"pol_id"`
}

SecurityPolicyStatus defines the observed state of SecurityPolicy

func (*SecurityPolicyStatus) DeepCopy

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

func (*SecurityPolicyStatus) DeepCopyInto

func (in *SecurityPolicyStatus) DeepCopyInto(out *SecurityPolicyStatus)

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

Jump to

Keyboard shortcuts

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