lib/stripe/util.rb in stripe-12.5.0 vs lib/stripe/util.rb in stripe-12.6.0.pre.beta.1

- old
+ new

@@ -5,10 +5,11 @@ module Stripe module Util # Options that a user is allowed to specify. OPTS_USER_SPECIFIED = Set[ :api_key, + :authenticator, :idempotency_key, :stripe_account, :stripe_version ].freeze @@ -277,10 +278,16 @@ def self.normalize_opts(opts) case opts when String { api_key: opts } when Hash - check_api_key!(opts.fetch(:api_key)) if opts.key?(:api_key) + # If the user is using request signing for authentication, + # no need to check the api_key per request. + if !(opts.key?(:client) && + opts.fetch(:client).config.authenticator) && + opts.key?(:api_key) + check_api_key!(opts.fetch(:api_key)) + end # Explicitly use dup here instead of clone to avoid preserving freeze # state on input params. opts.dup else raise TypeError, "normalize_opts expects a string or a hash"