Skip to content

Commit

Permalink
Update tests to use new config
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Cattermole <acatterm@redhat.com>
  • Loading branch information
adam-cattermole authored and didierofrivia committed Sep 4, 2024
1 parent 8fe18d5 commit 6c9343d
Showing 1 changed file with 34 additions and 14 deletions.
48 changes: 34 additions & 14 deletions tests/rate_limited.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ fn it_loads() {

let root_context = 1;
let cfg = r#"{
"failureMode": "deny",
"rateLimitPolicies": []
"extensions": {},
"policies": []
}"#;

module
Expand Down Expand Up @@ -90,12 +90,17 @@ fn it_limits() {

let root_context = 1;
let cfg = r#"{
"failureMode": "deny",
"rateLimitPolicies": [
"extensions": {
"limitador": {
"type": "ratelimit",
"endpoint": "limitador-cluster",
"failureMode": "deny"
}
},
"policies": [
{
"name": "some-name",
"domain": "RLS-domain",
"service": "limitador-cluster",
"hostnames": ["*.toystore.com", "example.com"],
"rules": [
{
Expand Down Expand Up @@ -228,12 +233,17 @@ fn it_passes_additional_headers() {

let root_context = 1;
let cfg = r#"{
"failureMode": "deny",
"rateLimitPolicies": [
"extensions": {
"limitador": {
"type": "ratelimit",
"endpoint": "limitador-cluster",
"failureMode": "deny"
}
},
"policies": [
{
"name": "some-name",
"domain": "RLS-domain",
"service": "limitador-cluster",
"hostnames": ["*.toystore.com", "example.com"],
"rules": [
{
Expand Down Expand Up @@ -380,12 +390,17 @@ fn it_rate_limits_with_empty_conditions() {

let root_context = 1;
let cfg = r#"{
"failureMode": "deny",
"rateLimitPolicies": [
"extensions": {
"limitador": {
"type": "ratelimit",
"endpoint": "limitador-cluster",
"failureMode": "deny"
}
},
"policies": [
{
"name": "some-name",
"domain": "RLS-domain",
"service": "limitador-cluster",
"hostnames": ["*.com"],
"rules": [
{
Expand Down Expand Up @@ -492,12 +507,17 @@ fn it_does_not_rate_limits_when_selector_does_not_exist_and_misses_default_value

let root_context = 1;
let cfg = r#"{
"failureMode": "deny",
"rateLimitPolicies": [
"extensions": {
"limitador": {
"type": "ratelimit",
"endpoint": "limitador-cluster",
"failureMode": "deny"
}
},
"policies": [
{
"name": "some-name",
"domain": "RLS-domain",
"service": "limitador-cluster",
"hostnames": ["*.com"],
"rules": [
{
Expand Down

0 comments on commit 6c9343d

Please sign in to comment.