class Bandwidth::PhoneNumberLookupBasicAuth
Utility class for basic authorization.
Public Class Methods
apply(config, http_request)
click to toggle source
Add basic authentication to the request. @param [HttpRequest] The HttpRequest
object to which authentication will be added.
# File lib/bandwidth/http/auth/phone_number_lookup_basic_auth.rb, line 14 def self.apply(config, http_request) username = config.phone_number_lookup_basic_auth_user_name password = config.phone_number_lookup_basic_auth_password value = Base64.strict_encode64("#{username}:#{password}") header_value = "Basic #{value}" http_request.headers['Authorization'] = header_value end