794 Commits

Author SHA1 Message Date
HoneyryderChuck
d9ffa846a6 Merge branch 'issue-113' 2021-02-12 12:52:20 +00:00
HoneyryderChuck
46862068b2 bumped to 0.11.2 2021-02-12 11:15:19 +00:00
HoneyryderChuck
a128f42c5c hotfix: use Time.parse to parse cookie datetimes instead, as they need to be 6265-compliant, which Time.httpdate isn't for 2021-02-12 11:08:19 +00:00
HoneyryderChuck
7c1d29ec1a aws sigv4: fixing usage of hashing algorithm 2021-02-08 01:37:24 +00:00
HoneyryderChuck
005ae539ea fixing multipart encoder error rewind
two bugs were found. first, only file bodies would be rewinded, whereas
other rewindable (i.e. stringios and such) would be ignored. also,
part_index needed to be reset to 0, so that the parts would be flushed
sequentially (second request body was always empty).
2021-02-07 15:49:08 +00:00
HoneyryderChuck
fd28741a97 fixing retry protocol bug for not-completely-flushed requests
a bug was found where in certain cases, a server responds with an error
before the request fully buffers the body. Under retries, the request
is reset, however, the http/2 conn handler kept the last chunk around,
which it would flush before writing the second request body, resulting
in byte-accounting issues. Therefore, response clean up request state
before yielding.
2021-02-07 15:48:36 +00:00
HoneyryderChuck
9ca4cbe68b yield error response on frame protocol errors for a given stream
stream HTTP/2 framing errors were being yielded directly into the connection. This had
the issue of not closing the request, thereby causing an infinite loop
when closing the connection. This seemed to be the issue in CI.
2021-02-07 15:16:26 +00:00
HoneyryderChuck
5a9277d8f4 logging multipart retry test, this seems to be the onne hanging from time to time... 2021-02-06 16:34:47 +00:00
HoneyryderChuck
408e71a490 clean unused options, prefer using kwargs redirectionn for #aws_sdk_authentication instead 2021-02-06 16:24:35 +00:00
HoneyryderChuck
d9326ac027 fixing the disable of kee-alives when setting max-concurrent-connections
to 1

A check was introduced limiting the number of requests send at once.
However. the connection header was set to "close" as well, because
the accounting involved the number of concurrent connections allowed.
This is now fixed, by doing accounting separately.
2021-02-05 19:28:38 +00:00
HoneyryderChuck
3f3e1cd9cf limiting the number of max concurrent connnections for the awk
authentication plugin

TIL that S3 does not speak HTTP/2 (cloudfront does). Also, AWS sigv4
verification breaks with pipelined requests, therefore, we have to send
them one at a time.

GCP does provide HTTP/2 support, so let's test there as well.
2021-02-05 18:42:39 +00:00
HoneyryderChuck
e1d305b4d9 adding expect and compression plugins by default to the aws_sigv4 plugin
It's expected that this endpoint will be used i most cases for file
uploads, so both plugins will be important to improve throughput and
auth-fail-fast scenarios
2021-02-03 12:52:55 +00:00
HoneyryderChuck
2875e81d16 testing against patched openssl version (and sending all artifacts to coverage job in CI) 2021-02-02 19:42:43 +00:00
HoneyryderChuck
5e31836ac2 changing the API so that a credentials object can be passed to sigv4
this allows the aws-sdk plugin to pass a wrapped Aws::Credentials
downstream, which provides the username/password vars. this is
important, as some of the strategies, such as the web identity token,
also revalidate these parameters.
2021-02-02 18:33:24 +00:00
HoneyryderChuck
ae1060157a changing the name of the plugin to aws_sdk_authentication, removing depenndency on s3 gem (only aws-sdk-core) 2021-02-02 18:33:24 +00:00
HoneyryderChuck
463dad46cb added the aws signature on top of the aws-sigv4 plugin, with support for using aws-sdk-core ready-made config 2021-02-02 18:33:24 +00:00
HoneyryderChuck
755b895b08 added initial aws sigv4 functional test 2021-02-02 18:33:24 +00:00
HoneyryderChuck
48051d37c0 adding initial implementation of sigv4 request signing, which passed the aws-sdk-sigv4 tests 2021-02-02 18:33:24 +00:00
HoneyryderChuck
db036aaefa protocol: passing protocol specific headers as a request callback 2021-02-02 18:33:24 +00:00
HoneyryderChuck
f415d1b66b added tests for aws sigv4 2021-02-02 18:33:24 +00:00
HoneyryderChuck
065bfc48dc do not rely on deflater being initialized at this point 2021-01-31 16:19:49 +00:00
HoneyryderChuck
838f9a3e11 added ruby-tls license to the ffi-based files 2021-01-31 16:07:42 +00:00
HoneyryderChuck
574a478cc8 changing indentation, registering TLS class 2021-01-31 15:51:34 +00:00
HoneyryderChuck
2749763d8c relaxed constraints on verify callback 2021-01-31 15:51:34 +00:00
HoneyryderChuck
2ecfde95d8 fixing cerfificate hostname validation callback 2021-01-31 15:51:34 +00:00
HoneyryderChuck
0b7dbb8cfa alpn refactoring 2021-01-31 15:51:34 +00:00
HoneyryderChuck
87b9a6c49e moving away from the single-file ruby-tls, breaking down into components 2021-01-31 15:51:34 +00:00
HoneyryderChuck
507e6f6674 exposing certificate verification errors upstream, openssl style 2021-01-31 15:51:34 +00:00
HoneyryderChuck
da21b4a342 updated verify certs callback, inorder only to verify the hostname when dealing with the leaf certificate 2021-01-31 15:51:34 +00:00
HoneyryderChuck
384d273715 new ssl option: :hostname -> the SNI hostname used in the TLS handshake 2021-01-31 15:51:34 +00:00
HoneyryderChuck
f1f85ecfc7 maintaining own fork of ruby-tls
The ruby-tls gem hasn't received an update in 3 years, and haven't
actioned on issues that old, which leads me to believe it was abandoned.
Therefore, I now maintain this fork, and this allows me to quickly
identify issues.

