本文整理了Java中hudson.model.Hudson.getSecurityRealm()
方法的一些代码示例,展示了Hudson.getSecurityRealm()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hudson.getSecurityRealm()
方法的具体详情如下:
包路径:hudson.model.Hudson
类名称:Hudson
方法名:getSecurityRealm
暂无
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
public String getIconFileName() {
if(Hudson.getInstance().getSecurityRealm() instanceof HudsonPrivateSecurityRealm)
return "user.gif";
else
return null; // not applicable now
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* Sign up for the user account.
*/
public void doSignup(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
req.getView(getSecurityRealm(), "signup.jelly").forward(req, rsp);
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
/**
* Sign up for the user account.
*/
public void doSignup(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
req.getView(getSecurityRealm(), "signup.jelly").forward(req, rsp);
}
代码示例来源:origin: hudson/hudson-2.x
/**
* Sign up for the user account.
*/
public void doSignup(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
req.getView(getSecurityRealm(), "signup.jelly").forward(req, rsp);
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
private boolean needsToCreateFirstUser() {
return !hasSomeUser()
&& Hudson.getInstance().getSecurityRealm() instanceof HudsonPrivateSecurityRealm;
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Sign up for the user account.
*/
public void doSignup(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
req.getView(getSecurityRealm(), "signup.jelly").forward(req, rsp);
}
代码示例来源:origin: org.eclipse.hudson/hudson-inject
@Provides
private SecurityRealm getSecurityRealm() {
return getHudson().getSecurityRealm();
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
private boolean needsToCreateFirstUser() {
return !hasSomeUser()
&& Hudson.getInstance().getSecurityRealm() instanceof HudsonPrivateSecurityRealm;
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
public String getIconFileName() {
if(Hudson.getInstance().getSecurityRealm() instanceof HudsonPrivateSecurityRealm)
return "user.png";
else
return null; // not applicable now
}
代码示例来源:origin: hudson/hudson-2.x
public String getIconFileName() {
if(Hudson.getInstance().getSecurityRealm() instanceof HudsonPrivateSecurityRealm)
return "user.gif";
else
return null; // not applicable now
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
@Override
public boolean isEnabled() {
return Hudson.getInstance().getSecurityRealm() instanceof HudsonPrivateSecurityRealm;
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-inject
@Provides
private SecurityRealm getSecurityRealm() {
return getHudson().getSecurityRealm();
}
代码示例来源:origin: hudson/hudson-2.x
@Override
public boolean isEnabled() {
return Hudson.getInstance().getSecurityRealm() instanceof HudsonPrivateSecurityRealm;
}
代码示例来源:origin: org.hudsonci.plugins/instant-messaging
private Authentication impersonateUser(User u) {
try {
UserDetails d = Hudson.getInstance().getSecurityRealm().loadUserByUsername(u.getId());
return new UsernamePasswordAuthenticationToken(d.getUsername(), "", d.getAuthorities());
} catch (AuthenticationException e) {
// TODO: use the stored GrantedAuthorities
return new UsernamePasswordAuthenticationToken(
u.getId(), "", Arrays.asList(new GrantedAuthority[]{SecurityRealm.AUTHENTICATED_AUTHORITY}));
}
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException {
SecurityRealm sr = Hudson.getInstance().getSecurityRealm();
if (sr.allowsSignup()) {
try {
sr.commenceSignup(identity).generateResponse(req,rsp,node);
return;
} catch (UnsupportedOperationException e) {
// fall through
}
}
// this security realm doesn't support user registration.
// just report an error
req.getView(this,"error").forward(req,rsp);
}
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* Persists the specified authentication.
*/
public void set(Authentication a) throws IOException, InterruptedException {
Hudson h = Hudson.getInstance();
// make sure that this security realm is capable of retrieving the authentication by name,
// as it's not required.
UserDetails u = h.getSecurityRealm().loadUserByUsername(a.getName());
props.setProperty(getPropertyKey(), Secret.fromString(u.getUsername()).getEncryptedValue());
save();
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Persists the specified authentication.
*/
public void set(Authentication a) throws IOException, InterruptedException {
Hudson h = Hudson.getInstance();
// make sure that this security realm is capable of retrieving the authentication by name,
// as it's not required.
UserDetails u = h.getSecurityRealm().loadUserByUsername(a.getName());
props.setProperty(getPropertyKey(), Secret.fromString(u.getUsername()).getEncryptedValue());
save();
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
/**
* Persists the specified authentication.
*/
public void set(Authentication a) throws IOException, InterruptedException {
Hudson h = Hudson.getInstance();
// make sure that this security realm is capable of retrieving the authentication by name,
// as it's not required.
UserDetails u = h.getSecurityRealm().loadUserByUsername(a.getName());
props.setProperty(getPropertyKey(), Secret.fromString(u.getUsername()).getEncryptedValue());
save();
}
代码示例来源:origin: hudson/hudson-2.x
/**
* Persists the specified authentication.
*/
public void set(Authentication a) throws IOException, InterruptedException {
Hudson h = Hudson.getInstance();
// make sure that this security realm is capable of retrieving the authentication by name,
// as it's not required.
UserDetails u = h.getSecurityRealm().loadUserByUsername(a.getName());
props.setProperty(getPropertyKey(), Secret.fromString(u.getUsername()).getEncryptedValue());
save();
}
代码示例来源:origin: com.marvelution.jira.plugins/jenkins-jira-plugin
/**
* Get the {@link com.marvelution.jenkins.plugins.jira.model.Manifest} of the local instance
*
* @param request the {@link javax.servlet.http.HttpServletRequest}, used to determine the application root url
* @return the Manifest
* @throws IOException in case of application store loading issues
*/
public static Manifest getOwnManifest(HttpServletRequest request) throws IOException {
return Manifest.create(URI.create(ApplicationLinkStore.getStore().getApplicationUrl()), Hudson.getVersion().toString(),
ApplicationLinkStore.getStore().getApplicationName(), Hudson.getInstance().getSecurityRealm().allowsSignup());
}
内容来源于网络,如有侵权,请联系作者删除!