v1alpha1

package
v0.6.1-nightly.993d4b1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: MPL-2.0 Imports: 15 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

This section is empty.

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"`
}

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 PolicyPartitions

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

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