/** * Stapler form completion. * * @param serverUrl the server URL. * @return the available credentials. */ @Restricted(NoExternalUse.class) // stapler @SuppressWarnings("unused") public ListBoxModel doFillCredentialsIdItems(@QueryParameter String serverUrl) { Jenkins.getActiveInstance().checkPermission(Jenkins.ADMINISTER); StandardListBoxModel result = new StandardListBoxModel(); serverUrl = GiteaServers.normalizeServerUrl(serverUrl); result.includeMatchingAs( ACL.SYSTEM, Jenkins.getActiveInstance(), StandardCredentials.class, URIRequirementBuilder.fromUri(serverUrl).build(), AuthenticationTokens.matcher(GiteaAuth.class) ); return result; }
/** * Sanity check for a Gitea access token. * * @param value the token. * @return the resulst of the sanity check. */ @Restricted(NoExternalUse.class) // stapler @SuppressWarnings("unused") // stapler public FormValidation doCheckToken(@QueryParameter String value) { Secret secret = Secret.fromString(value); if (secret == null) { return FormValidation.error(Messages.PersonalAccessTokenImpl_tokenRequired()); } if (StringUtils.equals(value, secret.getPlainText())) { if (value.length() != 40) { return FormValidation.error(Messages.PersonalAccessTokenImpl_tokenWrongLength()); } } else if (secret.getPlainText().length() != 40) { return FormValidation.warning(Messages.PersonalAccessTokenImpl_tokenWrongLength()); } return FormValidation.ok(); }
/** * This method is called to populate the policy list on the Jenkins config page. * @param context * @param orgName * @param credentialsId * @return */ public ListBoxModel doFillPolicyNameItems(@AncestorInPath ItemGroup context, @QueryParameter final String orgName, @QueryParameter final String toolchainName, @QueryParameter final String credentialsId) { String targetAPI = chooseTargetAPI(environment); try { // if user changes to a different credential, need to get a new token if (!credentialsId.equals(preCredentials) || Util.isNullOrEmpty(bluemixToken)) { bluemixToken = getBluemixToken(context, credentialsId, targetAPI); preCredentials = credentialsId; } } catch (Exception e) { return new ListBoxModel(); } if(debug_mode){ LOGGER.info("#######GATE : calling getPolicyList#######"); } return getPolicyList(bluemixToken, orgName, toolchainName, environment, debug_mode); }
public ListBoxModel doFillPrincipalCredentialIdItems( @AncestorInPath Item item, @QueryParameter String credentialsId) { StandardListBoxModel result = new StandardListBoxModel(); if (item == null) { if (!Jenkins.getActiveInstance().hasPermission(Jenkins.ADMINISTER)) { return result.includeCurrentValue(credentialsId); } } else { if (!item.hasPermission(Item.EXTENDED_READ) && !item.hasPermission(CredentialsProvider.USE_ITEM)) { return result.includeCurrentValue(credentialsId); } } List<AzureCredentials> creds = CredentialsProvider.lookupCredentials(AzureCredentials.class, item, ACL.SYSTEM, Collections.<DomainRequirement>emptyList()); for (AzureCredentials cred : creds) { result.add(cred.getId()); } return result.includeEmptyValue() .includeCurrentValue(credentialsId); }
public FormValidation doCheckQueueUuid(@QueryParameter final String value) { if (this.getSqsQueues().size() == 0) { return FormValidation.error(Messages.errorQueueUnavailable()); } if (StringUtils.isEmpty(value)) { return FormValidation.ok(Messages.infoQueueDefault()); } final SQSQueue queue = this.getSqsQueue(value); if (queue == null) { return FormValidation.error(Messages.errorQueueUuidUnknown()); } return FormValidation.ok(); }
public FormValidation doTestConnection( @QueryParameter("mirrorGateAPIUrl") final String mirrorGateAPIUrl, @QueryParameter("mirrorgateCredentialsId") final String credentialsId) throws Descriptor.FormException { MirrorGateService testMirrorGateService = getMirrorGateService(); if (testMirrorGateService != null) { MirrorGateResponse response = testMirrorGateService.testConnection(); return response.getResponseCode() == HttpStatus.SC_OK ? FormValidation.ok("Success") : FormValidation.error("Failure<" + response.getResponseCode() + ">"); } else { return FormValidation.error("Failure"); } }
public ListBoxModel doFillMirrorgateCredentialsIdItems( @AncestorInPath Item item, @QueryParameter("mirrorgateCredentialsId") String credentialsId) { StandardListBoxModel result = new StandardListBoxModel(); if (item == null) { if (!Jenkins.getInstance().hasPermission(Jenkins.ADMINISTER)) { return result.includeCurrentValue(credentialsId); } } else if (!item.hasPermission(Item.EXTENDED_READ) && !item.hasPermission(CredentialsProvider.USE_ITEM)) { return result.includeCurrentValue(credentialsId); } return result .includeEmptyValue() .includeAs(ACL.SYSTEM, item, StandardUsernamePasswordCredentials.class); }
public FormValidation doCheckMirrorgateCredentialsId( @AncestorInPath Item item, @QueryParameter("mirrorgateCredentialsId") String credentialsId) { if (item == null) { if (!Jenkins.getInstance().hasPermission(Jenkins.ADMINISTER)) { return FormValidation.ok(); } } else if (!item.hasPermission(Item.EXTENDED_READ) && !item.hasPermission(CredentialsProvider.USE_ITEM)) { return FormValidation.ok(); } if (StringUtils.isBlank(credentialsId)) { return FormValidation.ok(); } if (credentialsId.startsWith("${") && credentialsId.endsWith("}")) { return FormValidation.warning( "Cannot validate expression based credentials"); } return FormValidation.ok(); }
@Restricted(NoExternalUse.class) public ListBoxModel doFillCheckoutCredentialsIdItems(@AncestorInPath SCMSourceOwner context, @QueryParameter String connectionName, @QueryParameter String checkoutCredentialsId) { if (context == null && !Jenkins.getInstance().hasPermission(Jenkins.ADMINISTER) || context != null && !context.hasPermission(Item.EXTENDED_READ)) { return new StandardListBoxModel().includeCurrentValue(checkoutCredentialsId); } StandardListBoxModel result = new StandardListBoxModel(); result.add("- anonymous -", CHECKOUT_CREDENTIALS_ANONYMOUS); return result.includeMatchingAs( context instanceof Queue.Task ? Tasks.getDefaultAuthenticationOf((Queue.Task) context) : ACL.SYSTEM, context, StandardUsernameCredentials.class, SettingsUtils.gitLabConnectionRequirements(connectionName), GitClient.CREDENTIALS_MATCHER ); }
/** * Fills in the Host Connection selection box with applicable connections. * * @param context * filter for host connections * @param connectionId * an existing host connection identifier; can be null * @param project * the Jenkins project * * @return host connection selections */ public ListBoxModel doFillConnectionIdItems(@AncestorInPath Jenkins context, @QueryParameter String connectionId, @AncestorInPath Item project) { CpwrGlobalConfiguration globalConfig = CpwrGlobalConfiguration.get(); HostConnection[] hostConnections = globalConfig.getHostConnections(); ListBoxModel model = new ListBoxModel(); model.add(new Option(StringUtils.EMPTY, StringUtils.EMPTY, false)); for (HostConnection connection : hostConnections) { boolean isSelected = false; if (connectionId != null) { isSelected = connectionId.matches(connection.getConnectionId()); } model.add(new Option(connection.getDescription() + " [" + connection.getHostPort() + ']', //$NON-NLS-1$ connection.getConnectionId(), isSelected)); } return model; }
/** * Fills in the Login Credentials selection box with applicable connections. * * @param context * filter for login credentials * @param credentialsId * existing login credentials; can be null * @param project * the Jenkins project * * @return login credentials selection */ public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Jenkins context, @QueryParameter String credentialsId, @AncestorInPath Item project) { List<StandardUsernamePasswordCredentials> creds = CredentialsProvider.lookupCredentials( StandardUsernamePasswordCredentials.class, project, ACL.SYSTEM, Collections.<DomainRequirement> emptyList()); ListBoxModel model = new ListBoxModel(); model.add(new Option(StringUtils.EMPTY, StringUtils.EMPTY, false)); for (StandardUsernamePasswordCredentials c : creds) { boolean isSelected = false; if (credentialsId != null) { isSelected = credentialsId.matches(c.getId()); } String description = Util.fixEmptyAndTrim(c.getDescription()); model.add(new Option(c.getUsername() + (description != null ? " (" + description + ')' : StringUtils.EMPTY), //$NON-NLS-1$ c.getId(), isSelected)); } return model; }
public ListBoxModel doFillProjectItems(@QueryParameter String serverUrl, @QueryParameter String username, @QueryParameter Secret password) throws URISyntaxException { ListBoxModel items = new ListBoxModel(); if (validInputs(serverUrl, username, password)) { try { TfsClient client = getTfsClientFactory().getValidatedClient(serverUrl, username, password); List<TeamProjectReference> references = client.getProjectClient().getProjects(); for (TeamProjectReference ref : references) { items.add(ref.getName(), String.valueOf(ref.getId())); } } catch (VssServiceException vse) { return items; } } return items; }
public ListBoxModel doFillBuildDefinitionItems(@QueryParameter String serverUrl, @QueryParameter String username, @QueryParameter Secret password, @QueryParameter String project) throws URISyntaxException { ListBoxModel items = new ListBoxModel(); if (validInputs(serverUrl, username, password, project)) { try { TfsClient client = getTfsClientFactory().getValidatedClient(serverUrl, username, password); List<DefinitionReference> definitions = client.getBuildClient().getDefinitions(UUID.fromString(project)); for (DefinitionReference definition : definitions) { items.add(definition.getName(), String.valueOf(definition.getId())); } } catch (VssServiceException vse) { return items; } } return items; }
/** * Serves the testCoverage badge image. TO DO * @param req * @param rsp * @param job * @return */ @SuppressWarnings("rawtypes") public HttpResponse doTestIcon(StaplerRequest req, StaplerResponse rsp, @QueryParameter String job) { Job<?, ?> project = getProject(job); Integer testPass = null; Integer testTotal = null; if (project.getLastCompletedBuild() != null) { AbstractTestResultAction testAction = project.getLastCompletedBuild().getAction(AbstractTestResultAction.class); if(testAction != null){ int total = testAction.getTotalCount(); int pass = total - testAction.getFailCount() - testAction.getSkipCount(); testTotal = total; testPass = pass; } } return iconResolver.getTestResultImage(testPass, testTotal); }
public FormValidation doTestConnection( @QueryParameter("url") final String url, @QueryParameter("user") final String user, @QueryParameter("password") final String password, @QueryParameter("room") final String room ) { try { RocketChatClient rcClient = new RocketChatClient(url, user, password); Set<Room> publicRooms = rcClient.getPublicRooms(); StringBuilder message = new StringBuilder("available rooms are: "); boolean comma = false; for (Room r : publicRooms) { if(r.name.equals(room)) return FormValidation.ok("Server version is "+rcClient.getRocketChatVersion()); if(comma) message.append(", "); comma = true; message.append("'"+r.name+"'"); } return FormValidation.error("available rooms are "+message); } catch (Exception e) { return FormValidation.error(e.getMessage()); } }
/** * Function that does form validation for the artifactID field in the UI * @param value The value of the field * @return The form state depending on the value */ public FormValidation doCheckArtifactID(@QueryParameter String value, @QueryParameter String groupID, @QueryParameter String repo) { if (value != "") { if (checkIfArtifactExists(repo, groupID, value)) { return FormValidation.ok(); } else { return FormValidation.error("Could not find artifact: " + groupID + ":" + value + " in repo " + repo); } } else { return FormValidation.error("Artifact ID cannot be empty"); } }
public FormValidation doValidateInput(@QueryParameter("host") final String host, @QueryParameter("account") final String account, @QueryParameter("user") final String user, @QueryParameter("password") final String password, @QueryParameter("appname") final String appname, @QueryParameter("packageLocation") final String packageLocation) { if (host == null || host.equals("")) return FormValidation.error("hostname is null or empty"); if (account == null || account.equals("")) return FormValidation.error("accountname is null or empty"); if (user == null || user.equals("")) return FormValidation.error("username is null or empty"); if (password == null || password.equals("")) return FormValidation.error("password is null or empty"); if (appname == null || appname.equals("")) return FormValidation.error("application name is null or empty"); return FormValidation.ok(); }
/** * Fills in the Login Credentials selection box with applicable Jenkins credentials. * * @param context * filter for credentials * @param credentialsId * existing login credentials; can be null * @param project * the Jenkins project * * @return credential selections */ public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Jenkins context, @QueryParameter String credentialsId, @AncestorInPath Item project) { List<StandardUsernamePasswordCredentials> creds = CredentialsProvider.lookupCredentials( StandardUsernamePasswordCredentials.class, project, ACL.SYSTEM, Collections.<DomainRequirement> emptyList()); StandardListBoxModel model = new StandardListBoxModel(); model.add(new Option(StringUtils.EMPTY, StringUtils.EMPTY, false)); for (StandardUsernamePasswordCredentials c : creds) { boolean isSelected = false; if (credentialsId != null) { isSelected = credentialsId.matches(c.getId()); } String description = Util.fixEmptyAndTrim(c.getDescription()); model.add(new Option(c.getUsername() + (description != null ? " (" + description + ')' : StringUtils.EMPTY), //$NON-NLS-1$ c.getId(), isSelected)); } return model; }
public ListBoxModel doFillRegionItems(@QueryParameter final String credentialsId, @QueryParameter final String region) throws IOException, ServletException { final List<Region> regionList; try { final AmazonEC2 client = connect(credentialsId, null); final DescribeRegionsResult regions=client.describeRegions(); regionList=regions.getRegions(); } catch(final Exception ex) { //Ignore bad exceptions return new ListBoxModel(); } final ListBoxModel model = new ListBoxModel(); for(final Region reg : regionList) { model.add(new ListBoxModel.Option(reg.getRegionName(), reg.getRegionName())); } return model; }
@RequirePOST public HttpResponse doImpersonate(StaplerRequest req, @QueryParameter String name) { Authentication auth = Jenkins.getAuthentication(); GrantedAuthority[] authorities = auth.getAuthorities(); if (authorities == null || StringUtils.isBlank(name)) { return HttpResponses.redirectToContextRoot(); } GrantedAuthority authority = null; for (GrantedAuthority a : authorities) { if (a.getAuthority().equals(name)) { authority = a; break; } } if (authority == null) { return HttpResponses.redirectToContextRoot(); } if (!SecurityRealm.AUTHENTICATED_AUTHORITY.equals(authority)) { ACL.impersonate(new ImpersonationAuthentication(auth, authority, SecurityRealm.AUTHENTICATED_AUTHORITY)); } else { ACL.impersonate(new ImpersonationAuthentication(auth, SecurityRealm.AUTHENTICATED_AUTHORITY)); } return HttpResponses.redirectToContextRoot(); }
/** * This method validates the current entered Aptly site configuration data. * @param request the current {@link javax.servlet.http.HttpServletRequest} */ public FormValidation doLoginCheck( @QueryParameter("aptly.profileName") final String sitename, @QueryParameter("aptly.url") final String url, @QueryParameter("aptly.enableSelfSigned") final String enableselfsigned, @QueryParameter("aptly.timeOut") final String timeout, @QueryParameter("aptly.username") final String username, @QueryParameter("aptly.password") final String password) { LOG.info("Login check for " + sitename); PrintStream logstream = new PrintStream(new LogOutputStream(), true); try { AptlySite site = new AptlySite(url,enableselfsigned,timeout,username,password); AptlyRestClient client = new AptlyRestClient(logstream, site); final String ver = client.getAptlyServerVersion(); LOG.info("got version " + ver); return FormValidation.ok("Success, Aptly version: " + ver); } catch (Exception e) { return FormValidation.error(e.getMessage()); } }
public HttpResponse doQueryJiraFields(@QueryParameter String issueKey) { try { if (!Config.getGlobalConfig().isJiraConfigComplete()) { return FormValidation.error("JIRA settings are not set in global config"); } final Map<String, String> jiraFields = getJiraClientSvc().getJiraFields(issueKey); return new ForwardToView(this, "/org/jenkinsci/plugins/jiraext/view/UpdateField/jiraFields.jelly") .with("jiraFieldMap", jiraFields); } catch (Throwable t) { String message = "Error finding FieldIds for issueKey: " + issueKey; logger.log(Level.WARNING, message, t); return FormValidation.error(t, message); } }
public FormValidation doCheckSecretKey(@QueryParameter("proxyHost") final String proxyHost, @QueryParameter("proxyPort") final String proxyPort, @QueryParameter("accessKey") final String accessKey, @QueryParameter("secretKey") final String secretKey) { try { AWSCredentials initialCredentials = AWSClientFactory.getBasicCredentialsOrDefaultChain(accessKey, secretKey).getCredentials(); new AWSCodeBuildClient(initialCredentials, getClientConfiguration(proxyHost, proxyPort)).listProjects(new ListProjectsRequest()); } catch (Exception e) { String errorMessage = e.getMessage(); if(errorMessage.length() >= ERROR_MESSAGE_MAX_LENGTH) { errorMessage = errorMessage.substring(ERROR_MESSAGE_MAX_LENGTH); } return FormValidation.error("Authorization failed: " + errorMessage); } return FormValidation.ok("AWS access and secret key authorization successful."); }
public FormValidation doCheckTenant(@QueryParameter final boolean ssoEnabled, @QueryParameter final String tenant) { if (ssoEnabled) { String tenantVal = Util.fixEmptyAndTrim(tenant); if (tenantVal == null) { return FormValidation.error("Please enter tenant."); } if (tenantVal.indexOf('$') >= 0) { // set by variable, can't validate return FormValidation.ok(); } } return FormValidation.ok(); }
public FormValidation doCheckCredentialsId(@QueryParameter final String credentialsId, @AncestorInPath final Job<?,?> owner) { String globalCredentialsId = this.getGlobalCredentialsId(); if (credentialsId == null || credentialsId.isEmpty()) { if (globalCredentialsId == null || globalCredentialsId.isEmpty()) { return FormValidation.error("Please enter Bitbucket OAuth credentials"); } else { return this.doCheckGlobalCredentialsId(this.getGlobalCredentialsId()); } } UsernamePasswordCredentials credentials = BitbucketBuildStatusHelper.getCredentials(credentialsId, owner); return this.checkCredentials(credentials); }
public FormValidation doCheckLocalPath(@AncestorInPath final AbstractProject project, @QueryParameter final String localPath) { final String path = Util.fixEmptyAndTrim(localPath); if (StringUtils.isBlank(path)) { return FormValidation.ok(); } try { File f = resolvePath(project, localPath); if (f != null) { return FormValidation.ok(); } } catch (Exception e) { return FormValidation.error(e.getMessage()); } return FormValidation.error("Invalid path."); }
public FormValidation doCheckBaseRevision(@QueryParameter boolean analyzeBranchDiff, @QueryParameter String baseRevision) throws IOException, ServletException { if (analyzeBranchDiff && (baseRevision == null || baseRevision.isEmpty())) { return FormValidation.error("Base revision cannot be empty."); } else { return FormValidation.ok(); } }
public FormValidation doCheckRiskThreshold(@QueryParameter int riskThreshold, @QueryParameter boolean markBuildAsUnstable) { if (markBuildAsUnstable && (riskThreshold < 1 || riskThreshold > 10)) { return FormValidation.error("Risk threshold must be a number between 1 and 10. The value %d is invalid.", riskThreshold); } else { return FormValidation.ok(); } }
public FormValidation doCheckCredentialsId(@QueryParameter String credentialsId) { if (credentialsId == null || credentialsId.isEmpty()) { return FormValidation.error("CodeScene API credentials must be set."); } else { return FormValidation.ok(); } }
public FormValidation doCheckDeltaAnalysisUrl(@QueryParameter String deltaAnalysisUrl) { if (deltaAnalysisUrl == null || deltaAnalysisUrl.isEmpty()) { return FormValidation.error("CodeScene delta analysis URL cannot be blank."); } else { try { new URL(deltaAnalysisUrl); return FormValidation.ok(); } catch (MalformedURLException e) { return FormValidation.error("Invalid URL"); } } }
public FormValidation doCheckRepository(@QueryParameter String repository) { if (repository == null || repository.isEmpty()) { return FormValidation.error("CodeScene repository cannot be blank."); } else { return FormValidation.ok(); } }
public FormValidation doCheckCouplingThresholdPercent(@QueryParameter int couplingThresholdPercent) { if (couplingThresholdPercent < 1 || couplingThresholdPercent > 100) { return FormValidation.error("Temporal coupling threshold is percentage and must be a number between 1 and 100." + "The value %d is invalid.", couplingThresholdPercent); } else { return FormValidation.ok(); } }
/** * Populates the list of credentials in the select box in CodeScene API configuration section * Inspired by git plugin: * https://github.com/jenkinsci/git-plugin/blob/f58648e9005293ab07b2389212603ff9a460b80a/src/main/java/jenkins/plugins/git/GitSCMSource.java#L239 */ public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Jenkins context, @QueryParameter String credentialsId) { if (context == null || !context.hasPermission(Item.CONFIGURE)) { return new StandardListBoxModel().includeCurrentValue(credentialsId); } return new StandardListBoxModel() .includeEmptyValue() .includeMatchingAs( context instanceof Queue.Task ? Tasks.getAuthenticationOf((Queue.Task)context) : ACL.SYSTEM, context, StandardUsernameCredentials.class, Collections.<DomainRequirement>emptyList(), CredentialsMatchers.always()) .includeCurrentValue(credentialsId); }
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath SCMSourceOwner context, @QueryParameter String serverUrl, @QueryParameter String credentialsId) { StandardListBoxModel result = new StandardListBoxModel(); if (context == null) { if (!Jenkins.getActiveInstance().hasPermission(Jenkins.ADMINISTER)) { // must have admin if you want the list without a context result.includeCurrentValue(credentialsId); return result; } } else { if (!context.hasPermission(Item.EXTENDED_READ) && !context.hasPermission(CredentialsProvider.USE_ITEM)) { // must be able to read the configuration or use the item credentials if you want the list result.includeCurrentValue(credentialsId); return result; } } result.includeEmptyValue(); result.includeMatchingAs( context instanceof Queue.Task ? Tasks.getDefaultAuthenticationOf((Queue.Task) context) : ACL.SYSTEM, context, StandardCredentials.class, URIRequirementBuilder.fromUri(serverUrl).build(), AuthenticationTokens.matcher(GiteaAuth.class) ); return result; }
public FormValidation doCheckCredentialsId(@AncestorInPath SCMSourceOwner context, @QueryParameter String serverUrl, @QueryParameter String value) throws IOException, InterruptedException { if (context == null) { if (!Jenkins.getActiveInstance().hasPermission(Jenkins.ADMINISTER)) { return FormValidation.ok(); } } else { if (!context.hasPermission(Item.EXTENDED_READ) && !context.hasPermission(CredentialsProvider.USE_ITEM)) { return FormValidation.ok(); } } GiteaServer server = GiteaServers.get().findServer(serverUrl); if (server == null) { return FormValidation.ok(); } if (StringUtils.isBlank(value)) { return FormValidation.ok(); } if (CredentialsProvider.listCredentials( StandardCredentials.class, context, context instanceof Queue.Task ? Tasks.getDefaultAuthenticationOf((Queue.Task) context) : ACL.SYSTEM, URIRequirementBuilder.fromUri(serverUrl).build(), CredentialsMatchers.allOf( CredentialsMatchers.withId(value), AuthenticationTokens.matcher(GiteaAuth.class) )).isEmpty()) { return FormValidation.error(Messages.GiteaSCMNavigator_selectedCredentialsMissing()); } return FormValidation.ok(); }
@Restricted(NoExternalUse.class) @SuppressWarnings("unused") // stapler form binding public ListBoxModel doFillCredentialsIdItems(@CheckForNull @AncestorInPath Item context, @QueryParameter String serverUrl, @QueryParameter String credentialsId) { StandardListBoxModel result = new StandardListBoxModel(); if (context == null) { if (!Jenkins.getActiveInstance().hasPermission(Jenkins.ADMINISTER)) { // must have admin if you want the list without a context result.includeCurrentValue(credentialsId); return result; } } else { if (!context.hasPermission(Item.EXTENDED_READ) && !context.hasPermission(CredentialsProvider.USE_ITEM)) { // must be able to read the configuration or use the item credentials if you want the list result.includeCurrentValue(credentialsId); return result; } } result.add(Messages.SSHCheckoutTrait_useAgentKey(), ""); result.includeMatchingAs( context instanceof Queue.Task ? Tasks.getDefaultAuthenticationOf((Queue.Task) context) : ACL.SYSTEM, context, StandardUsernameCredentials.class, URIRequirementBuilder.fromUri(serverUrl).build(), CredentialsMatchers.instanceOf(SSHUserPrivateKey.class) ); return result; }