/** * Adds supplied credentials to the model. * * @param credentials the credentials. * @return {@code this} for method chaining. * @deprecated prefer using the {@link #include(Item, Class)} or {@link #includeAs(Authentication, Item, Class)} * methods to build the list box contents in order to allow credentials providers to not have to instantiate * a full credential instance where those credential providers store the secrets external from Jenkins. */ @Deprecated @NonNull public AbstractIdCredentialsListBoxModel<T, C> withAll(@NonNull Iterable<? extends C> credentials) { return withMatching(CredentialsMatchers.always(), credentials.iterator()); }
/** * Adds supplied credentials to the model. * * @param credentials the credentials. * @return {@code this} for method chaining. * @deprecated prefer using the {@link #include(Item, Class)} or {@link #includeAs(Authentication, Item, Class)} * methods to build the list box contents in order to allow credentials providers to not have to instantiate * a full credential instance where those credential providers store the secrets external from Jenkins. */ @Deprecated @NonNull public AbstractIdCredentialsListBoxModel<T, C> withAll(@NonNull C... credentials) { return withMatching(CredentialsMatchers.always(), Arrays.asList(credentials)); }
/** * Adds supplied credentials to the model. * * @param credentials the credentials. * @return {@code this} for method chaining. * @deprecated prefer using the {@link #include(Item, Class)} or {@link #includeAs(Authentication, Item, Class)} * methods to build the list box contents in order to allow credentials providers to not have to instantiate * a full credential instance where those credential providers store the secrets external from Jenkins. */ @Deprecated @NonNull public AbstractIdCredentialsListBoxModel<T, C> withAll(@NonNull Iterable<? extends C> credentials) { return withMatching(CredentialsMatchers.always(), credentials.iterator()); }
/** * Adds the matching subset of suppled credentials to the model. * * @param matcher the matcher. * @param credentials the superset of credentials. * @return {@code this} for method chaining. * @deprecated prefer using the {@link #includeMatching(Item, Class, List, CredentialsMatcher)} * or {@link #includeMatchingAs(Authentication, Item, Class, List, CredentialsMatcher)} * methods to build the list box contents in order to allow credentials providers to not have to instantiate * a full credential instance where those credential providers store the secrets external from Jenkins. */ @Deprecated @NonNull public AbstractIdCredentialsListBoxModel<T, C> withMatching(@NonNull CredentialsMatcher matcher, @NonNull Iterable<? extends C> credentials) { return withMatching(matcher, credentials.iterator()); }
/** * Adds supplied credentials to the model. * * @param credentials the credentials. * @return {@code this} for method chaining. * @deprecated prefer using the {@link #include(Item, Class)} or {@link #includeAs(Authentication, Item, Class)} * methods to build the list box contents in order to allow credentials providers to not have to instantiate * a full credential instance where those credential providers store the secrets external from Jenkins. */ @Deprecated @NonNull public AbstractIdCredentialsListBoxModel<T, C> withAll(@NonNull Iterator<? extends C> credentials) { return withMatching(CredentialsMatchers.always(), credentials); }
/** * Adds supplied credentials to the model. * * @param credentials the credentials. * @return {@code this} for method chaining. * @deprecated prefer using the {@link #include(Item, Class)} or {@link #includeAs(Authentication, Item, Class)} * methods to build the list box contents in order to allow credentials providers to not have to instantiate * a full credential instance where those credential providers store the secrets external from Jenkins. */ @Deprecated @NonNull public AbstractIdCredentialsListBoxModel<T, C> withAll(@NonNull Iterator<? extends C> credentials) { return withMatching(CredentialsMatchers.always(), credentials); }
public ListBoxModel doFillDockerRegistryCredentialsItems(@AncestorInPath Item item, @QueryParameter String uri) { return new StandardListBoxModel() .withEmptySelection() .withMatching(AuthenticationTokens.matcher(DockerRegistryToken.class), CredentialsProvider.lookupCredentials( StandardCredentials.class, item, null, Collections.<DomainRequirement>emptyList() ) ); }
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath ItemGroup context) { List<DockerRegistryAuthCredentials> credentials = CredentialsProvider.lookupCredentials(DockerRegistryAuthCredentials.class, context, ACL.SYSTEM, Collections.emptyList()); return new CredentialsListBoxModel() .includeEmptyValue() .withMatching(CredentialsMatchers.always(), credentials); }
public ListBoxModel doFillCredentialsIdItems() { return new StandardListBoxModel() .withEmptySelection() .withMatching( CredentialsMatchers.always(), CredentialsProvider.lookupCredentials(AmazonWebServicesCredentials.class, Jenkins.getInstance(), ACL.SYSTEM, Collections.emptyList())); } }
public static ListBoxModel doFillCredentialsIdItems(ItemGroup context) { return new StandardListBoxModel() .withEmptySelection() .withMatching( CredentialsMatchers.always(), CredentialsProvider.lookupCredentials(AmazonWebServicesCredentials.class, context, ACL.SYSTEM, Collections.EMPTY_LIST)); } }
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath ItemGroup context) { List<DockerRegistryAuthCredentials> credentials = CredentialsProvider.lookupCredentials(DockerRegistryAuthCredentials.class, context, ACL.SYSTEM, Collections.emptyList()); return new StandardListBoxModel().withEmptySelection() .withMatching(CredentialsMatchers.instanceOf(DockerRegistryAuthCredentials.class), credentials); } }
public ListBoxModel doFillCredentialsIdItems() { return new StandardListBoxModel() .withEmptySelection() .withMatching( instanceOf(UsernamePasswordCredentials.class), CredentialsProvider.lookupCredentials( StandardUsernamePasswordCredentials.class, (Item) null, ACL.SYSTEM, (DomainRequirement) null ) ); } }
public ListBoxModel doFillCredentialIdItems(@AncestorInPath Jenkins context) { return new StandardListBoxModel() .withEmptySelection() .withMatching( CredentialsMatchers.anyOf( CredentialsMatchers.instanceOf(StandardUsernamePasswordCredentials.class) ), CredentialsProvider.lookupCredentials(StandardUsernamePasswordCredentials.class, context, ACL.SYSTEM, new ArrayList<DomainRequirement>()) ); }
@Restricted(DoNotUse.class) // Stapler only. @SuppressWarnings("unused") // Used by stapler. @RequirePOST public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Item item, @QueryParameter String master) { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); List<DomainRequirement> domainRequirements = (master == null) ? Collections.<DomainRequirement>emptyList() : URIRequirementBuilder.fromUri(master.trim()).build(); return new StandardListBoxModel().withEmptySelection().withMatching( CredentialsMatchers.instanceOf(UsernamePasswordCredentials.class), CredentialsProvider.lookupCredentials(StandardUsernamePasswordCredentials.class, item, null, domainRequirements) ); }
public ListBoxModel doFillCredentialIdItems(final @AncestorInPath ItemGroup<?> context) { final List<StandardUsernameCredentials> credentials = CredentialsProvider.lookupCredentials( StandardUsernameCredentials.class, context, ACL.SYSTEM, CredentialsSSHSite.NO_REQUIREMENTS); return new SSHUserListBoxModel().withEmptySelection().withMatching( SSHAuthenticator.matcher(JSchConnector.class), credentials); }
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Item item) { return new StandardListBoxModel().withEmptySelection().withMatching( CredentialsMatchers.anyOf( CredentialsMatchers.instanceOf(StringCredentials.class), CredentialsMatchers.instanceOf(UsernamePasswordCredentials.class) ), CredentialsProvider.lookupCredentials(StandardCredentials.class, item, null, Collections.<DomainRequirement>emptyList()) ); }
public ListBoxModel doFillJdbcCredentialsIdItems() { // use deprecated "withMatching" because, even after 20 mins of research, // I didn't understand how to use the new "recommended" API return new StandardListBoxModel() .includeEmptyValue() .withMatching( CredentialsMatchers.always(), CredentialsProvider.lookupCredentials(UsernamePasswordCredentials.class, Jenkins.getInstance(), ACL.SYSTEM, Collections.EMPTY_LIST)); } public FormValidation doValidateJdbcConnection(
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Item project, @QueryParameter String serverAddress) { if (project == null || !project.hasPermission(Item.CONFIGURE)) { return new StandardListBoxModel(); } return new StandardListBoxModel() .withEmptySelection() .withMatching( DockerCommand.CREDENTIALS_MATCHER, CredentialsProvider.lookupCredentials(StandardCredentials.class, project, ACL.SYSTEM, URIRequirementBuilder.fromUri(serverAddress).build())); }
@RequirePOST public ListBoxModel doFillCredentialsIdItems(@AncestorInPath ItemGroup context) { AccessControlled ac = (context instanceof AccessControlled ? (AccessControlled) context : Jenkins.getInstance()); if (!ac.hasPermission(Jenkins.ADMINISTER)) { return new ListBoxModel(); } List<StandardCredentials> credentials = CredentialsProvider.lookupCredentials(StandardCredentials.class, context, ACL.SYSTEM, Collections.emptyList()); return new CredentialsListBoxModel() .includeEmptyValue() .withMatching(CredentialsMatchers.always(), credentials); }
public static ListBoxModel doFillCredentialsIdItems(String endpointUrl) { return new StandardListBoxModel() .withEmptySelection() .withMatching( CredentialsMatchers.anyOf(CredentialsMatchers.instanceOf(TokenCredentialsImpl.class), CredentialsMatchers.instanceOf(UsernamePasswordCredentials.class)), CredentialsProvider.lookupCredentials(StandardCredentials.class, Jenkins.getInstance(), ACL.SYSTEM, URIRequirementBuilder.fromUri(endpointUrl).build())); }