Class MysqlDbAclProvider
java.lang.Object
com.illumon.iris.db.v2.permissions.MysqlDbAclProvider
- All Implemented Interfaces:
com.illumon.iris.auth.AuthModule,DbAclProvider,DbAclWriter,Closeable,AutoCloseable
- Direct Known Subclasses:
MysqlDbAclGuiHelper,UnauthenticatedPermissionFilterProviderMysqlImpl
public class MysqlDbAclProvider extends Object implements DbAclProvider, DbAclWriter, com.illumon.iris.auth.AuthModule, Closeable
Access to the MySQL ACL database.
This class implements DbAclProvider, AuthModule, and DbAclWriter and serves as the basis for the Mysql permission
filter provider, as well as the GUI helper. Anything that talks to the MySql ACL database should use or extend it.
The class is configured with properties:
MysqlDbAclProvider.host - the mysql host to connect to
MysqlDbAclProvider.db - the database containing our ACL tables
MysqlDbAclProvider.user - username for MySQL connection
MysqlDbAclProvider.ssl - SSL connectivity to MySQL (not yet tested in a production environment)
The MySQL password is stored as a base64 encoded string, either in a file (which takes precedence) referenced by:
environment variable
MYSQLDBACLPROVIDER.PASS
or in the file identified by
MysqlDbAclProvider.passwordFile
or within a property itself
MysqlDbAclProvider.pass
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMysqlDbAclProvider.NamedPreparedStatementprotected static interfaceMysqlDbAclProvider.SQLFunction<R>protected static interfaceMysqlDbAclProvider.SQLProcedure -
Field Summary
Fields Modifier and Type Field Description protected ConnectionmysqlConnectionstatic StringPASSWORD_ENV -
Constructor Summary
Constructors Constructor Description MysqlDbAclProvider(com.fishlib.io.logger.Logger log)MysqlDbAclProvider(com.fishlib.io.logger.Logger log, boolean readOnly) -
Method Summary
Modifier and Type Method Description intaddAcl(String group, String ns, String table, String acl)Adds an ACL entry.intaddColumnAcl(String group, String ns, String table, String columns, String acl)Adds a Column ACL entry.voidaddGroupStrategy(String group, String strategy)For AccountFilterGenerator() there are two levels of mappings.intaddInputTableEditor(String group, String ns, String table, boolean canEdit)Adds an entry to the ACL database for editing an input table.voidaddMembership(String user, List<String> groups)Adds a user to a list of groups If the user could not be added to all of the groups, a RuntimeException is thrown.intaddOrUpdateSystemUserAcl(String user, String systemUser)Inserts or Updates an entry to the ACL database for run-as mappingintaddPublicKeyForUser(String user, PublicKey publicKey, String comment)Adds a public key for the user into the ACL database.voidaddStrategyAccount(String strategy, String account)For AccountFilterGenerator() there are two levels of mappings.intaddSystemAcl(String group, String key, String acl)Adds a system ACL entry.voidaddUser(String user, String passwordHash)Adds a user to the Iris system.booleancanAnyoneEditInputTable(String namespace, String tableName)Checks whether an input table can be edited by all usersbooleancanEditInputTable(String effectiveUser, String namespace, String tableName)Checks whether a user has rights to edit an input tablevoidchangePassword(String user, String passwordHash)Changes the password of a user entry in passwdvoidclose()voiddeleteAcls(String group, String ns, String table)Deletes an ACL entry for a group and table.voiddeleteAllAclData()Deletes all data in the ACL store.voiddeleteColumnAcls(String group, String ns, String table, String columns)Deletes a Column ACL entry for a group, table, and column set.voiddeleteGroup(String group)Deletes a group.voiddeleteGroupStrategy(String group, String strategy)For AccountFilterGenerator() there are two levels of mappings.voiddeleteInputTableEditor(String group, String ns, String table)Deletes an entry to the ACL database for editing an input table.booleandeletePublicKeyForUser(String user, PublicKey publicKey)Delete the public key from the ACL database, if it exists.voiddeleteStrategyAccount(String strategy, String account)For AccountFilterGenerator() there are two levels of mappings.voiddeleteSystemAcls(String group, String key)Deletes a system ACL entry for a group and key.voiddeleteSystemUserAcl(String user)Removes an entry from the ACL database for run-as mappingvoiddeleteUser(String user)The user is deleted.String[]getAccountsForGroup(String group)Retrieves all strategy accounts associated with a particular groupString[]getAccountsForStrategy(String strategy)Retrieves all strategy accounts associated with a particular strategyString[]getAccountsForUser(String effectiveUser)Retrieves all strategy accounts associated with a user, directly or through group membershipString[]getAllAccounts()Retrieves all strategy accounts in the systemString[]getAllGroups()Retrieves all groups accounts in the systemString[]getAllStrategies()Retrieves all strategy names by unioning strategies in strategyaccount with those in groupstrategyString[]getAllUsers()Retrieves all user accounts in the systemstatic StringgetEncodedPassword()Retrieve the stored password for connecting to the MySQL ACL database, leaving it encodedList<PermissionFilterProvider.FilterDetails>getFilterDetailsForUser(io.deephaven.enterprise.auth.UserContext userContext)Gets the tableacls permissions filters for an effective userString[]getGroupsForUser(String effectiveUser)Get the groups to which a user is mappedList<com.fishlib.base.Pair<String,String>>getPasswdsForMigration()Returns user and password entries from the passwd table.List<PublicKeyRecord>getPublicKeys()Retrieve all public key data in the ACL database.List<PublicKeyRecord>getPublicKeys(String user)Retrieve the public key data in the ACL database for the user.StringgetRunAsUser(String effectiveUser)Returns the systemuser to which the effectiveUser is mapped, or null if no mapping exists.Map<String,String>getRunAsUserMap()Returns a map of user names to systemuser namesString[]getStrategiesForGroup(String group)Retrieves all strategies associated with a particular groupString[]getStrategiesForUser(String effectiveUser)Retrieves all strategies associated with a particular user, either directly or through group membershipString[]getStrategyForAccount(String account)Retrieves all strategies associated with a particular strategy accountString[]getSystemUsers()Returns an array of systemusers.StringgetUserByPublicKey(PublicKey publicKey)String[]getUsersForGroup(String group)Get the users that are members of a groupbooleangroupStrategyExists(String groupName, String strategy)Checks whether a particular association of a group and a strategy existsbooleanisUserPassValid(String username, String password)voidremoveMembership(String user, List<String> groups)Removes a user from a list of groups.Map<String,List<com.fishlib.base.Pair<String,String>>>retrieveColumnAcls(String effectiveUser, String namespace, String tableName)Returns the most specific Column ACL per group for a specific user, namespace, and table.Collection<String>retrieveRowAcls(String effectiveUser, String namespace, String tableName)Returns the most specific tableacl per group for a specific user, namespace, and table.Collection<String>retrieveSystemAcls(String effectiveUser, String key)Retrieve the set of system ACLs that modify system behavior rather than table access.protected <R> RrunFunctionWithSqlRetry(MysqlDbAclProvider.SQLFunction<R> function)protected voidrunProcedureWithSqlRetry(MysqlDbAclProvider.SQLProcedure procedure)intupdateAcl(String group, String ns, String table, String acl)Changes an already existent ACL entry.intupdateColumnAcl(String group, String ns, String table, String columns, String acl)Changes an already existent Column ACL entry.intupdateInputTableEditor(String group, String ns, String table, boolean canEdit)Updates an entry to the ACL database for editing an input table.intupdateSystemAcl(String group, String key, String acl)Changes an already existent system ACL entry.booleanuserExists(String username)
-
Field Details
-
PASSWORD_ENV
- See Also:
- Constant Field Values
-
mysqlConnection
-
-
Constructor Details
-
MysqlDbAclProvider
public MysqlDbAclProvider(com.fishlib.io.logger.Logger log) -
MysqlDbAclProvider
public MysqlDbAclProvider(com.fishlib.io.logger.Logger log, boolean readOnly)
-
-
Method Details
-
getEncodedPassword
Retrieve the stored password for connecting to the MySQL ACL database, leaving it encoded- Returns:
- the still-encoded representation of the password for connecting to the MySQL ACL database.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceDbAclProvider
-
getFilterDetailsForUser
@NotNull public List<PermissionFilterProvider.FilterDetails> getFilterDetailsForUser(io.deephaven.enterprise.auth.UserContext userContext)Description copied from interface:DbAclProviderGets the tableacls permissions filters for an effective user- Specified by:
getFilterDetailsForUserin interfaceDbAclProvider- Parameters:
userContext- TheUserContextfrom which the effective user name to filter will be obtained- Returns:
- A List of
PermissionFilterProvider.FilterDetailsfor the effective user
-
retrieveRowAcls
@NotNull public Collection<String> retrieveRowAcls(String effectiveUser, String namespace, String tableName)Description copied from interface:DbAclProviderReturns the most specific tableacl per group for a specific user, namespace, and table.- Specified by:
retrieveRowAclsin interfaceDbAclProvider- Parameters:
effectiveUser- the user for which acls should be retrievednamespace- the namespace specifically for which acls should be retrieved - will also match * in tableaclstableName- the table name specifically for which acls should be retrieved - will also match * in tableacls- Returns:
- A Collection of tableacls filters.
-
retrieveColumnAcls
@NotNull public Map<String,List<com.fishlib.base.Pair<String,String>>> retrieveColumnAcls(String effectiveUser, String namespace, String tableName)Description copied from interface:DbAclProviderReturns the most specific Column ACL per group for a specific user, namespace, and table.- Specified by:
retrieveColumnAclsin interfaceDbAclProvider- Parameters:
effectiveUser- the user for which acls should be retrievednamespace- the namespace specifically for which acls should be retrieved - will also match * in columnaclstableName- the table name specifically for which acls should be retrieved - will also match * in columnacls- Returns:
- A Map of group names to Lists of columns and filter pairs.
-
retrieveSystemAcls
Retrieve the set of system ACLs that modify system behavior rather than table access.- Specified by:
retrieveSystemAclsin interfaceDbAclProvider- Parameters:
effectiveUser- The user to get ACLs forkey- The lookup value that applies- Returns:
- A collection of strings representing the applicable ACLs.
-
canEditInputTable
Description copied from interface:DbAclProviderChecks whether a user has rights to edit an input table- Specified by:
canEditInputTablein interfaceDbAclProvider- Parameters:
effectiveUser- The user for whom permissions should be checkednamespace- the namespace specifically for which acls should be retrieved - will also match * in inputtableeditorstableName- the table name specifically for which acls should be retrieved - will also match * in inputtableeditors- Returns:
- True if the user has an effective canedit grant, otherwise false
-
canAnyoneEditInputTable
Description copied from interface:DbAclProviderChecks whether an input table can be edited by all users- Specified by:
canAnyoneEditInputTablein interfaceDbAclProvider- Parameters:
namespace- the namespace specifically for which acls should be retrieved - will also match * in inputtableeditorstableName- the table name specifically for which acls should be retrieved - will also match * in inputtableeditors- Returns:
- True if the input table can be edited by all users, otherwise false
-
getAccountsForUser
Description copied from interface:DbAclProviderRetrieves all strategy accounts associated with a user, directly or through group membership- Specified by:
getAccountsForUserin interfaceDbAclProvider- Parameters:
effectiveUser- The user for whom strategy account access should be checked- Returns:
- An array of String of associated strategy accounts
-
getAllUsers
Description copied from interface:DbAclProviderRetrieves all user accounts in the system- Specified by:
getAllUsersin interfaceDbAclProvider- Returns:
- An array of String of user names
-
getSystemUsers
Description copied from interface:DbAclProviderReturns an array of systemusers.- Specified by:
getSystemUsersin interfaceDbAclProvider- Returns:
- A String array of distinct systemuser names, sorted.
-
getAllGroups
Description copied from interface:DbAclProviderRetrieves all groups accounts in the system- Specified by:
getAllGroupsin interfaceDbAclProvider- Returns:
- An array of String of groups names
-
getAllStrategies
Description copied from interface:DbAclProviderRetrieves all strategy names by unioning strategies in strategyaccount with those in groupstrategy- Specified by:
getAllStrategiesin interfaceDbAclProvider- Returns:
- An array of String of strategy names
- Throws:
SQLException- In the case of SQL implementations of this interface if something goes wrong
-
getAllAccounts
Description copied from interface:DbAclProviderRetrieves all strategy accounts in the system- Specified by:
getAllAccountsin interfaceDbAclProvider- Returns:
- An array of String of strategy account names
- Throws:
SQLException- In the case of SQL implementations of this interface if something goes wrong
-
getAccountsForStrategy
Description copied from interface:DbAclProviderRetrieves all strategy accounts associated with a particular strategy- Specified by:
getAccountsForStrategyin interfaceDbAclProvider- Parameters:
strategy- The strategy name for which to filter accounts- Returns:
- An array of String of strategy account names
-
getStrategyForAccount
Description copied from interface:DbAclProviderRetrieves all strategies associated with a particular strategy account- Specified by:
getStrategyForAccountin interfaceDbAclProvider- Parameters:
account- The strategy account name for which to filter strategies- Returns:
- An array of String of strategy account names
-
getAccountsForGroup
Description copied from interface:DbAclProviderRetrieves all strategy accounts associated with a particular group- Specified by:
getAccountsForGroupin interfaceDbAclProvider- Parameters:
group- The group name for which to filter accounts- Returns:
- An array of String of strategy account names
-
getStrategiesForGroup
Description copied from interface:DbAclProviderRetrieves all strategies associated with a particular group- Specified by:
getStrategiesForGroupin interfaceDbAclProvider- Parameters:
group- The group name for which to filter strategies- Returns:
- An array of String of strategy names
-
groupStrategyExists
Description copied from interface:DbAclProviderChecks whether a particular association of a group and a strategy exists- Specified by:
groupStrategyExistsin interfaceDbAclProvider- Parameters:
groupName- The group name to checkstrategy- The strategy name to check- Returns:
- True if the mapping exists, false if it does not
-
userExists
- Specified by:
userExistsin interfacecom.illumon.iris.auth.AuthModule
-
isUserPassValid
- Specified by:
isUserPassValidin interfacecom.illumon.iris.auth.AuthModule
-
getPasswdsForMigration
Returns user and password entries from the passwd table. Intended for use during ACL exports and/or data migration between MySQL and Etcd ACL stores.- Specified by:
getPasswdsForMigrationin interfaceDbAclProvider- Returns:
- A
ListofPair<String,String>objects which contain a user and password entry.
-
runFunctionWithSqlRetry
protected <R> R runFunctionWithSqlRetry(MysqlDbAclProvider.SQLFunction<R> function) throws SQLException- Throws:
SQLException
-
runProcedureWithSqlRetry
protected void runProcedureWithSqlRetry(MysqlDbAclProvider.SQLProcedure procedure) throws SQLException- Throws:
SQLException
-
getGroupsForUser
Description copied from interface:DbAclProviderGet the groups to which a user is mapped- Specified by:
getGroupsForUserin interfaceDbAclProvider- Parameters:
effectiveUser- The String name of the user to find groups for- Returns:
- A String array of groups mapped to this user
-
getStrategiesForUser
Description copied from interface:DbAclProviderRetrieves all strategies associated with a particular user, either directly or through group membership- Specified by:
getStrategiesForUserin interfaceDbAclProvider- Parameters:
effectiveUser- The user for whom strategy access should be checked- Returns:
- An array of String of strategy names
-
getUsersForGroup
Description copied from interface:DbAclProviderGet the users that are members of a group- Specified by:
getUsersForGroupin interfaceDbAclProvider- Parameters:
group- The String name of the group to find users for- Returns:
- A String array of users with membership in this group
-
getRunAsUserMap
Description copied from interface:DbAclProviderReturns a map of user names to systemuser names- Specified by:
getRunAsUserMapin interfaceDbAclProvider- Returns:
- a map of user names to systemuser names
-
getRunAsUser
Description copied from interface:DbAclProviderReturns the systemuser to which the effectiveUser is mapped, or null if no mapping exists.- Specified by:
getRunAsUserin interfaceDbAclProvider- Parameters:
effectiveUser- The user for which a mapped systemuser name should be retrieved.- Returns:
- the String systemuser to which the effectiveUser is mapped, or null if no mapping exists.
-
addMembership
Description copied from interface:DbAclWriterAdds a user to a list of groups If the user could not be added to all of the groups, a RuntimeException is thrown.- Specified by:
addMembershipin interfaceDbAclWriter- Parameters:
user- the user to add to the groupsgroups- a list of groups to add the user to- Throws:
SQLException- if the underlying SQL operation could not be completed
-
addUser
Description copied from interface:DbAclWriterAdds a user to the Iris system.- Specified by:
addUserin interfaceDbAclWriter- Parameters:
user- the user to add.passwordHash- the APR1 hash of the user's password. Ignored if the system is not configured to manage user authentication.- Throws:
SQLException- if the underlying SQL operation could not be completed
-
changePassword
Description copied from interface:DbAclProviderChanges the password of a user entry in passwd- Specified by:
changePasswordin interfaceDbAclProvider- Specified by:
changePasswordin interfaceDbAclWriter- Parameters:
user- The user for which the password should be updatedpasswordHash- The new password value to store- Throws:
SQLException- In the case of SQL implementations of this interface if something goes wrong
-
removeMembership
Description copied from interface:DbAclWriterRemoves a user from a list of groups. It is possible that the user may be removed from some groups and not others. If the user could not be removed from all of the specified groups (e.g., because they are not a member of those groups), a runtime exception is thrown.- Specified by:
removeMembershipin interfaceDbAclWriter- Parameters:
user- the user to remove from groupsgroups- a list of groups to remove the user from- Throws:
SQLException- if the underlying SQL operation could not be completed
-
deleteGroup
Description copied from interface:DbAclWriterDeletes a group. The group is removed from all user to group mappings, all group to strategy mappings. All table ACLs and input table editors that reference the group are deleted.- Specified by:
deleteGroupin interfaceDbAclWriter- Parameters:
group- the group to delete.- Throws:
SQLException- if the underlying SQL operation could not be completed
-
deleteUser
Description copied from interface:DbAclWriterThe user is deleted. Deletes the user's group, followed by deleting any other user to group associations for the user. If managed authentication is enabled, also deletes the user's password.- Specified by:
deleteUserin interfaceDbAclWriter- Parameters:
user- the user to delete- Throws:
SQLException- if the underlying SQL operation could not be completed
-
addGroupStrategy
Description copied from interface:DbAclWriterFor AccountFilterGenerator() there are two levels of mappings. Group to strategy and strategy to account. This will add a group to the intermediate "strategy".- Specified by:
addGroupStrategyin interfaceDbAclWriter- Parameters:
group- the group to map to a strategystrategy- the strategy that the group is added to- Throws:
SQLException- if the underlying SQL operation could not be completed
-
deleteGroupStrategy
Description copied from interface:DbAclWriterFor AccountFilterGenerator() there are two levels of mappings. Group to strategy and strategy to account. This will remove a group from the intermediate "strategy".- Specified by:
deleteGroupStrategyin interfaceDbAclWriter- Parameters:
group- the group to remove a mapping to a strategystrategy- the strategy that the group is removed from- Throws:
SQLException- if the underlying SQL operation could not be completed
-
addStrategyAccount
Description copied from interface:DbAclWriterFor AccountFilterGenerator() there are two levels of mappings. Group to strategy and strategy to account. This will add an account to the intermediate "strategy".- Specified by:
addStrategyAccountin interfaceDbAclWriter- Parameters:
strategy- the strategy that the account is added toaccount- the account to add to a strategy- Throws:
SQLException- if the underlying SQL operation could not be completed
-
deleteStrategyAccount
Description copied from interface:DbAclWriterFor AccountFilterGenerator() there are two levels of mappings. Group to strategy and strategy to account. This will remove an account from the intermediate "strategy".- Specified by:
deleteStrategyAccountin interfaceDbAclWriter- Parameters:
strategy- the strategy that the account is added toaccount- the account to add to a strategy- Throws:
SQLException- if the underlying SQL operation could not be completed
-
addAcl
Description copied from interface:DbAclWriterAdds an ACL entry. No ACL entry may currently exist for the group and table in question.- Specified by:
addAclin interfaceDbAclWriter- Parameters:
group- the group to add the entry forns- the namespace to add the entry for ("*" for all namespaces)table- the namespace to add the entry for ("*" for tables within a namespace, if ns is "*" table must also be "*")acl- the ACL to add, see http://wiki.illumon.com/Iris/Permissions#Table_Access_Control_Lists_.28ACLs.29- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
SQLException- if the underlying SQL operation could not be completed
-
updateAcl
Description copied from interface:DbAclWriterChanges an already existent ACL entry. An ACL entry must currently exist for the group and table in question.- Specified by:
updateAclin interfaceDbAclWriter- Parameters:
group- the group to update the entry forns- the namespace to update the entry for ("*" for all namespaces)table- the namespace to update the entry for ("*" for tables within a namespace, if ns is "*" table must also be "*")acl- the new ACL, see http://wiki.illumon.com/Iris/Permissions#Table_Access_Control_Lists_.28ACLs.29- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
SQLException- if the underlying SQL operation could not be completed
-
deleteAcls
Description copied from interface:DbAclWriterDeletes an ACL entry for a group and table.- Specified by:
deleteAclsin interfaceDbAclWriter- Parameters:
group- the group to remove the entry forns- the namespace to remove the entry for ("*" for all namespaces)table- the namespace to remove the entry for ("*" for tables within a namespace, if ns is "*" table must also be "*")- Throws:
SQLException- if the underlying SQL operation could not be completed
-
addColumnAcl
public int addColumnAcl(String group, String ns, String table, String columns, String acl) throws SQLExceptionDescription copied from interface:DbAclWriterAdds a Column ACL entry. No ACL entry may currently exist for the group and table in question.- Specified by:
addColumnAclin interfaceDbAclWriter- Parameters:
group- the group to add the entry forns- the namespace to add the entry for ("*" for all namespaces)table- the namespace to add the entry for ("*" for tables within a namespace, if ns is "*" table must also be "*")columns- the columns the ACL applies toacl- the ACL to add, see http://wiki.illumon.com/Iris/Permissions#Table_Access_Control_Lists_.28ACLs.29- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
SQLException- if the underlying SQL operation could not be completed
-
updateColumnAcl
public int updateColumnAcl(String group, String ns, String table, String columns, String acl) throws SQLExceptionDescription copied from interface:DbAclWriterChanges an already existent Column ACL entry. An ACL entry must currently exist for the group, table, and column set in question.- Specified by:
updateColumnAclin interfaceDbAclWriter- Parameters:
group- the group to update the entry forns- the namespace to update the entry for ("*" for all namespaces)table- the namespace to update the entry for ("*" for tables within a namespace, if ns is "*" table must also be "*")columns- the columns the ACL applies toacl- the new ACL, see http://wiki.illumon.com/Iris/Permissions#Table_Access_Control_Lists_.28ACLs.29- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
SQLException- if the underlying SQL operation could not be completed
-
deleteColumnAcls
public void deleteColumnAcls(String group, String ns, String table, String columns) throws SQLExceptionDescription copied from interface:DbAclWriterDeletes a Column ACL entry for a group, table, and column set.- Specified by:
deleteColumnAclsin interfaceDbAclWriter- Parameters:
group- the group to remove the entry forns- the namespace to add the entry for ("*" for all namespaces)table- the namespace to add the entry for ("*" for tables within a namespace, if ns is "*" table must also be "*")columns- the applicable columne set- Throws:
SQLException- if the underlying SQL operation could not be completed
-
addSystemAcl
Description copied from interface:DbAclWriterAdds a system ACL entry. No ACL entry may currently exist for the group and key in question.- Specified by:
addSystemAclin interfaceDbAclWriter- Parameters:
group- the group to add the entry forkey- the key to add the entry for (wildcard not allowed)acl- the ACL to add, see http://wiki.illumon.com/Iris/Permissions#Table_Access_Control_Lists_.28ACLs.29- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
SQLException- if the underlying SQL operation could not be completed
-
updateSystemAcl
Description copied from interface:DbAclWriterChanges an already existent system ACL entry. An ACL entry must currently exist for the group and key in question.- Specified by:
updateSystemAclin interfaceDbAclWriter- Parameters:
group- the group to update the entry forkey- the key to update the entry for (no wildcard)acl- the new ACL, see http://wiki.illumon.com/Iris/Permissions#Table_Access_Control_Lists_.28ACLs.29- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
SQLException- if the underlying SQL operation could not be completed
-
deleteSystemAcls
Description copied from interface:DbAclWriterDeletes a system ACL entry for a group and key.- Specified by:
deleteSystemAclsin interfaceDbAclWriter- Parameters:
group- the group to remove the entry forkey- the namespace to add the entry for (wildcard not allowed)- Throws:
SQLException- if the underlying SQL operation could not be completed
-
addInputTableEditor
public int addInputTableEditor(String group, String ns, String table, boolean canEdit) throws SQLExceptionDescription copied from interface:DbAclWriterAdds an entry to the ACL database for editing an input table.- Specified by:
addInputTableEditorin interfaceDbAclWriter- Parameters:
group- the group to add the entry forns- the namespace to add the entry for ("*" for all namespaces)table- the namespace to add the entry for ("*" for tables within a namespace, if ns is "*" table must also be "*")canEdit- whether the table is editable for this group- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
SQLException- if the underlying SQL operation could not be completed
-
updateInputTableEditor
public int updateInputTableEditor(String group, String ns, String table, boolean canEdit) throws SQLExceptionDescription copied from interface:DbAclWriterUpdates an entry to the ACL database for editing an input table.- Specified by:
updateInputTableEditorin interfaceDbAclWriter- Parameters:
group- the group to update the entry forns- the namespace to update the entry for ("*" for all namespaces)table- the namespace to update the entry for ("*" for tables within a namespace, if ns is "*" table must also be "*")canEdit- whether the table is editable for this group- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
SQLException- if the underlying SQL operation could not be completed
-
deleteInputTableEditor
Description copied from interface:DbAclWriterDeletes an entry to the ACL database for editing an input table.- Specified by:
deleteInputTableEditorin interfaceDbAclWriter- Parameters:
group- the group to delete the entry forns- the namespace to delete the entry for ("*" for all namespaces)table- the namespace to delete the entry for ("*" for tables within a namespace, if ns is "*" table must also be "*")- Throws:
SQLException- if the underlying SQL operation could not be completed
-
addOrUpdateSystemUserAcl
Description copied from interface:DbAclWriterInserts or Updates an entry to the ACL database for run-as mapping- Specified by:
addOrUpdateSystemUserAclin interfaceDbAclWriter- Parameters:
user- the user whose system-user mapping is to be updatedsystemUser- the system-user which will be used for launching workers- Returns:
- the number of rows within the ACL database that were modified
- Throws:
SQLException- if the underlying SQL operation could not be completed
-
deleteSystemUserAcl
Description copied from interface:DbAclWriterRemoves an entry from the ACL database for run-as mapping- Specified by:
deleteSystemUserAclin interfaceDbAclWriter- Parameters:
user- the user whose system-user mapping is to be deleted- Throws:
SQLException- if the underlying SQL operation could not be completed
-
getUserByPublicKey
- Specified by:
getUserByPublicKeyin interfacecom.illumon.iris.auth.AuthModule
-
getPublicKeys
Description copied from interface:DbAclProviderRetrieve the public key data in the ACL database for the user. If the user is null then all keys are retrieved.- Specified by:
getPublicKeysin interfaceDbAclProvider- Parameters:
user- The user identifier.- Returns:
- A list of PublicKeyRecord objects containing the user, the base64-encoded
PublicKeykey value, and a comment.
-
getPublicKeys
Description copied from interface:DbAclProviderRetrieve all public key data in the ACL database. Has the same effect as callingDbAclProvider.getPublicKeys(String)with a nulluserparameter.- Specified by:
getPublicKeysin interfaceDbAclProvider- Returns:
- A list of PublicKeyRecord objects containing the user, the base64-encoded
PublicKeykey value, and a comment.
-
addPublicKeyForUser
public int addPublicKeyForUser(String user, PublicKey publicKey, String comment) throws SQLExceptionDescription copied from interface:DbAclWriterAdds a public key for the user into the ACL database.- Specified by:
addPublicKeyForUserin interfaceDbAclWriter- Parameters:
user- The identifier for the user.publicKey- The user's public key.comment- An optional comment.- Returns:
- The number of rows within the ACL database that were modified.
- Throws:
SQLException
-
deletePublicKeyForUser
Description copied from interface:DbAclWriterDelete the public key from the ACL database, if it exists.- Specified by:
deletePublicKeyForUserin interfaceDbAclWriter- Parameters:
user- The user whose public key is to be deleted.publicKey- The public key to remove.- Returns:
- True if the key was deleted.
- Throws:
SQLException
-
deleteAllAclData
Deletes all data in the ACL store. Use judiciously.- Specified by:
deleteAllAclDatain interfaceDbAclWriter- Throws:
SQLException
-