consul/agent/grpc-external
Iryna Shustava d747b51dab
Handle ACL errors consistently when blocking query timeout is reached. (#20876)
Currently, when a client starts a blocking query and an ACL token expires within
that time, Consul will return ACL not found error with a 403 status code. However,
sometimes if an ACL token is invalidated at the same time as the query's deadline is reached,
Consul will instead return an empty response with a 200 status code.

This is because of the events being executed.
1. Client issues a blocking query request with timeout `t`.
2. ACL is deleted.
3. Server detects a change in ACLs and force closes the gRPC stream.
4. Client resubscribes with the same token and resets its state (view).
5. Client sees "ACL not found" error.

If ACL is deleted before step 4, the client is unaware that the stream was closed due to
an ACL error and will return an empty view (from the reset state) with the 200 status code.

To fix this problem, we introduce another state to the subsciption to indicate when a change
to ACLs has occured. If the server sees that there was an error due to ACL change, it will
re-authenticate the request and return an error if the token is no longer valid.

Fixes #20790
2024-03-22 14:59:54 -06:00
..
limiter [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
services Handle ACL errors consistently when blocking query timeout is reached. (#20876) 2024-03-22 14:59:54 -06:00
testutils NET-5824 Exported services api (#20015) 2024-01-23 10:06:59 +05:30
forward.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
options.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
options_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
querymeta.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
querymeta_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
server.go missing prefix / (#20447) 2024-02-02 12:48:45 -08:00
stats_test.go only forwarding the resource service traffic in client agent to server agent (#20347) 2024-01-31 12:05:47 -08:00
utils.go NET-5824 Exported services api (#20015) 2024-01-23 10:06:59 +05:30