public boolean isPasswordCorrect(String candidate) { return PASSWORD_ENCODER.isPasswordValid(getPassword(),candidate,null); }
static Details fromPlainPassword(String rawPassword) { return new Details(PASSWORD_ENCODER.encodePassword(rawPassword,null)); }
/** * Convenient short-cut for {@code getACL().hasPermission(a, permission)} * @since 2.92 */ default boolean hasPermission(@Nonnull Authentication a, @Nonnull Permission permission) { if (a == ACL.SYSTEM) { return true; } return getACL().hasPermission(a, permission); }
public SignupInfo(FederatedIdentity i) { this.username = i.getNickname(); this.fullname = i.getFullName(); this.email = i.getEmailAddress(); } }
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException { UserDetailsService uds = delegate; // fix the reference for concurrency support if(uds ==null) throw new UserMayOrMayNotExistException(Messages.UserDetailsServiceProxy_UnableToQuery(username)); return uds.loadUserByUsername(username); }
public static void checkPermission(AccessControlled object, Permission permission) throws IOException, ServletException { if (permission != null) { object.checkPermission(permission); } }
/** * Use this function to get the security components, without necessarily * recreating them. */ public synchronized SecurityComponents getSecurityComponents() { if (this.securityComponents == null) { this.securityComponents = this.createSecurityComponents(); } return this.securityComponents; }
/** * Returns the root {@link ACL}. * * @see AuthorizationStrategy#getRootACL() */ @Override public ACL getACL() { return authorizationStrategy.getRootACL(); }
/** * If this {@link SecurityRealm} supports a look up of {@link GroupDetails} by their names, override this method * to provide the look up. * * <p> * This information, when available, can be used by {@link AuthorizationStrategy}s to improve the UI and * error diagnostics for the user. */ public GroupDetails loadGroupByGroupname(String groupname) throws UsernameNotFoundException, DataAccessException { throw new UserMayOrMayNotExistException(groupname); }
/** * We don't need any filter for this {@link SecurityRealm}. */ @Override public Filter createFilter(FilterConfig filterConfig) { return new ChainedServletFilter(); }
@Override public String toString() { return getIdentifier(); } }
/** * Returns the human-readable name used for rendering in HTML. * * <p> * This may contain arbitrary character, and it can change. * * @return never null. */ public String getDisplayName() { return getName(); }
/** * This is used primarily when the object is listed in the breadcrumb, in the user management screen. */ public String getDisplayName() { return Messages.HudsonPrivateSecurityRealm_DisplayName(); }
protected Boolean hasPermission(Sid p, Permission permission) { Boolean b = child.hasPermission(p, permission); if(b!=null) return b; return parent.hasPermission(p,permission); } };
public SecurityComponents() { // we use AuthenticationManagerProxy here just as an implementation that fails all the time, // not as a proxy. No one is supposed to use this as a proxy. this(new AuthenticationManagerProxy()); }
public SecurityComponents(AuthenticationManager manager) { // we use UserDetailsServiceProxy here just as an implementation that fails all the time, // not as a proxy. No one is supposed to use this as a proxy. this(manager,new UserDetailsServiceProxy()); }
@Override public String getDescription() { return Messages.HudsonPrivateSecurityRealm_ManageUserLinks_Description(); } }
public synchronized boolean hasPermissionContainedBy(PermissionScope scope) { for (Permission p : permissions) if (p.isContainedBy(scope)) return true; return false; }
@Override public String getDisplayName() { return Messages.GlobalSecurityConfiguration_DisplayName(); } }