Files
releases/util
Philip Conrad 4e01537fe7 server/authorizer: Fix gzip payload handling. (#6825)
This PR fixes an issue where an OPA running authorization policies would
be unable to handle gzipped request bodies.

Example OPA CLI setup:

    opa run -s --authorization=basic

Example request:

    echo -n '{}' | gzip | curl -H "Content-Encoding: gzip" --data-binary @- http://127.0.0.1:8181/v1/data

This would result in unhelpful error messages, like:

```json
{
  "code": "invalid_parameter",
  "message": "invalid character '\\x1f' looking for beginning of value"
}
```

The cause was that the request body handling system in the
`server/authorizer` package did not take gzipped payloads into
account. The fix was to borrow the gzip request body handling function
from `server/server.go`, to transparently decompress the body when
needed.

Fixes: #6804

Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
2024-06-27 09:55:19 +02:00
..
2023-02-21 13:51:23 -08:00
2016-08-02 16:57:15 -07:00
2017-04-26 15:04:48 -07:00
2024-03-25 11:28:12 -07:00
2017-04-26 15:04:48 -07:00
2020-08-06 14:34:27 -07:00