/** * Adds a collection of credentials (they will be filtered with {@link SSHAuthenticator#matcher()} implicitly). * * @param col the collection of credentials. * @return {@code this} for method chaining. * @deprecated use {@link #withMatching(CredentialsMatcher, Iterable)} or {@link #withAll(Iterable)} */ @Deprecated public SSHUserListBoxModel addCollection(Collection<? extends StandardUsernameCredentials> col) { withMatching(SSHAuthenticator.matcher(), col); return this; }
/** * @deprecated use {@link #with(com.cloudbees.plugins.credentials.common.IdCredentials)} */ @Deprecated public SSHUserListBoxModel add(StandardUsernameCredentials u) { with(u); return this; }
/** * Adds all the system-scoped credentials (they will be filtered with {@link SSHAuthenticator#matcher()} * implicitly). * <p> * These credentials are meant to be used for system configuration and other things scoped to the {@link Jenkins} * object, * such as slaves. * </p> * * @return {@code this} for method chaining. */ public SSHUserListBoxModel withSystemScopeCredentials() { return withSystemScopeCredentials(Collections.<DomainRequirement>emptyList()); }
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath ItemGroup context) { AccessControlled ac = (context instanceof AccessControlled ? (AccessControlled) context : Jenkins.getInstance()); if (!ac.hasPermission(Jenkins.ADMINISTER)) { return new ListBoxModel(); } return new SSHUserListBoxModel().withMatching(SSHAuthenticator.matcher(Connection.class), CredentialsProvider.lookupCredentials(StandardUsernameCredentials.class, context, ACL.SYSTEM, SSHLauncher.SSH_SCHEME)); } }
/** * Populate the list of credentials available to the job. * * @return the list box model. */ @SuppressWarnings("unused") // used by stapler public ListBoxModel doFillIdItems() { Item item = Stapler.getCurrentRequest().findAncestorObject(Item.class); return new SSHUserListBoxModel().withAll( CredentialsProvider.lookupCredentials(SSHUserPrivateKey.class, item, ACL.SYSTEM, Collections.<DomainRequirement>emptyList()) ); }
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); }
/** * Adds all the system-scoped credentials. * <p> * These credentials are meant to be used for system configuration and other things scoped to the {@link Jenkins} * object, * such as slaves. * </p> * * @param matcher a matcher to filter the credentials * @param domainRequirements the domain requirements * @return {@code this} for method chaining. */ public SSHUserListBoxModel withSystemScopeCredentials(CredentialsMatcher matcher, List<DomainRequirement> domainRequirements) { includeMatchingAs(ACL.SYSTEM, Jenkins.getActiveInstance(), StandardUsernameCredentials.class, domainRequirements, matcher); return this; }
public static ListBoxModel doFillCredentialsIdItems(@AncestorInPath ItemGroup context) { AccessControlled ac = (context instanceof AccessControlled ? (AccessControlled) context : Jenkins.getInstance()); if (!ac.hasPermission(Jenkins.ADMINISTER)) { return new ListBoxModel(); } return new SSHUserListBoxModel().withMatching( SSHAuthenticator.matcher(Connection.class), CredentialsProvider.lookupCredentials( StandardUsernameCredentials.class, context, ACL.SYSTEM, SSHLauncher.SSH_SCHEME) ); }
public static ListBoxModel doFillCredentialsIdItems(@AncestorInPath ItemGroup context) { AccessControlled ac = (context instanceof AccessControlled ? (AccessControlled) context : Jenkins.getInstance()); if (!ac.hasPermission(Jenkins.ADMINISTER)) { return new ListBoxModel(); } return new SSHUserListBoxModel().withMatching( SSHAuthenticator.matcher(Connection.class), CredentialsProvider.lookupCredentials( StandardUsernameCredentials.class, context, ACL.SYSTEM, SSHLauncher.SSH_SCHEME) ); }
/** * Adds all the system-scoped credentials (they will be filtered with {@link SSHAuthenticator#matcher()} * implicitly). * <p> * These credentials are meant to be used for system configuration and other things scoped to the {@link Jenkins} * object, * such as slaves. * </p> * * @return {@code this} for method chaining. * @deprecated use {@link #withSystemScopeCredentials()} */ @Deprecated public SSHUserListBoxModel addSystemScopeCredentials() { return withSystemScopeCredentials(); }
/** * Adds all the system-scoped credentials. * <p> * These credentials are meant to be used for system configuration and other things scoped to the {@link Jenkins} * object, * such as slaves. * </p> * * @param matcher a matcher to filter the credentials * @param domainRequirements the domain requirements * @return {@code this} for method chaining. */ public SSHUserListBoxModel withSystemScopeCredentials(CredentialsMatcher matcher, DomainRequirement... domainRequirements) { return withSystemScopeCredentials(matcher, Arrays.asList(domainRequirements)); }
/** * Adds all the system-scoped credentials (they will be filtered with {@link SSHAuthenticator#matcher()} * implicitly). * <p> * These credentials are meant to be used for system configuration and other things scoped to the {@link Jenkins} * object, * such as slaves. * </p> * * @param domainRequirements the domain requirements * @return {@code this} for method chaining. */ public SSHUserListBoxModel withSystemScopeCredentials(DomainRequirement... domainRequirements) { return withSystemScopeCredentials(SSHAuthenticator.matcher(), domainRequirements); }
/** * Adds all the system-scoped credentials (they will be filtered with {@link SSHAuthenticator#matcher()} * implicitly). * <p> * These credentials are meant to be used for system configuration and other things scoped to the {@link Jenkins} * object, * such as slaves. * </p> * * @param domainRequirements the domain requirements * @return {@code this} for method chaining. */ public SSHUserListBoxModel withSystemScopeCredentials(List<DomainRequirement> domainRequirements) { return withSystemScopeCredentials(SSHAuthenticator.matcher(), domainRequirements); }