com.cloudbees.hudson.plugins.folder.properties.FolderCredentialsProvider Java Examples
The following examples show how to use
com.cloudbees.hudson.plugins.folder.properties.FolderCredentialsProvider.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WithAWSStepTest.java From pipeline-aws-plugin with Apache License 2.0 | 5 votes |
private CredentialsStore getFolderStore(AbstractFolder f) { Iterable<CredentialsStore> stores = CredentialsProvider.lookupStores(f); CredentialsStore folderStore = null; for (CredentialsStore s : stores) { if (s.getProvider() instanceof FolderCredentialsProvider && s.getContext() == f) { folderStore = s; break; } } return folderStore; }
Example #2
Source File: GitHubNotificationPipelineStepTest.java From pipeline-githubnotify-step-plugin with MIT License | 5 votes |
private CredentialsStore getFolderStore(Folder f) { Iterable<CredentialsStore> stores = CredentialsProvider.lookupStores(f); CredentialsStore folderStore = null; for (CredentialsStore s : stores) { if (s.getProvider() instanceof FolderCredentialsProvider && s.getContext() == f) { folderStore = s; break; } } return folderStore; }
Example #3
Source File: DeclarativeDockerUtilsTest.java From docker-workflow-plugin with MIT License | 5 votes |
private CredentialsStore getFolderStore(Folder f) { Iterable<CredentialsStore> stores = CredentialsProvider.lookupStores(f); CredentialsStore folderStore = null; for (CredentialsStore s : stores) { if (s.getProvider() instanceof FolderCredentialsProvider && s.getContext() == f) { folderStore = s; break; } } return folderStore; }
Example #4
Source File: FolderIT.java From hashicorp-vault-plugin with MIT License | 4 votes |
@Before public void setupJenkins() throws IOException { GlobalVaultConfiguration globalConfig = GlobalConfiguration.all() .get(GlobalVaultConfiguration.class); VaultConfiguration vaultConfig = new VaultConfiguration(); vaultConfig.setVaultUrl("http://global-vault-url.com"); vaultConfig.setVaultCredentialId(GLOBAL_CREDENTIALS_ID_1); vaultConfig.setFailIfNotFound(false); vaultConfig.setVaultNamespace("mynamespace"); vaultConfig.setTimeout(TIMEOUT); globalConfig.setConfiguration(vaultConfig); globalConfig.save(); FOLDER_1_CREDENTIAL = createTokenCredential(FOLDER_1_CREDENTIALS_ID); FOLDER_2_CREDENTIAL = createTokenCredential(FOLDER_2_CREDENTIALS_ID); FolderCredentialsProvider.FolderCredentialsProperty folder1CredProperty = new FolderCredentialsProvider.FolderCredentialsProperty( new DomainCredentials[]{ new DomainCredentials(Domain.global(), Collections.singletonList(FOLDER_1_CREDENTIAL))}); FolderCredentialsProvider.FolderCredentialsProperty folder2CredProperty = new FolderCredentialsProvider.FolderCredentialsProperty( new DomainCredentials[]{ new DomainCredentials(Domain.global(), Collections.singletonList(FOLDER_2_CREDENTIAL))}); GLOBAL_CREDENTIAL_1 = createTokenCredential(GLOBAL_CREDENTIALS_ID_1); GLOBAL_CREDENTIAL_2 = createTokenCredential(GLOBAL_CREDENTIALS_ID_2); SystemCredentialsProvider.getInstance() .setDomainCredentialsMap(Collections.singletonMap(Domain.global(), Arrays .asList(GLOBAL_CREDENTIAL_1, GLOBAL_CREDENTIAL_2))); this.folder1 = jenkins.createProject(Folder.class, "folder1"); this.folder2 = jenkins.createProject(Folder.class, "folder2"); folder1.addProperty(folder1CredProperty); folder2.addProperty(folder2CredProperty); projectInFolder1 = this.folder1.createProject(FreeStyleProject.class, "projectInFolder1"); projectInFolder2 = this.folder2.createProject(FreeStyleProject.class, "projectInFolder2"); }