Class: BaTesterWithCustomParameters::BasicAuth
- Inherits:
-
Object
- Object
- BaTesterWithCustomParameters::BasicAuth
- Defined in:
- lib/ba_tester_with_custom_parameters/http/auth/basic_auth.rb
Overview
Utility class for basic authorization.
Class Method Summary collapse
-
.apply(config, http_request) ⇒ Object
Add basic authentication to the request.
Class Method Details
.apply(config, http_request) ⇒ Object
Add basic authentication to the request. be added.
14 15 16 17 18 19 20 |
# File 'lib/ba_tester_with_custom_parameters/http/auth/basic_auth.rb', line 14 def self.apply(config, http_request) username = config.username password = config.password value = Base64.strict_encode64("#{username}:#{password}") header_value = "Basic #{value}" http_request.headers['Authorization'] = header_value end |