lib/liberty_buildpack/util/cache/authentication_utils.rb
def authorization_value(url)
        unless @@auth_config
          # Load auth.yml and make sure the information is not logged
          @@auth_config = LibertyBuildpack::Util::ConfigurationUtils.load('auth', true, false)
          # Sort keys by size with longest first.
          @@sorted_keys = @@auth_config.keys.sort { |a, b| b.size <=> a.size }
        end

        # Find the longest substring of the url among keys
        key = @@sorted_keys.find { |k| url.start_with? k }
        key ? @@auth_config[key] : nil
      end
# Loads authentication information from config/auth.yml as a map from
# URL substring to the authorization object and returns the best match
# for the provided URL.
#
# @param [String] URL the authorization is required for
# @return [Stringi, Hash] the Authorization data or nil if not found
Loads authentication information from config/auth.yml as a map from
URL substring to the authorization object and returns the best match
for the provided URL.
Loads authentication information from config / auth . yml as a map from URL substring to the authorization object and returns the best match for the provided URL .
def authorization_value(url)
        unless @@auth_config
          @@auth_config = LibertyBuildpack::Util::ConfigurationUtils.load('auth', true, false)
          @@sorted_keys = @@auth_config.keys.sort { |a, b| b.size <=> a.size }
        end
        key = @@sorted_keys.find { |k| url.start_with? k }
        key ? @@auth_config[key] : nil
      end
def authorization_value ( url ) unless @@auth_config @@auth_config = LibertyBuildpack :: Util :: ConfigurationUtils . load ( 'auth' , true , false ) @@sorted_keys = @@auth_config . keys . sort { | a , b | b . size <=> a . size } end key = @@sorted_keys . find { | k | url . start_with? k } key ? @@auth_config [ key ] : nil end
Loads authentication information from config/auth.yml as a map from
URL substring to the authorization object and returns the best match
for the provided URL.
Loads authentication information from config / auth . yml as a map from URL substring to the authorization object and returns the best match for the provided URL .
# Load auth.yml and make sure the information is not logged # Sort keys by size with longest first. # Find the longest substring of the url among keys
the Authorization data or nil if not found
the Authorization data or nil if not found
Stringi, Hash
url
URL the authorization is required for
URL the authorization is required for