Package com.illumon.iris.auth
Class ReloadableUserAuthConfig
java.lang.Object
com.illumon.iris.auth.ReloadableUserAuthConfig
This class contains User authentication details that can be reloaded out-of-process to capture changes outside the
current classpath.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.jdom2.DocumentGenerate an XML configurationDocumentto be verified byverifyConfigs(Document)static org.jdom2.DocumentGenerate a config XML document to be processed byverifyConfigs(Document)in another process.intgetHashForUser(String user) intintgetSudoTargetsForUser(String user) getUserForKey(PublicKey key) booleanbooleanbooleanvoidInstall a verified config initalized byverifyConfigs(Document).booleanstatic voidvoidverifyConfigs(org.jdom2.Document doc)
-
Constructor Details
-
ReloadableUserAuthConfig
public ReloadableUserAuthConfig(com.fishlib.io.logger.Logger log)
-
-
Method Details
-
getHashForUser
- Parameters:
user- The user to check.- Returns:
- The password has for the specified user.
-
getSudoTargetsForUser
- Parameters:
user- The user to get sudo targets for.- Returns:
- All of the valid users the specified user my sudo as.
-
isSudoer
- Parameters:
user- The user to check.- Returns:
- If the specified user was a sudoer.
-
hasUser
- Parameters:
user- The user to look for.- Returns:
- If the specified user exists.
-
hasLocalUsers
public boolean hasLocalUsers()- Returns:
- If there are any configured local users.
-
hasAuthorizedKeys
public boolean hasAuthorizedKeys()- Returns:
- If there are any configured authorized keys.
-
getUserForKey
- Parameters:
key- A user's public key.- Returns:
- The user associated with a
PublicKey.
-
getLocalUserCount
public int getLocalUserCount()- Returns:
- The number of local users.
-
getAuthKeysCount
public int getAuthKeysCount()- Returns:
- The number of authorized keys.
-
getSudoersCount
public int getSudoersCount()- Returns:
- The number of users with sudo permissions.
-
installConfig
public void installConfig()Install a verified config initalized byverifyConfigs(Document).- ImplNote:
- This method must work in tandem with
verifyConfigs(Document), so the user must externally lock this object and perform both operations in the same critical section to ensure consistency
-
verifyConfigs
Verify a
Documentgenerated viagenerateConfig()orgenerateInNewProcess()A single document may be verified at a time. When a document is verified the configuration is stored locally but not activated until
installConfig()is called.- Parameters:
doc- The XMLDocument.- Throws:
ConfigurationVerificationException- If the document was malformed.- ImplNote:
- This method must work in tandem with
installConfig(), so the user must externally lock this object and perform both operations in the same critical section to ensure consistency
-
generateConfig
Generate an XML configurationDocumentto be verified byverifyConfigs(Document)- Returns:
- A
Documentcontaining the relevant user configuration details. - Throws:
IOException- If a problem was encountered creating the config.
-
generateInNewProcess
Generate a config XML document to be processed byverifyConfigs(Document)in another process.- Returns:
- A
Documentcontaining the relevant user configuration details. - Throws:
IOException- If a problem was encountered creating the config.- ImplNote:
- This is reused from ControllerReloadableConfiguration, because we don't want to make more dependencies if we can avoid it.
-
main
-