class Chemtrails::BasicAuthConfigurationFetcher

Public Class Methods

new(configuration_fetcher) click to toggle source
# File lib/chemtrails/basic_auth_configuration_fetcher.rb, line 3
def initialize(configuration_fetcher)
  @configuration_fetcher = configuration_fetcher
end

Public Instance Methods

fetch_configuration(url, application, environment, branch, username, password) click to toggle source
# File lib/chemtrails/basic_auth_configuration_fetcher.rb, line 7
def fetch_configuration(url, application, environment, branch, username, password)
  auth_header = "Basic #{encode_credentials(username, password)}"
  @configuration_fetcher.fetch_configuration(url, application, environment, branch, auth_header)
end

Private Instance Methods

encode_credentials(username, password) click to toggle source
# File lib/chemtrails/basic_auth_configuration_fetcher.rb, line 14
def encode_credentials(username, password)
  Base64.encode64("#{username}:#{password}").chomp
end