本文整理了Java中hudson.model.Messages.BuildAuthorizationToken_InvalidTokenProvided()
方法的一些代码示例,展示了Messages.BuildAuthorizationToken_InvalidTokenProvided()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Messages.BuildAuthorizationToken_InvalidTokenProvided()
方法的具体详情如下:
包路径:hudson.model.Messages
类名称:Messages
方法名:BuildAuthorizationToken_InvalidTokenProvided
[英]Invalid token provided.
[中]提供的令牌无效。
代码示例来源:origin: jenkinsci/jenkins
public static void checkPermission(Job<?,?> project, BuildAuthorizationToken token, StaplerRequest req, StaplerResponse rsp) throws IOException {
if (!Jenkins.getInstance().isUseSecurity())
return; // everyone is authorized
if(token!=null && token.token != null) {
//check the provided token
String providedToken = req.getParameter("token");
if (providedToken != null && providedToken.equals(token.token))
return;
if (providedToken != null)
throw new AccessDeniedException(Messages.BuildAuthorizationToken_InvalidTokenProvided());
}
project.checkPermission(Item.BUILD);
if (req.getMethod().equals("POST")) {
return;
}
if (req.getAttribute(ApiTokenProperty.class.getName()) instanceof User) {
return;
}
rsp.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
rsp.addHeader("Allow", "POST");
throw HttpResponses.forwardToView(project, "requirePOST.jelly");
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
public static void checkPermission(AbstractProject project, BuildAuthorizationToken token, StaplerRequest req, StaplerResponse rsp) throws IOException {
if (!Hudson.getInstance().isUseSecurity())
return; // everyone is authorized
if(token!=null && token.token != null) {
//check the provided token
String providedToken = req.getParameter("token");
if (providedToken != null && providedToken.equals(token.token))
return;
if (providedToken != null)
throw new AccessDeniedException(Messages.BuildAuthorizationToken_InvalidTokenProvided());
}
project.checkPermission(AbstractProject.BUILD);
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
public static void checkPermission(AbstractProject project, BuildAuthorizationToken token, StaplerRequest req, StaplerResponse rsp) throws IOException {
if (!Hudson.getInstance().isUseSecurity())
return; // everyone is authorized
if(token!=null && token.token != null) {
//check the provided token
String providedToken = req.getParameter("token");
if (providedToken != null && providedToken.equals(token.token))
return;
if (providedToken != null)
throw new AccessDeniedException(Messages.BuildAuthorizationToken_InvalidTokenProvided());
}
project.checkPermission(AbstractProject.BUILD);
}
代码示例来源:origin: hudson/hudson-2.x
public static void checkPermission(AbstractProject project, BuildAuthorizationToken token, StaplerRequest req, StaplerResponse rsp) throws IOException {
if (!Hudson.getInstance().isUseSecurity())
return; // everyone is authorized
if(token!=null && token.token != null) {
//check the provided token
String providedToken = req.getParameter("token");
if (providedToken != null && providedToken.equals(token.token))
return;
if (providedToken != null)
throw new AccessDeniedException(Messages.BuildAuthorizationToken_InvalidTokenProvided());
}
project.checkPermission(AbstractProject.BUILD);
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
public static void checkPermission(AbstractProject project, BuildAuthorizationToken token, StaplerRequest req, StaplerResponse rsp) throws IOException {
if (!HudsonSecurityEntitiesHolder.getHudsonSecurityManager().isUseSecurity()) {
return; // everyone is authorized
}
if (token != null && token.token != null) {
//check the provided token
String providedToken = req.getParameter("token");
if (providedToken != null && providedToken.equals(token.token)) {
return;
}
if (providedToken != null) {
throw new AccessDeniedException(Messages.BuildAuthorizationToken_InvalidTokenProvided());
}
}
project.checkPermission(AbstractProject.BUILD);
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
public static void checkPermission(Job<?,?> project, BuildAuthorizationToken token, StaplerRequest req, StaplerResponse rsp) throws IOException {
if (!Jenkins.getInstance().isUseSecurity())
return; // everyone is authorized
if(token!=null && token.token != null) {
//check the provided token
String providedToken = req.getParameter("token");
if (providedToken != null && providedToken.equals(token.token))
return;
if (providedToken != null)
throw new AccessDeniedException(Messages.BuildAuthorizationToken_InvalidTokenProvided());
}
project.checkPermission(Item.BUILD);
if (req.getMethod().equals("POST")) {
return;
}
if (req.getAttribute(ApiTokenProperty.class.getName()) instanceof User) {
return;
}
rsp.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
rsp.addHeader("Allow", "POST");
throw HttpResponses.forwardToView(project, "requirePOST.jelly");
}
内容来源于网络,如有侵权,请联系作者删除!