@Nonnull public static CLI get() { return GlobalConfiguration.all().getInstance(CLI.class); }
public static ApiTokenPropertyConfiguration get() { return GlobalConfiguration.all().get(ApiTokenPropertyConfiguration.class); }
public static @Nonnull DownloadSettings get() { return GlobalConfiguration.all().getInstance(DownloadSettings.class); }
public static @Nonnull QueueItemAuthenticatorConfiguration get() { return GlobalConfiguration.all().getInstance(QueueItemAuthenticatorConfiguration.class); }
public static @Nonnull GlobalMavenConfig get() { return GlobalConfiguration.all().getInstance(GlobalMavenConfig.class); }
public static @Nonnull ArtifactManagerConfiguration get() { return GlobalConfiguration.all().getInstance(ArtifactManagerConfiguration.class); }
public static @Nonnull JenkinsLocationConfiguration get() { return GlobalConfiguration.all().getInstance(JenkinsLocationConfiguration.class); }
private List<String> getStandardConfig() { List<String> configParameters = getBundledCasCURIs(); CasCGlobalConfig casc = GlobalConfiguration.all().get(CasCGlobalConfig.class); String cascPath = casc != null ? casc.getConfigurationPath() : null; String configParameter = System.getProperty( CASC_JENKINS_CONFIG_PROPERTY, System.getenv(CASC_JENKINS_CONFIG_ENV) ); if (!StringUtils.isBlank(cascPath)) { configParameter = cascPath; } if (configParameter == null) { String fullPath = Jenkins.getInstance().getRootDir() + File.separator + DEFAULT_JENKINS_YAML_PATH; if (Files.exists(Paths.get(fullPath))) { configParameter = fullPath; } } if (configParameter != null) { // Add external config parameter configParameters.add(configParameter); } if (configParameters.isEmpty()) { LOGGER.log(Level.FINE, "No configuration set nor default config file"); } return configParameters; }
public static @CheckForNull User isConnectingUsingApiToken(String username, String tokenValue){ User user = User.getById(username, false); if(user == null){ ApiTokenPropertyConfiguration apiTokenConfiguration = GlobalConfiguration.all().getInstance(ApiTokenPropertyConfiguration.class); if(apiTokenConfiguration.isTokenGenerationOnCreationEnabled()){ String generatedTokenOnCreation = Util.getDigestOf(ApiTokenProperty.API_KEY_SEED.mac(username)); boolean areTokenEqual = MessageDigest.isEqual( generatedTokenOnCreation.getBytes(StandardCharsets.US_ASCII), tokenValue.getBytes(StandardCharsets.US_ASCII) ); if(areTokenEqual){ // directly return the user freshly created // and no need to check its token as the generated token // will be the same as the one we checked just above return User.getById(username, true); } } }else{ ApiTokenProperty t = user.getProperty(ApiTokenProperty.class); if (t!=null && t.matchesPassword(tokenValue)) { return user; } } return null; } }
sources = candidatePaths; configureWith(getConfigFromSources(getSources())); CasCGlobalConfig config = GlobalConfiguration.all().get(CasCGlobalConfig.class); if(config != null) { config.setConfigurationPath(newSource);
/** * Gets local configuration. * * @return {@code null} if the {@link GlobalConfiguration#all()} list does not contain this extension. * Most likely it means that the Jenkins instance has not been fully loaded yet. */ public static @CheckForNull JenkinsLocationConfiguration get() { return GlobalConfiguration.all().get(JenkinsLocationConfiguration.class); }
/** * Returns this singleton instance. * * @return the singleton. */ public static DockerPluginConfiguration get() { return GlobalConfiguration.all().get(DockerPluginConfiguration.class); }
/** * The singleton instance registered in the Jenkins extension list. * * @return the instance */ public static ShutdownConfiguration getInstance() { return GlobalConfiguration.all().get(ShutdownConfiguration.class); } }
public static HttpRequestGlobalConfig get() { return GlobalConfiguration.all().get(HttpRequestGlobalConfig.class); }
public static @Nonnull GlobalLibraries get() { GlobalLibraries instance = GlobalConfiguration.all().get(GlobalLibraries.class); if (instance == null) { // TODO would be useful to have an ExtensionList.getOrFail throw new IllegalStateException(); } return instance; }
public static GlobalConfiguration get() { return jenkins.model.GlobalConfiguration.all().get(GlobalConfiguration.class); }
/** * Returns the singleton instance of this {@link ParserConfiguration}. * * @return the singleton instance */ public static ParserConfiguration getInstance() { return GlobalConfiguration.all().get(ParserConfiguration.class); }
/** * Returns this singleton instance. * * @return the singleton. */ public static Optional<ViolationsToBitbucketServerGlobalConfiguration> get() { return Optional.fromNullable( GlobalConfiguration.all().get(ViolationsToBitbucketServerGlobalConfiguration.class)); }
public static SetupConfig get() { return GlobalConfiguration.all().get(SetupConfig.class); }
@Nonnull public static CLI get() { CLI instance = GlobalConfiguration.all().get(CLI.class); if (instance == null) { // should not happen return new CLI(); } return instance; }