Sha256: f1be6f4413eec5817e3dbec5dc00ee3c32a51f5ee7cc50f9fd4556570a6ac783

Contents?: true

Size: 750 Bytes

Versions: 9

Compression:

Stored size: 750 Bytes

Contents

# frozen_string_literal: true

require 'digest/md5'
require 'param/secure_auth_header'
require 'param/simple_auth_header'

module Uploadcare
  module Param
    # This object returns headers needed for authentication
    # This authentication method is more secure, but more tedious
    class AuthenticationHeader
      # @see https://uploadcare.com/docs/api_reference/rest/requests_auth/#auth-uploadcare
      def self.call(**options)
        case Uploadcare.config.auth_type
        when 'Uploadcare'
          SecureAuthHeader.call(**options)
        when 'Uploadcare.Simple'
          SimpleAuthHeader.call
        else
          raise ArgumentError, "Unknown auth_scheme: '#{Uploadcare.config.auth_type}'"
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
uploadcare-ruby-3.3.2 lib/uploadcare/param/authentication_header.rb
uploadcare-ruby-3.3.1 lib/uploadcare/param/authentication_header.rb
uploadcare-ruby-3.3.0 lib/uploadcare/param/authentication_header.rb
uploadcare-ruby-3.2.0 lib/uploadcare/param/authentication_header.rb
uploadcare-ruby-3.1.1 lib/uploadcare/param/authentication_header.rb
uploadcare-ruby-3.1.0 lib/uploadcare/param/authentication_header.rb
uploadcare-ruby-3.1.0.pre.rc1 lib/uploadcare/param/authentication_header.rb
uploadcare-ruby-3.0.5 lib/uploadcare/param/authentication_header.rb
uploadcare-ruby-3.0.3 lib/uploadcare/param/authentication_header.rb