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

remove unused conditions #137

Merged
merged 6 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
96 changes: 0 additions & 96 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,102 +50,6 @@ evaluating to a `bool` value, while `Expression`, used for passing data to a ser

These expression can operate on the data made available to them through the Well Known Attributes, see below

#### Conditions, Selectors and Operators (deprecated!)

<details>

While still supported, these will eventually disappear. For now though, you still can express them as such:

```yaml
services:
auth-service:
type: auth
endpoint: auth-cluster
failureMode: deny
timeout: 10ms
ratelimit-service:
type: ratelimit
endpoint: ratelimit-cluster
failureMode: deny
actionSets:
- name: rlp-ns-A/rlp-name-A
routeRuleConditions:
hostnames: [ "*.toystore.com" ]
matches:
- selector: request.url_path
operator: startswith
value: /get
- selector: request.host
operator: eq
value: test.toystore.com
- selector: request.method
operator: eq
value: GET
actions:
- service: ratelimit-service
scope: rlp-ns-A/rlp-name-A
conditions: []
data:
- selector:
selector: request.headers.My-Custom-Header
- static:
key: admin
value: "1"
```

```Rust
#[derive(Deserialize, PartialEq, Debug, Clone)]
pub enum WhenConditionOperator {
#[serde(rename = "eq")]
EqualOperator,
#[serde(rename = "neq")]
NotEqualOperator,
#[serde(rename = "startswith")]
StartsWithOperator,
#[serde(rename = "endswith")]
EndsWithOperator,
#[serde(rename = "matches")]
MatchesOperator,
}
```

Selector of an attribute from the contextual properties provided by kuadrant.
See [Well Known Attributes](#Well-Known-Attributes) for more info about available attributes.

The struct is

```Rust
#[derive(Deserialize, Debug, Clone)]
pub struct SelectorItem {
// Selector of an attribute from the contextual properties provided by kuadrant
// during request and connection processing
pub selector: String,

// If not set it defaults to `selector` field value as the descriptor key.
#[serde(default)]
pub key: Option<String>,

// An optional value to use if the selector is not found in the context.
// If not set and the selector is not found in the context, then no data is generated.
#[serde(default)]
pub default: Option<String>,
}
```

Selectors are tokenized at each non-escaped occurrence of a separator character `.`.
Example:

```
Input: this.is.a.exam\.ple -> Retuns: ["this", "is", "a", "exam.ple"].
```

Some path segments include dot `.` char in them. For instance envoy filter
names: `envoy.filters.http.header_to_metadata`.
In that particular cases, the dot chat (separator), needs to be escaped.

</details>


### Well Known Attributes

| Attribute | Description |
Expand Down
Loading
Loading