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

Implement skip_if_absent for the RequestHeaders action #29

Closed
eguzki opened this issue Feb 2, 2023 · 1 comment
Closed

Implement skip_if_absent for the RequestHeaders action #29

eguzki opened this issue Feb 2, 2023 · 1 comment

Comments

@eguzki
Copy link
Contributor

eguzki commented Feb 2, 2023

The Envoys's RequestHeaders action has a field called skip_if_absent that changes the behavior when enabled.

The spec:

  • It should be an optional field with a default value: false.
  • When skip_if_absent is false, the action behaves as it does now. When the header is absent, the entire descriptor is discarded, no matter what other action of the same configuration tell.
  • When skip_if_absent is true and the header is not present in the request, the descriptor is not discarded, however the action does not generate any descriptor entry. This behavior can lead to an empty descriptor. That is allowed. An empty descriptor is still a valid descriptor. Rate limit service can be called with an empty descriptor. Rate limit request with an empty descriptor
limitador_1  | [2023-02-02T11:30:32Z DEBUG limitador_server::envoy_rls::server] Request received: Request { metadata: MetadataMap { headers: {"te": "trailers", "grpc-timeout": "5000m", "content-type": "application/grpc", "x-envoy-internal": "true", "x-forwarded-for": "172.19.0.4", "x-envoy-expected-rq-timeout-ms": "5000"} }, message: RateLimitRequest { domain: "rls-domain-a", descriptors: [RateLimitDescriptor { entries: [], limit: None }], hits_addend: 1 }, extensions: Extensions }

Note the empty descriptor

descriptors: [RateLimitDescriptor { entries: [], limit: None }]
@alexsnaps
Copy link
Member

This might not be relevant anymore, given kuadrant-operator#179, where the actions aren't exposed as such anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: To test
Development

No branches or pull requests

2 participants