Package org.apache.zookeeper.server.util
Class AuthUtil
- java.lang.Object
-
- org.apache.zookeeper.server.util.AuthUtil
-
public final class AuthUtil extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<ClientInfo>getClientInfos(List<Id> authInfo)Gets user from id to prepare ClientInfo.static StringgetUser(Id id)Gives user namestatic StringgetUsers(List<Id> authInfo)Returns a formatted, comma-separated list of the user IDs held inauthInfo, ornullif no user IDs were found.
-
-
-
Method Detail
-
getUser
public static String getUser(Id id)
Gives user name- Parameters:
id- contains scheme and authentication info- Returns:
- returns null if authentication scheme does not exist or authentication provider returns null as user
-
getUsers
public static String getUsers(List<Id> authInfo)
Returns a formatted, comma-separated list of the user IDs held inauthInfo, ornullif no user IDs were found. Note that while the result may be easy on the eyes, it is underspecified: it does not mention the correspondingscheme, nor are its components escaped. It is intended for for logging, and is not a security feature.- Parameters:
authInfo- A list ofIdobjects, ornull.- Returns:
- a comma-separated list of user IDs, or
nullif no user IDs were found.
-
getClientInfos
public static List<ClientInfo> getClientInfos(List<Id> authInfo)
Gets user from id to prepare ClientInfo.- Parameters:
authInfo- List of id objects. id contains scheme and authentication info- Returns:
- list of client authentication info
-
-