/** * 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); }
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)); } }
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) ); }