Sha256: 354b74e6a62ace0a74d9cde2dcaba4a4980d5bcd6b74b3eb88d3a4fbc5bb4109

Contents?: true

Size: 697 Bytes

Versions: 49

Compression:

Stored size: 697 Bytes

Contents

# bandwidth
#
# This file was automatically generated by APIMATIC v2.0
# ( https://apimatic.io ).

require 'base64'

module Bandwidth
  # Utility class for basic authorization.
  class MessagingBasicAuth
    # Add basic authentication to the request.
    # @param [HttpRequest] The HttpRequest object to which authentication will
    # be added.
    def self.apply(config, http_request)
      username = config.messaging_basic_auth_user_name
      password = config.messaging_basic_auth_password
      value = Base64.strict_encode64("#{username}:#{password}")
      header_value = "Basic #{value}"
      http_request.headers['Authorization'] = header_value
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
bandwidth-sdk-10.5.0 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-10.4.0 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-10.3.0 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-10.2.0 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-10.1.0 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-10.0.0 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-9.4.1 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-9.4.0 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-9.3.0 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-9.2.0 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-9.1.2 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-9.1.1 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-9.1.0 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-9.0.0 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-8.0.0 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-7.1.0 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-7.0.0 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-6.2.0 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-6.1.0 lib/bandwidth/http/auth/messaging_basic_auth.rb
bandwidth-sdk-6.0.0 lib/bandwidth/http/auth/messaging_basic_auth.rb