v1alpha1

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "oathkeeper.ory.sh", 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
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: "oathkeeper.ory.sh", Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind added in v0.0.2

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource added in v0.0.2

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type Authenticator

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

Authenticator represents a handler that authenticates provided credentials.

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 Authorizer

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

Authorizer represents a handler that authorizes the subject ("user") from the previously validated credentials making the request.

func (*Authorizer) DeepCopy

func (in *Authorizer) DeepCopy() *Authorizer

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

func (*Authorizer) DeepCopyInto

func (in *Authorizer) DeepCopyInto(out *Authorizer)

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

type Handler

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

Handler represents an Oathkeeper routine that operates on incoming requests. It is used to either validate a request (Authenticator, Authorizer) or modify it (Mutator).

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 Match

type Match struct {
	// URL is the URL that should be matched. It supports regex templates.
	URL string `json:"url"`
	// Methods represent an array of HTTP methods (e.g. GET, POST, PUT, DELETE, ...)
	Methods []string `json:"methods"`
}

Match defines the URL(s) that an access rule should match.

func (*Match) DeepCopy

func (in *Match) DeepCopy() *Match

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

func (*Match) DeepCopyInto

func (in *Match) DeepCopyInto(out *Match)

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.

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 OathError

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

Error respresents a handler that is activated when errors occure

func (*OathError) DeepCopy

func (in *OathError) DeepCopy() *OathError

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

func (*OathError) DeepCopyInto

func (in *OathError) DeepCopyInto(out *OathError)

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

type Rule

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

	Spec   RuleSpec   `json:"spec,omitempty"`
	Status RuleStatus `json:"status,omitempty"`
}

+genclient +kubebuilder:object:root=true Rule is the Schema for the rules API

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) DeepCopyObject

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

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

func (Rule) ToRuleJSON

func (r Rule) ToRuleJSON() *RuleJSON

ToRuleJSON transforms a Rule object into an intermediary RuleJSON object

func (Rule) ValidateWith

func (r Rule) ValidateWith(config validation.Config) error

ValidateWith uses provided validation configuration to check whether the rule have proper handlers set. Nil is a valid handler.

type RuleJSON

type RuleJSON struct {
	ID       string `json:"id"`
	RuleSpec `json:",inline"`
}

RuleJson is a representation of an Oathkeeper rule.

func (*RuleJSON) DeepCopy

func (in *RuleJSON) DeepCopy() *RuleJSON

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

func (*RuleJSON) DeepCopyInto

func (in *RuleJSON) DeepCopyInto(out *RuleJSON)

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

func (RuleJSON) MarshalJSON

func (rj RuleJSON) MarshalJSON() ([]byte, error)

MarshalJSON is a custom marshal function that converts RuleJSON objects into JSON objects digestible by Oathkeeper

type RuleList

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

+kubebuilder:object:root=true RuleList contains a list of Rule

func (*RuleList) DeepCopy

func (in *RuleList) DeepCopy() *RuleList

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

func (*RuleList) DeepCopyInto

func (in *RuleList) DeepCopyInto(out *RuleList)

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

func (*RuleList) DeepCopyObject

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

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

func (RuleList) FilterConfigMapName

func (rl RuleList) FilterConfigMapName(name *string) RuleList

FilterConfigMapName filters out Rules that don't effect the given ConfigMap

func (RuleList) FilterNotValid

func (rl RuleList) FilterNotValid() RuleList

FilterNotValid filters out Rules which doesn't pass validation due to being not processed yet or due to negative result of validation. It returns a list of Rules which passed validation successfully.

func (RuleList) FilterOutRule

func (rl RuleList) FilterOutRule(r Rule) RuleList

FilterOutRule filters out the provided rule from the rule list, for re-generating the rules when a rule is deleted

func (RuleList) ToOathkeeperRules

func (rl RuleList) ToOathkeeperRules() ([]byte, error)

ToOathkeeperRules transforms a RuleList object into a JSON object digestible by Oathkeeper.

type RuleSpec

type RuleSpec struct {
	Upstream       *Upstream        `json:"upstream"`
	Match          *Match           `json:"match"`
	Authenticators []*Authenticator `json:"authenticators,omitempty"`
	Authorizer     *Authorizer      `json:"authorizer,omitempty"`
	Mutators       []*Mutator       `json:"mutators,omitempty"`
	// +optional
	Errors []*OathError `json:"errors,omitempty"`
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	// +kubebuilder:validation:Pattern=[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*
	//
	// ConfigMapName points to the K8s ConfigMap that contains these rules
	ConfigMapName *string `json:"configMapName,omitempty"`
}

RuleSpec defines the desired state of Rule

func (*RuleSpec) DeepCopy

func (in *RuleSpec) DeepCopy() *RuleSpec

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

func (*RuleSpec) DeepCopyInto

func (in *RuleSpec) DeepCopyInto(out *RuleSpec)

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

type RuleStatus

type RuleStatus struct {
	// +optional
	Validation *Validation `json:"validation,omitempty"`
}

RuleStatus defines the observed state of Rule

func (*RuleStatus) DeepCopy

func (in *RuleStatus) DeepCopy() *RuleStatus

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

func (*RuleStatus) DeepCopyInto

func (in *RuleStatus) DeepCopyInto(out *RuleStatus)

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

type Upstream

type Upstream struct {
	// URL defines the target URL for incoming requests
	// +kubebuilder:validation:MinLength=3
	// +kubebuilder:validation:MaxLength=256
	// +kubebuilder:validation:Pattern=`^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/\n]+)`
	URL string `json:"url"`
	// StripPath replaces the provided path prefix when forwarding the requested URL to the upstream URL.
	// +optional
	StripPath *string `json:"stripPath,omitempty"`
	// PreserveHost includes the host and port of the url value if set to false. If true, the host and port of the ORY Oathkeeper Proxy will be used instead.
	// +optional
	PreserveHost *bool `json:"preserveHost,omitempty"`
}

Upstream represents the location of a server where requests matching a rule should be forwarded to.

func (*Upstream) DeepCopy

func (in *Upstream) DeepCopy() *Upstream

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

func (*Upstream) DeepCopyInto

func (in *Upstream) DeepCopyInto(out *Upstream)

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

type UpstreamJSON

type UpstreamJSON struct {
	URL          string  `json:"url"`
	StripPath    *string `json:"strip_path,omitempty"`
	PreserveHost *bool   `json:"preserve_host"`
}

UpstreamJSON is a helper struct that representats Oathkeeper's upstream object.

func (*UpstreamJSON) DeepCopy

func (in *UpstreamJSON) DeepCopy() *UpstreamJSON

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

func (*UpstreamJSON) DeepCopyInto

func (in *UpstreamJSON) DeepCopyInto(out *UpstreamJSON)

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

type Validation

type Validation struct {
	// +optional
	Valid *bool `json:"valid,omitempty"`
	// +optional
	Error *string `json:"validationError,omitempty"`
}

Validation defines the validation state of Rule

func (*Validation) DeepCopy

func (in *Validation) DeepCopy() *Validation

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

func (*Validation) DeepCopyInto

func (in *Validation) DeepCopyInto(out *Validation)

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