本文整理了Java中com.atlassian.sal.api.net.Request.addTrustedTokenAuthentication
方法的一些代码示例,展示了Request.addTrustedTokenAuthentication
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.addTrustedTokenAuthentication
方法的具体详情如下:
包路径:com.atlassian.sal.api.net.Request
类名称:Request
方法名:addTrustedTokenAuthentication
暂无
代码示例来源:origin: com.atlassian.studio/studio-theme-jira-plugin
@Override
public String doDefault() throws Exception
{
String crucibleUrl = getCrucibleUrl();
if (crucibleUrl == null)
{
return SUCCESS;
}
Request<?> request = requestFactory.createRequest(Request.MethodType.GET,
crucibleUrl + CRUCIBLE_METRICS_REST_ENDPOINT);
request.addTrustedTokenAuthentication(themeProperties.getSystemAdministrator());
try
{
metrics = request.execute();
}
catch (ResponseException re)
{
addErrorMessage(getText("crucible.admin.error.response"));
log.error("Error communicating with Crucible", re);
}
return SUCCESS;
}
代码示例来源:origin: com.atlassian.studio/studio-theme-jira-plugin
public void execute(Map transientVars, Map args, PropertySet propertySet) throws WorkflowException
{
Issue issue = (Issue) transientVars.get("issue");
String projectKey = issue.getProjectObject().getKey();
ApplicationLink crucible = appLinksManager.getLinkedApplication(Application.CRUCIBLE.name(), projectKey);
Request<?> request = requestFactory.createRequest(Request.MethodType.POST,
crucible.getUrl() + CREATE_REVIEW_PATH + "?key=" + crucible.getRemoteKey() + "&issueKey=" + issue.getKey());
request.addTrustedTokenAuthentication();
try
{
request.execute();
}
catch (ResponseException re)
{
log.error("Error creating code review on Crucible", re);
}
}
}
代码示例来源:origin: com.atlassian.studio/studio-theme-jira-plugin
@Override
protected String doExecute() throws Exception
{
String crucibleUrl = getCrucibleUrl();
if (crucibleUrl == null)
{
return SUCCESS;
}
Request<?> request = requestFactory.createRequest(Request.MethodType.PUT,
crucibleUrl + CRUCIBLE_METRICS_REST_ENDPOINT);
request.addTrustedTokenAuthentication(themeProperties.getSystemAdministrator());
request.setRequestBody(metrics);
try
{
metrics = request.execute();
}
catch (ResponseException re)
{
addErrorMessage(getText("crucible.admin.error.response"));
log.error("Error communicating with Crucible", re);
}
return getRedirect("EditMetrics!Default.jspa?message=crucible.admin.info.metrics.updated");
}
代码示例来源:origin: com.atlassian.applinks/applinks-jira-plugin
final Request<?> addRequest = requestFactory.createRequest(MethodType.PUT,
restUrl + "?application=JIRA&name=jira&primary=true&url=" + jiraUrl);
addRequest.addTrustedTokenAuthentication();
if (executeHttpRequest(addRequest))
"?application=" + applicationType.toString() + "&name=" + applicationInstance.getName() +
"&primary=" + primary + "&url=" + applicationInstance.getUrl() + properties.toString());
addRemoteAppRequest.addTrustedTokenAuthentication();
代码示例来源:origin: com.atlassian.studio/studio-jira-fisheye-plugin
request.addRequestParameters("url", baseUrl + JIRA_NOTIFICIATION_URL);
request.addTrustedTokenAuthentication();
try
代码示例来源:origin: com.atlassian.studio/studio-theme-jira-plugin
@Override
protected String doExecute() throws Exception
{
if (!hasAdministratePermissionOnProject(key))
{
return SECURITY_BREACH;
}
ApplicationLink appLink = appLinksManager.getLinkedApplication(Application.CRUCIBLE.name(), key);
Request<?> request = requestFactory.createRequest(Request.MethodType.PUT, getRestResource(appLink));
request.addTrustedTokenAuthentication(themeProperties.getSystemAdministrator());
request.setRequestBody(XStreamUtils.toXML(projectConfig));
try
{
request.execute();
}
catch (ResponseException re)
{
addErrorMessage(re.getMessage());
log.error("Error putting crucible project config", re);
return INPUT;
}
return getRedirect("CrucibleProject!ListProjects.jspa?message=crucible.admin.info.updated");
}
代码示例来源:origin: com.atlassian.studio/applinks-confluence-plugin
req.addTrustedTokenAuthentication();
代码示例来源:origin: com.atlassian.studio/studio-jira-fisheye-plugin
request.addRequestParameters("url", JIRA_NOTIFICIATION_URL, "authenticationType",
"TRUSTED_APPS", "username", ctx.getUser().getName());
request.addTrustedTokenAuthentication();
try
代码示例来源:origin: com.atlassian.studio/studio-jira-fisheye-plugin
final String baseUrl = ComponentLocator.getComponent(ApplicationProperties.class).getBaseUrl();
request.addRequestParameters("url", baseUrl + JIRA_NOTIFICIATION_URL);
request.addTrustedTokenAuthentication();
try
代码示例来源:origin: com.atlassian.applinks/applinks-jira-plugin
public String doSynchronize()
{
final ApplicationLink localLink = appLinksManager.getLinkedApplication(app, getKey());
final String restUrl = localLink.getUrl() + "/plugins/servlet/applinks/projectlinks";
final Request<?> request = requestFactory.createRequest(Request.MethodType.POST,
restUrl + "?key=" + localLink.getRemoteKey() + "&application=JIRA");
final ApplicationLink remoteLink = new DefaultApplicationLink("jira", getKey(), null, null);
request.setRequestBody(XStreamUtils.toXML(remoteLink));
request.addTrustedTokenAuthentication();
try
{
request.execute();
}
catch (final ResponseException re)
{
return getRedirect("ViewProject.jspa?message=editprojectlinks.error.synchronize&pid=" + getPid());
}
return getRedirect("ViewProject.jspa?message=editprojectlinks.result.synchronized&pid=" + getPid());
}
代码示例来源:origin: com.atlassian.applinks/applinks-confluence-plugin
final ApplicationLink remoteLink = new DefaultApplicationLink("jira", getKey(), null, null);
request.setRequestBody(XStreamUtils.toXML(remoteLink));
request.addTrustedTokenAuthentication();
try
代码示例来源:origin: com.atlassian.studio/studio-theme-jira-plugin
request.addTrustedTokenAuthentication(themeProperties.getSystemAdministrator());
try
代码示例来源:origin: com.atlassian.studio/studio-theme-jira-plugin
request.addTrustedTokenAuthentication();
request.addRequestParameters("key", projectKey, "name", projectName, "description", description,
"CRUCIBLE_key", AppLinksManager.CR_PREFIX + projectKey);
代码示例来源:origin: com.atlassian.studio/studio-theme-jira-plugin
final Request<?> request = requestFactory.createRequest(MethodType.DELETE, fullUrl);
request.addTrustedTokenAuthentication();
request.execute(new ResponseHandler()
内容来源于网络,如有侵权,请联系作者删除!