From 88de44ebe3c40f9050553ce7c0018990b92c2f38 Mon Sep 17 00:00:00 2001 From: Mattia Date: Tue, 2 Oct 2018 15:26:39 +0100 Subject: [PATCH 1/4] Fix label name for contributing --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c7339ff51..e57be0234 100644 --- a/README.md +++ b/README.md @@ -360,7 +360,7 @@ of a major release, support for that Ruby version may be dropped. ## Contribute Do you want to contribute to Faraday? -Open the issues page and check for the `any volunteer?` label! +Open the issues page and check for the `help wanted` label! But before you start coding, please read our [Contributing Guide](https://github.com/lostisland/faraday/blob/master/.github/CONTRIBUTING.md) ## Copyright From e77ac3d9e8733a82d76c969c2b5c916232f5d2a4 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Fri, 19 Oct 2018 10:20:33 +0200 Subject: [PATCH 2/4] [1.0] [DOC] SSLOptions, Utils::Headers, Utils::ParamsHash (#826) --- lib/faraday/options.rb | 42 ++++++++++++++++++++++++++++++++++++++++++ lib/faraday/utils.rb | 7 +++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/lib/faraday/options.rb b/lib/faraday/options.rb index 9a43d3a29..15e1d5199 100644 --- a/lib/faraday/options.rb +++ b/lib/faraday/options.rb @@ -218,14 +218,56 @@ def stream_response? end end + # SSL-related options. + # + # @!attribute verify + # @return [Boolean] whether to verify SSL certificates or not + # + # @!attribute ca_file + # @return [String] CA file + # + # @!attribute ca_path + # @return [String] CA path + # + # @!attribute verify_mode + # @return [String] Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html) + # + # @!attribute cert_store + # @return [OpenSSL::X509::Store] certificate store + # + # @!attribute client_cert + # @return [String, OpenSSL::X509::Certificate] client certificate + # + # @!attribute client_key + # @return [String, OpenSSL::PKey::RSA, OpenSSL::PKey::DSA] client key + # + # @!attribute certificate + # @return [OpenSSL::X509::Certificate] certificate (Excon only) + # + # @!attribute private_key + # @return [OpenSSL::PKey::RSA, OpenSSL::PKey::DSA] private key (Excon only) + # + # @!attribute verify_depth + # @return [Integer] maximum depth for the certificate chain verification + # + # @!attribute version + # @return [String, Symbol] SSL version (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#method-i-ssl_version-3D) + # + # @!attribute min_version + # @return [String, Symbol] minimum SSL version (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#method-i-min_version-3D) + # + # @!attribute max_version + # @return [String, Symbol] maximum SSL version (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#method-i-max_version-3D) class SSLOptions < Options.new(:verify, :ca_file, :ca_path, :verify_mode, :cert_store, :client_cert, :client_key, :certificate, :private_key, :verify_depth, :version, :min_version, :max_version) + # @return [Boolean] true if should verify def verify? verify != false end + # @return [Boolean] true if should not verify def disable? !verify? end diff --git a/lib/faraday/utils.rb b/lib/faraday/utils.rb index 4ab1f3420..344b58609 100644 --- a/lib/faraday/utils.rb +++ b/lib/faraday/utils.rb @@ -4,7 +4,10 @@ module Faraday module Utils extend self - # Adapted from Rack::Utils::HeaderHash + # A case-insensitive Hash that preserves the original case of a header + # when set. + # + # Adapted from [Rack::Utils::HeaderHash](https://www.rubydoc.info/gems/rack/Rack/Utils/HeaderHash). class Headers < ::Hash def self.from(value) new(value) @@ -132,7 +135,7 @@ def names end end - # hash with stringified keys + # A hash with stringified keys. class ParamsHash < Hash def [](key) super(convert_key(key)) From 3ff3dbc43e4b02ab863ca97dec5eb8fd06e24d56 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Fri, 19 Oct 2018 12:13:53 +0200 Subject: [PATCH 3/4] [1.0] Travis CI matrix: Drop 2.2: 2.3+ new min version required (#828) --- .travis.yml | 1 - README.md | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 267bde692..5acd953df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ script: bundle exec script/test cache: bundler rvm: - - 2.2 - 2.3 - 2.4 - 2.5 diff --git a/README.md b/README.md index 6dcfcc68b..620aebed9 100644 --- a/README.md +++ b/README.md @@ -354,7 +354,7 @@ stubs.verify_stubbed_calls This library aims to support and is [tested against][travis] the following Ruby implementations: -* Ruby 2.2+ +* Ruby 2.3+ If something doesn't work on one of these Ruby versions, it's a bug. From ec3ccb128ca6cb6e260797500f9facecc8f070bf Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Fri, 19 Oct 2018 17:22:52 +0200 Subject: [PATCH 4/4] [1.0] UPGRADING.md: Mention Ruby 2.3+ (#829) --- UPGRADING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPGRADING.md b/UPGRADING.md index 451e10438..d3adbb98e 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -1,7 +1,7 @@ ## Faraday 1.0 * Dropped support for jruby and Rubinius. -* Officially supports Ruby 2.2+ +* Officially supports Ruby 2.3+ * In order to specify the adapter you now MUST use the `#adapter` method on the connection builder. If you don't do so and your adapter inherits from `Faraday::Adapter` then Faraday will raise an exception. Otherwise, Faraday will automatically push the default adapter at the end of the stack causing your request to be executed twice. ```ruby class OfficialAdapter < Faraday::Adapter