This PR introduces new APIs in the OHTTP library to support chunked OHTTP.
encapsulate_stream in ServerResponse encapsulates a stream of chunks (vector of bytes). It returns a stream of encapsulated chunks in chunked OHTTP format. This includes a nonce, non-final chunks, final chunk indicator, and a final chunk.
decapsulate_stream in ClientResponse decapsulates an encapsulated stream.
The PR also includes changes to ohttp server and client to use these APIs. This requires turning an HTTP chunked response into a stream.
Additional changes:
Remove KMS specific logic from library move it into ohttp-client
URL validation in container startup script
Consistent tracing using log crate.
TODOs:
[x] encapsulate_stream currently splits incoming chunks into 16K chunks to address errors we have seen before. We need to understand why these errors occur, and decide if this logic stays in the library or the client.
This PR introduces new APIs in the OHTTP library to support chunked OHTTP.
encapsulate_stream
inServerResponse
encapsulates a stream of chunks (vector of bytes). It returns a stream of encapsulated chunks in chunked OHTTP format. This includes a nonce, non-final chunks, final chunk indicator, and a final chunk.decapsulate_stream
inClientResponse
decapsulates an encapsulated stream.The PR also includes changes to ohttp server and client to use these APIs. This requires turning an HTTP chunked response into a stream.
Additional changes:
TODOs:
encapsulate_stream
currently splits incoming chunks into 16K chunks to address errors we have seen before. We need to understand why these errors occur, and decide if this logic stays in the library or the client.