Package org.apache.zookeeper.server.util
Class AuthUtil
java.lang.Object
org.apache.zookeeper.server.util.AuthUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic List
<ClientInfo> getClientInfos
(List<Id> authInfo) Gets user from id to prepare ClientInfo.static String
Gives user namestatic String
Returns a formatted, comma-separated list of the user IDs held inauthInfo
, ornull
if no user IDs were found.
-
Method Details
-
getUser
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
Returns a formatted, comma-separated list of the user IDs held inauthInfo
, ornull
if 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 ofId
objects, ornull
.- Returns:
- a comma-separated list of user IDs, or
null
if no user IDs were found.
-
getClientInfos
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
-