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

Policy:3scale_batcher: Fix issues when caching policy is active. #1216

Merged
merged 1 commit into from
Aug 21, 2020

Conversation

eloycoto
Copy link
Contributor

@eloycoto eloycoto commented Aug 6, 2020

A user reported that when the caching mode is enabled, in allow mode, and 3scale-batcher is active, the handler for allowing all calls is no working as expected, and users got 403 response.

This commit allows users to get a correct authz when allow mode is enabled.

Fix THREESCALE-5753

Signed-off-by: Eloy Coto eloy.coto@acalustra.com

@eloycoto eloycoto requested a review from a team as a code owner August 6, 2020 13:56
@@ -615,3 +615,79 @@ my $jwt = encode_jwt(payload => {
["Authorization: Bearer $jwt", "Authorization: Bearer $jwt", "" , ""]
--- no_error_log
[error]


=== TEST 6: with caching policy (allow mode)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong test number.

In this case, the caching policy is configured as "allow". We define a
backend that returns 500
The caching policy will allow all request to the Upstream API.
down.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this line is misplaced.

@@ -143,6 +143,14 @@ local function handle_backend_denied(self, service, transaction, status, headers
return error(service, rejection_reason)
end

local function handle_backend_response_using_cache_handler(cache, transaction, backend_status, cache_handler)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks almost the same as the existing update_downtime_cache function.

A user reported that when the caching mode is enabled, in allow mode, and 3scale-batcher is active, the handler for allowing all calls is no working as expected, and users got 403 response.

This commit allows users to get a correct authz when allow mode is enabled.

Fix THREESCALE-5753

Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
@eloycoto eloycoto merged commit bde6036 into 3scale:master Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants