use of com.thoughtworks.go.config.SecretConfigs in project gocd by gocd.
the class SecretConfigsControllerV3 method index.
public String index(Request request, Response response) throws IOException {
SecretConfigs allSecretConfigs = configService.getAllSecretConfigs();
String etag = etagFor(allSecretConfigs);
if (fresh(request, etag)) {
return notModified(response);
}
setEtagHeader(response, etag);
return writerForTopLevelObject(request, response, writer -> SecretConfigsRepresenter.toJSON(writer, allSecretConfigs));
}
use of com.thoughtworks.go.config.SecretConfigs in project gocd by gocd.
the class InternalSecretConfigControllerV1 method index.
public String index(Request request, Response response) throws Exception {
SecretConfigs secretConfigs = secretConfigService.getAllSecretConfigs();
SecretConfigsViewModel configsViewModel = new SecretConfigsViewModel().setSecretConfigs(secretConfigs);
List<String> groups = pipelineConfigService.viewableGroupsFor(currentUsername()).stream().map(PipelineConfigs::getGroup).collect(toList());
List<String> envNames = environmentConfigService.getEnvironmentNames();
List<String> scms = pluggableScmService.listAllScms().stream().map(SCM::getName).collect(toList());
List<String> pkgRepos = packageRepositoryService.getPackageRepositories().stream().map(PackageRepository::getName).collect(toList());
List<String> clusterProfiles = clusterProfilesService.getPluginProfiles().stream().map(PluginProfile::getId).collect(toList());
configsViewModel.getAutoSuggestions().put("pipeline_group", groups);
configsViewModel.getAutoSuggestions().put("environment", envNames);
configsViewModel.getAutoSuggestions().put("pluggable_scm", scms);
configsViewModel.getAutoSuggestions().put("package_repository", pkgRepos);
configsViewModel.getAutoSuggestions().put("cluster_profile", clusterProfiles);
final String etag = etagFor(configsViewModel);
if (fresh(request, etag)) {
return notModified(response);
}
setEtagHeader(response, etag);
return writerForTopLevelObject(request, response, writer -> SecretConfigsViewModelRepresenter.toJSON(writer, configsViewModel));
}
use of com.thoughtworks.go.config.SecretConfigs in project gocd by gocd.
the class SecretConfigUpdateCommand method update.
@Override
public void update(CruiseConfig preprocessedConfig) {
SecretConfig existingSecretConfig = findExistingProfile(preprocessedConfig);
SecretConfigs secretConfigs = getPluginProfiles(preprocessedConfig);
secretConfigs.set(secretConfigs.indexOf(existingSecretConfig), profile);
}
Aggregations