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>,
}
When the selector property does not exist, the behavior is ruled by the default field. Currently the implementation was enforcing a default value (empty string "") defeating the purpose of the default attribute.
Data selector should not generate return any value. Thus, descriptor should be empty and rate limiting service should not be called. Logs should not show any log from the limitador service or GRPC client.
What
Selectors in
rules[].data.selector[]
have adefault
named attribute to cover the use case where the property does not exist https://github.com/Kuadrant/wasm-shim/blob/main/src/configuration.rs#L7-L20When the selector property does not exist, the behavior is ruled by the
default
field. Currently the implementation was enforcing a default value (empty string""
) defeating the purpose of thedefault
attribute.Verification Steps
The wasm configuration applied for
*.a.com
isData selector should not generate return any value. Thus, descriptor should be empty and rate limiting service should not be called. Logs should not show any log from the limitador service or GRPC client.