diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index dba98719..0d892037 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2021-10-31 21:29:49 UTC using RuboCop version 1.22.3. +# on 2021-11-01 06:50:04 UTC using RuboCop version 1.22.3. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -266,7 +266,7 @@ Layout/InitialIndentation: Exclude: - 'lib/oauth/request_proxy/curb_request.rb' -# Offense count: 11 +# Offense count: 10 # Cop supports --auto-correct. # Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment. Layout/LeadingCommentSpace: @@ -275,7 +275,6 @@ Layout/LeadingCommentSpace: - '**/*.markdown' - 'lib/oauth/helper.rb' - 'lib/oauth/request_proxy.rb' - - 'oauth.gemspec' - 'test/cases/spec/1_0-final/test_construct_request_url.rb' - 'test/units/test_request_token.rb' @@ -559,12 +558,12 @@ Lint/UselessMethodDefinition: # Offense count: 50 # Configuration parameters: IgnoredMethods, CountRepeatedAttributes. Metrics/AbcSize: - Max: 59 + Max: 63 # Offense count: 9 # Configuration parameters: CountComments, CountAsOne. Metrics/ClassLength: - Max: 282 + Max: 284 # Offense count: 7 # Configuration parameters: IgnoredMethods. @@ -584,7 +583,7 @@ Metrics/ParameterLists: # Offense count: 7 # Configuration parameters: IgnoredMethods. Metrics/PerceivedComplexity: - Max: 18 + Max: 20 # Offense count: 16 # Cop supports --auto-correct. @@ -760,14 +759,13 @@ Style/AndOr: - 'lib/oauth/consumer.rb' - 'lib/oauth/request_proxy/rack_request.rb' -# Offense count: 9 +# Offense count: 8 # Cop supports --auto-correct. Style/ArrayJoin: Exclude: - 'lib/oauth/cli/base_command.rb' - 'lib/oauth/cli/sign_command.rb' - 'lib/oauth/client/net_http.rb' - - 'lib/oauth/errors/unauthorized.rb' - 'lib/oauth/helper.rb' - 'lib/oauth/request_proxy/base.rb' diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b5e4bf3..b4c0b5c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Setup Rubocop (#205, #208 by @pboling) * Added CODE_OF_CONDUCT.md (#217, #218 by @pboling) * Added FUNDING.yml (#217, #218 by @pboling) +* Added Client Certificate Options: :ssl_client_cert and :ssl_client_key (#136, #220 by @pboling) ### Changed diff --git a/lib/oauth/consumer.rb b/lib/oauth/consumer.rb index 0e578a52..14eddea1 100644 --- a/lib/oauth/consumer.rb +++ b/lib/oauth/consumer.rb @@ -383,6 +383,8 @@ def create_http(_url = nil) http_object.read_timeout = http_object.open_timeout = @options[:timeout] || 60 http_object.open_timeout = @options[:open_timeout] if @options[:open_timeout] http_object.ssl_version = @options[:ssl_version] if @options[:ssl_version] + http_object.cert = @options[:ssl_client_cert] if @options[:ssl_client_cert] + http_object.key = @options[:ssl_client_key] if @options[:ssl_client_key] http_object.set_debug_output(debug_output) if debug_output http_object