public class AuthUtils extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
addPrivilege(String path,
int privilegeId,
List<PathPrivilege> privilegeList)
add privilege.
|
static boolean |
checkPrivilege(String path,
int privilegeId,
List<PathPrivilege> privilegeList)
check privilege.
|
static String |
encryptPassword(String password)
encrypt password.
|
static Set<Integer> |
getPrivileges(String path,
List<PathPrivilege> privilegeList)
get privileges.
|
static boolean |
hasPrivilege(String path,
int privilegeId,
List<PathPrivilege> privilegeList)
check if series path has this privilege.
|
static boolean |
pathBelongsTo(String pathA,
String pathB)
check if pathA belongs to pathB.
|
static void |
removePrivilege(String path,
int privilegeId,
List<PathPrivilege> privilegeList)
remove privilege.
|
static void |
validatePassword(String password)
validate password size.
|
static boolean |
validatePassword(String originPassword,
String encryptPassword) |
static void |
validatePath(String path)
validate series path.
|
static void |
validatePrivilege(int privilegeId)
validate privilege.
|
static void |
validatePrivilegeOnPath(String path,
int privilegeId)
validate privilege on path.
|
static void |
validateRolename(String rolename)
validate role name.
|
static void |
validateUsername(String username)
validate username.
|
public static void validatePassword(String password) throws AuthException
password - user passwordAuthException - Authenticate Exceptionpublic static void validateUsername(String username) throws AuthException
username - usernameAuthException - Authenticate Exceptionpublic static void validateRolename(String rolename) throws AuthException
rolename - role nameAuthException - Authenticate Exceptionpublic static void validatePrivilege(int privilegeId)
throws AuthException
privilegeId - privilege IDAuthException - Authenticate Exceptionpublic static void validatePath(String path) throws AuthException
path - series pathAuthException - Authenticate Exceptionpublic static void validatePrivilegeOnPath(String path, int privilegeId) throws AuthException
path - series pathprivilegeId - privilege IDAuthException - Authenticate Exceptionpublic static String encryptPassword(String password)
password - passwordpublic static boolean validatePassword(String originPassword, String encryptPassword)
public static boolean pathBelongsTo(String pathA, String pathB)
pathA - sub-pathpathB - pathpublic static boolean checkPrivilege(String path, int privilegeId, List<PathPrivilege> privilegeList)
path - series pathprivilegeId - privilege IDprivilegeList - privileges in List structurepublic static Set<Integer> getPrivileges(String path, List<PathPrivilege> privilegeList)
path - The seriesPath on which the privileges take effect. If seriesPath-free privileges
are desired, this should be null.public static boolean hasPrivilege(String path, int privilegeId, List<PathPrivilege> privilegeList)
path - series pathprivilegeId - privilege IdprivilegeList - privileges in List structurepublic static void addPrivilege(String path, int privilegeId, List<PathPrivilege> privilegeList)
path - series pathprivilegeId - privilege IdprivilegeList - privileges in List structurepublic static void removePrivilege(String path, int privilegeId, List<PathPrivilege> privilegeList)
path - series pathprivilegeId - privilege IdprivilegeList - privileges in List structureCopyright © 2022 The Apache Software Foundation. All rights reserved.