Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CEL Support #495

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion api/v1beta3/auth_config_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,21 @@ type PatternExpression struct {
Value string `json:"value,omitempty"`
}

type CelExpression struct {
Expression string `json:"expression,omitempty"`
}

type CelPredicate struct {
Predicate string `json:"predicate,omitempty"`
}

// +kubebuilder:validation:Enum:=eq;neq;incl;excl;matches
type PatternExpressionOperator string

type PatternExpressionOrRef struct {
PatternExpression `json:",omitempty"`
PatternRef `json:",omitempty"`

CelPredicate `json:",omitempty"`
// A list of pattern expressions to be evaluated as a logical AND.
All []UnstructuredPatternExpressionOrRef `json:"all,omitempty"`
// A list of pattern expressions to be evaluated as a logical OR.
Expand Down Expand Up @@ -199,6 +207,8 @@ type ValueOrSelector struct {
// Any pattern supported by https://pkg.go.dev/github.com/tidwall/gjson can be used.
// The following Authorino custom modifiers are supported: @extract:{sep:" ",pos:0}, @replace{old:"",new:""}, @case:upper|lower, @base64:encode|decode and @strip.
Selector string `json:"selector,omitempty"`

Expression CelExpression `json:",omitempty"`
}

type CommonEvaluatorSpec struct {
Expand Down Expand Up @@ -402,6 +412,8 @@ type PlainIdentitySpec struct {
// Any pattern supported by https://pkg.go.dev/github.com/tidwall/gjson can be used.
// The following Authorino custom modifiers are supported: @extract:{sep:" ",pos:0}, @replace{old:"",new:""}, @case:upper|lower, @base64:encode|decode and @strip.
Selector string `json:"selector"`

Expression CelExpression `json:",omitempty"`
}

type AnonymousAccessSpec struct{}
Expand Down Expand Up @@ -439,6 +451,8 @@ type HttpEndpointSpec struct {
// E.g. https://ext-auth-server.io/metadata?p={request.path}
Url string `json:"url"`

UrlExpression CelExpression `json:",omitempty"`

// HTTP verb used in the request to the service. Accepted values: GET (default), POST.
// When the request method is POST, the authorization JSON is passed in the body of the request.
// +optional
Expand Down
35 changes: 35 additions & 0 deletions api/v1beta3/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading