Class RegistryHelper

java.lang.Object
jenkins.plugins.nodejs.configfiles.RegistryHelper

public final class RegistryHelper extends Object
Helper to fill properly credentials in the the user configuration file.
Since:
1.0
Author:
Nikolas Falco
  • Constructor Details

  • Method Details

    • resolveCredentials

      public Map<String,com.cloudbees.plugins.credentials.common.StandardCredentials> resolveCredentials(Run<?,?> build)
      Resolves all registry credentials and returns a map paring registry URL to credential.
      Parameters:
      build - a build being run
      Returns:
      map of registry URL - credential
    • fillRegistry

      public String fillRegistry(String npmrcContent, Map<String,com.cloudbees.plugins.credentials.common.StandardCredentials> registry2Credentials)
      Fill the npmpc user config with the given registries.
      Parameters:
      npmrcContent - .npmrc user config
      registry2Credentials - the credentials to be inserted into the user config (key: registry URL, value: Jenkins credentials)
      Returns:
      the updated version of the npmrcContent with the registry credentials added
    • fillRegistry

      public String fillRegistry(String npmrcContent, Map<String,com.cloudbees.plugins.credentials.common.StandardCredentials> registry2Credentials, boolean npm9Format)
      Fill the npmpc user config with the given registries.
      Parameters:
      npmrcContent - .npmrc user config
      registry2Credentials - the credentials to be inserted into the user config (key: registry URL, value: Jenkins credentials)
      npm9Format - use npm version 9 format
      Returns:
      the updated version of the npmrcContent with the registry credentials added
    • calculatePrefix

      @NonNull public String calculatePrefix(@NonNull String registryURL)
    • compose

      @NonNull public String compose(@NonNull String registryPrefix, @NonNull String setting)
    • secretsForMasking

      @NonNull public List<String> secretsForMasking(Run<?,?> build)