public ListBoxModel doFillAzureCredentialsIdItems(@AncestorInPath Item owner) { return new StandardListBoxModel() .includeEmptyValue() .withAll(CredentialsProvider.lookupCredentials(AzureCredentials.class, owner, ACL.SYSTEM, Collections.<DomainRequirement>emptyList())) .withAll(CredentialsProvider.lookupCredentials(AzureMsiCredentials.class, owner, ACL.SYSTEM, Collections.<DomainRequirement>emptyList())); }
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath SCMSourceOwner owner, @QueryParameter String source) { if (!hasAccessToCredentialsMetadata(owner)) { return new ListBoxModel(); } return new StandardUsernameListBoxModel() .withEmptySelection() .withAll(availableCredentials(owner, source)); }
@SuppressWarnings("unused") public ListBoxModel doFillCredentialsIdItems( @QueryParameter final String collectionUrl) { final Jenkins jenkins = Jenkins.getInstance(); String hostName = null; try { final URI uri = new URI(collectionUrl); hostName = uri.getHost(); } catch (final URISyntaxException ignored) { } if (hostName == null || !jenkins.hasPermission(Jenkins.ADMINISTER)) { return new ListBoxModel(); } final List<StandardUsernamePasswordCredentials> matches = findCredentials(hostName); return new StandardListBoxModel() .withEmptySelection() .withAll(matches); } }
public AbstractIdCredentialsListBoxModel<?, ?> doFillCredentialIdItems( @AncestorInPath Item owner) { if (owner == null || !owner.hasPermission(Item.CONFIGURE)) { return new AWSCredentialsListBoxModel(); } List<AmazonWebServicesCredentials> creds = CredentialsProvider .lookupCredentials(AmazonWebServicesCredentials.class, owner, ACL.SYSTEM, Collections.<DomainRequirement>emptyList()); return new AWSCredentialsListBoxModel() .withEmptySelection() .withAll(creds); }
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Job<?,?> owner, @QueryParameter String source) { if (!hasAccessToCredentialsMetadata(owner)) { return new ListBoxModel(); } return new StandardUsernameListBoxModel() .withEmptySelection() .withAll(availableCredentials(owner, new EnvVars( ).expand( source ))); }
public ListBoxModel doFillGlobalCredentialsIdItems() { Job owner = null; List<DomainRequirement> apiEndpoint = URIRequirementBuilder.fromUri(BitbucketApi.OAUTH_ENDPOINT).build(); return new StandardUsernameListBoxModel() .withEmptySelection() .withAll(CredentialsProvider.lookupCredentials(StandardUsernamePasswordCredentials.class, owner, null, apiEndpoint)); }
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Job<?,?> owner) { if (owner == null || !owner.hasPermission(Item.CONFIGURE)) { return new ListBoxModel(); } List<DomainRequirement> apiEndpoint = URIRequirementBuilder.fromUri(BitbucketApi.OAUTH_ENDPOINT).build(); return new StandardUsernameListBoxModel() .withEmptySelection() .withAll(CredentialsProvider.lookupCredentials(StandardUsernamePasswordCredentials.class, owner, null, apiEndpoint)); }
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath ItemGroup context, @QueryParameter String url) { AccessControlled _context = (context instanceof AccessControlled ? (AccessControlled) context : Jenkins.getInstance()); if (_context == null || !_context.hasPermission(Jenkins.ADMINISTER)) { return new StandardUsernameListBoxModel(); } return new StandardUsernameListBoxModel() .withEmptySelection() .withAll( CredentialsProvider.lookupCredentials( StandardUsernamePasswordCredentials.class, Jenkins.getInstance(), ACL.SYSTEM, URIRequirementBuilder.fromUri(url).build() ) ); }