The flow within the IO wrapper has been dealt with as well
2021-01-31 15:51:33 +00:00
HoneyryderChuck
f423ea69cb IO wrapper using the ruby-tls handler 2021-01-30 23:19:02 +00:00
HoneyryderChuck
037a435163 bumped to 0.11.1 2021-01-30 17:17:16 +00:00
HoneyryderChuck
d645ac8596 added quick fixes to make http tests run with truffleruby, until the patches are released 2021-01-30 15:31:03 +00:00
HoneyryderChuck
129bcf1871 fixing decompression issue when last DATA frame is empty
An error arose in decompressing a GZIP body from an HTTP/2 response,
where the second-to-last DATA frame actually sent the last meaningful
data chunk, and the server emitted an additional empty frame with
`end_stream` flag.

This error was introduced in the transition to ruby 3 and RBS
refactorings, when the gzip inflater closes automatically once all the
advertised (in "content-length" header) bytes are successfully
decompressed. In the case described above, the empty chunk still dives
into the decompressor and passed to the now closed ZLib::Stream, which
triggeres an exception.

The fix is to halt decompression early in the chain. Response#write
already knows how to deal with empty frames, so the control should be
passed there.

Fixes #112
2021-01-29 18:09:11 +00:00
HoneyryderChuck
af8539a7a7 multipart form: skip parts where value is nil 2021-01-14 16:07:11 +00:00
HoneyryderChuck
b8745bb3cc fixed concatenation of formdata parts, which wasn't filling HTTP/2 frames, and was causing miscalculations for buffers 2021-01-14 16:07:11 +00:00
HoneyryderChuck
890111c2f8 quote fields in formdata params for multipart 2021-01-14 16:07:11 +00:00
HoneyryderChuck
644783c642 keep loading http/form_data, mark for deprecation 2021-01-14 16:07:11 +00:00
HoneyryderChuck
654b791314 bumped to 0.11.0 2021-01-14 11:05:06 +00:00
HoneyryderChuck
bebd2bd11e don't account for #build_requests misusages (private API, we control it) 2021-01-14 00:50:23 +00:00
HoneyryderChuck
b2dff40839 reraise IOError on yield of io, when the error doesn't involve the
client io specifically.

This was the case for multipart tests raising IOErrors on upload files
instead of IO, which was causing the loop to break.
2021-01-14 00:37:00 +00:00
HoneyryderChuck
6e0df603db removed disabling of coverage and needless conditionals 2021-01-14 00:36:44 +00:00
HoneyryderChuck
a29961962b allowing multipart requests to be retried (although, to be fair, user has to push a lot of knobs to do so) 2021-01-13 13:40:05 +00:00
HoneyryderChuck
fd91aca873 closing descriptors as they're flushed by the request.
this wasn't as easy due to reliance on Request#bytesize, which was
calling File#size on the closed file descriptors, which raised an
IOError caught by the selector. Caching fixes it, and removes the
recalculations from the hot path as well.
2021-01-13 13:40:05 +00:00
HoneyryderChuck
1691f50af5 fixing usage of Enumerable#sum for older rubies 2021-01-13 12:27:13 +00:00
HoneyryderChuck
d39c82cea8 do not close parts (http2 handler failing to write when nit does) 2021-01-13 12:27:13 +00:00
HoneyryderChuck
42297cd38d simplifying apis, testing pathnames 2021-01-13 12:27:13 +00:00
HoneyryderChuck
478558d4bf making sure we don't leave file descriptors behind 2021-01-13 00:00:09 +00:00
HoneyryderChuck
d2ee0cdb78 extracting mime type in different strategies (inherited from shrine's determine mime type plugin) 2021-01-13 00:00:09 +00:00