X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=security%2Fruntime%2Forg.argeo.security.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fsecurity%2FUserAdminService.java;h=964c9dff2d7332a0630f943daef4ca07a78cf9e7;hb=149023e5969377045847bbecf24b0898b18a67a9;hp=47ea65ecccc1fda91d337c826f0c5b7f4b96ed45;hpb=136dab5338b5f731b285d17c804861bd5e5a9b5c;p=lgpl%2Fargeo-commons.git diff --git a/security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/UserAdminService.java b/security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/UserAdminService.java index 47ea65ecc..964c9dff2 100644 --- a/security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/UserAdminService.java +++ b/security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/UserAdminService.java @@ -2,26 +2,33 @@ package org.argeo.security; import java.util.Set; -public interface UserAdminService { - /* - * USERS +import org.springframework.security.userdetails.UserDetailsManager; + +public interface UserAdminService extends UserDetailsManager { + /** + * Usernames must match this regexp pattern ({@value #USERNAME_PATTERN}). + * Thanks to this tip (modified to remove '-' and add upper-case) */ - public void newUser(ArgeoUser argeoUser); - - public ArgeoUser getUser(String username); - - public Set listUsers(); + public final static String USERNAME_PATTERN = "^[a-zA-Z0-9_]{3,15}$"; - public Boolean userExists(String username); - - public void updateUser(ArgeoUser user); - - public void updateUserPassword(String username, String password); + /** + * Email addresses must match this regexp pattern ({@value #EMAIL_PATTERN}. + * Thanks to this tip. + */ + public final static String EMAIL_PATTERN = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$"; + /* + * USERS + */ /** List users having this role (except the super user). */ - public Set listUsersInRole(String role); + public Set listUsersInRole(String role); - public void deleteUser(String username); + /** Synchronize with the underlying DAO. */ + public void synchronize(); /* * ROLES @@ -31,9 +38,4 @@ public interface UserAdminService { public Set listEditableRoles(); public void deleteRole(String role); - - /* - * SYSTEM - */ - public Runnable wrapWithSystemAuthentication(final Runnable runnable); }