Class MysqlDbAclGuiHelper
java.lang.Object
com.illumon.iris.db.v2.permissions.MysqlDbAclProvider
com.illumon.iris.db.v2.permissions.MysqlDbAclGuiHelper
- All Implemented Interfaces:
com.illumon.iris.auth.AuthModule
,DbAclGuiHelper
,DbAclProvider
,DbAclWriter
,Closeable
,AutoCloseable
Mysql implementation class that implements
DbAclGuiHelper
method which help in retrieving Acls stored in MySql store-
Nested Class Summary
Nested classes/interfaces inherited from class com.illumon.iris.db.v2.permissions.MysqlDbAclProvider
MysqlDbAclProvider.NamedPreparedStatement, MysqlDbAclProvider.SQLFunction<R>, MysqlDbAclProvider.SQLProcedure
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.illumon.iris.db.v2.permissions.AclValidator
Fields inherited from class com.illumon.iris.db.v2.permissions.MysqlDbAclProvider
mysqlConnection, PASSWORD_ENV
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canAnyoneEditInputTable
(String namespace, String tableName) Checks whether an input table can be edited by all usersboolean
canEditInputTable
(String effectiveUser, String namespace, String tableName) Checks whether a user has rights to edit an input tableString[]
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 membershipRetrieves aTable
of all column ACLs, sorted by Groupname, Namespace, Tablename, Columns, and FiltergetExternalAuthOnlyUsers
(String[] invalidHashes) Retrieves aTable
with one column, listing users whose passwords indicate external authentication.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 mappedRetrieves aTable
of all groups and associated strategies, sorted by Groupname and StrategygetPublicKeys
(String user) Retrieve the public key data in the ACL database for the user.getPublicKeyTable
(String user) Retrieves aTable
of users, base64-encoded public keys, and the comment associated with the key when added.getRunAsUser
(String effectiveUser) Returns the systemuser to which the effectiveUser is mapped, or null if no mapping exists.String[]
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 membershipRetrieves aTable
of all strategies and associated accounts, sorted by Strategy and AccountString[]
getStrategyForAccount
(String account) Retrieves all strategies associated with a particular strategy accountRetrieves aTable
of all users and matching systemuser mappings, sorted by usergetSystemUserAclTable
(String userGroup) Retrieves aTable
of users and matching systemuser mappings for members of the specified group, sorted by userRetrieves aTable
of all table ACLs, sorted by Groupname, Namespace, Tablename, and FilterRetrieves aTable
of all input table editor permissions, sorted by Groupname, Namespace, and TablenameRetrieves aTable
of all users and their groups, sorted by User and GroupnameString[]
getUsersForGroup
(String group) Get the users that are members of a groupboolean
groupStrategyExists
(String groupName, String strategy) Checks whether a particular association of a group and a strategy existsboolean
isUserPassValid
(String username, String password) retrieveColumnAcls
(String effectiveUser, String namespace, String tableName) Returns the most specific Column ACL per group for a specific user, namespace, and table.retrieveOneAcl
(String group, String namespace, String tableName) Retrieves a single table ACL filter.retrieveOneColumnAcl
(String group, String namespace, String tableName, String columns) Retrieves a single column ACL filter Wildcards are not considered, so only highest priority (specific namespace and tableName) ACLs are returned, and, if there is no specifically assigned ACL, null is returned.retrieveOneEditable
(String group, String namespace, String tableName) Retrieves a single input table editor permission Wildcards are not considered, so only highest priority (specific namespace and tableName) ACLs are returned, and, if there is no specifically assigned ACL, null is returned.retrieveRowAcls
(String effectiveUser, String namespace, String tableName) Returns the most specific tableacl per group for a specific user, namespace, and table.boolean
userExists
(String username) Methods inherited from class com.illumon.iris.db.v2.permissions.MysqlDbAclProvider
addAcl, addColumnAcl, addGroupStrategy, addInputTableEditor, addMembership, addOrUpdateSystemUserAcl, addPublicKeyForUser, addStrategyAccount, addUser, canAnyoneEditInputTableImpl, canEditInputTableImpl, changePassword, close, deleteAcls, deleteAllAclData, deleteColumnAcls, deleteGroup, deleteGroupStrategy, deleteInputTableEditor, deletePublicKeyForUser, deleteStrategyAccount, deleteSystemUserAcl, deleteUser, getAccountsForGroupImpl, getAccountsForStrategyImpl, getAccountsForUserImpl, getAllAccounts, getAllGroups, getAllStrategies, getAllUsers, getEncodedPassword, getFilterDetailsForUserImpl, getGroupsForUserImpl, getPasswdsForMigration, getPublicKeys, getPublicKeysImpl, getRunAsUserImpl, getRunAsUserMap, getStrategiesForGroupImpl, getStrategiesForUserImpl, getStrategyForAccountImpl, getSystemUsers, getUserByPublicKey, getUsersForGroupImpl, groupStrategyExistsImpl, isUserPassValidImpl, removeMembership, retrieveColumnAclsImpl, retrieveRowAclsImpl, runCheckedFunctionWithSqlRetry, runFunctionWithSqlRetry, runFunctionWithSqlRetryInternal, runProcedureWithRetry, runProcedureWithRetry, updateAcl, updateColumnAcl, updateInputTableEditor, userExistsImpl
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.illumon.iris.auth.AuthModule
getNameFromExternal, isUserPassValid, userExists
Methods inherited from interface com.illumon.iris.db.v2.permissions.DbAclProvider
canAnyoneEditInputTable, canEditInputTable, changePassword, close, getAccountsForGroup, getAccountsForStrategy, getAccountsForUser, getAllAccounts, getAllGroups, getAllStrategies, getAllUsers, getFilterDetailsForUser, getGroupsForUser, getPasswdsForMigration, getPublicKeys, getPublicKeys, getRunAsUser, getRunAsUserMap, getStrategiesForGroup, getStrategiesForUser, getStrategyForAccount, getSystemUsers, getUsersForGroup, groupStrategyExists, retrieveColumnAcls, retrieveRowAcls
-
Field Details
-
aclValidator
protected final com.illumon.iris.db.v2.permissions.AclValidator aclValidator
-
-
Method Details
-
getUsersAndGroupsTable
Description copied from interface:DbAclGuiHelper
Retrieves aTable
of all users and their groups, sorted by User and Groupname- Specified by:
getUsersAndGroupsTable
in interfaceDbAclGuiHelper
- Returns:
- A
Table
all users and their groups
-
getExternalAuthOnlyUsers
Description copied from interface:DbAclGuiHelper
Retrieves aTable
with one column, listing users whose passwords indicate external authentication.- Specified by:
getExternalAuthOnlyUsers
in interfaceDbAclGuiHelper
- Parameters:
invalidHashes
- A List of password hashes that are valid only for external authentication.- Returns:
- A
Table
of users that are configured for external password authentication
-
getGroupStrategyTable
Description copied from interface:DbAclGuiHelper
Retrieves aTable
of all groups and associated strategies, sorted by Groupname and Strategy- Specified by:
getGroupStrategyTable
in interfaceDbAclGuiHelper
- Returns:
- A
Table
of all groups and associated strategies
-
getStrategyAccountTable
Description copied from interface:DbAclGuiHelper
Retrieves aTable
of all strategies and associated accounts, sorted by Strategy and Account- Specified by:
getStrategyAccountTable
in interfaceDbAclGuiHelper
- Returns:
- A
Table
of all strategies and associated accounts
-
getTableAclTable
Description copied from interface:DbAclGuiHelper
Retrieves aTable
of all table ACLs, sorted by Groupname, Namespace, Tablename, and Filter- Specified by:
getTableAclTable
in interfaceDbAclGuiHelper
- Returns:
- A
Table
of all table ACLs
-
getColumnAclTable
Description copied from interface:DbAclGuiHelper
Retrieves aTable
of all column ACLs, sorted by Groupname, Namespace, Tablename, Columns, and Filter- Specified by:
getColumnAclTable
in interfaceDbAclGuiHelper
- Returns:
- A
Table
of all column ACLs
-
getSystemUserAclTable
Description copied from interface:DbAclGuiHelper
Retrieves aTable
of all users and matching systemuser mappings, sorted by user- Specified by:
getSystemUserAclTable
in interfaceDbAclGuiHelper
- Returns:
- A
Table
all users and matching systemuser mappings
-
getSystemUserAclTable
Description copied from interface:DbAclGuiHelper
Retrieves aTable
of users and matching systemuser mappings for members of the specified group, sorted by user- Specified by:
getSystemUserAclTable
in interfaceDbAclGuiHelper
- Parameters:
userGroup
- The group name for which to filter users and systemuser mappings by membership- Returns:
- A
Table
users and matching systemuser mappings for members of the specified group
-
getTableEditorTable
Description copied from interface:DbAclGuiHelper
Retrieves aTable
of all input table editor permissions, sorted by Groupname, Namespace, and Tablename- Specified by:
getTableEditorTable
in interfaceDbAclGuiHelper
- Returns:
- A
Table
all input table editor permissions
-
getPublicKeyTable
Description copied from interface:DbAclGuiHelper
Retrieves aTable
of users, base64-encoded public keys, and the comment associated with the key when added.- Specified by:
getPublicKeyTable
in interfaceDbAclGuiHelper
- Parameters:
user
- The user for which to filter public keys. If null, all will be retrieved.- Returns:
- A
Table
with 'user', 'keyval', 'comment' columns.
-
retrieveOneAcl
public String retrieveOneAcl(String group, String namespace, String tableName) throws AclStoreException Description copied from interface:DbAclGuiHelper
Retrieves a single table ACL filter. Wildcards are not considered, so only highest priority (specific namespace and tableName) ACLs are returned, and, if there is no specifically assigned ACL, null is returned.- Specified by:
retrieveOneAcl
in interfaceDbAclGuiHelper
- Parameters:
group
- The specific groupname to matchnamespace
- The specific namespace to matchtableName
- The specific tablename to match- Returns:
- A String table ACL filter or null if no match
- Throws:
AclStoreException
- if an error is reported by the underlying ACL store
-
retrieveOneColumnAcl
public String retrieveOneColumnAcl(String group, String namespace, String tableName, String columns) throws AclStoreException Description copied from interface:DbAclGuiHelper
Retrieves a single column ACL filter Wildcards are not considered, so only highest priority (specific namespace and tableName) ACLs are returned, and, if there is no specifically assigned ACL, null is returned.- Specified by:
retrieveOneColumnAcl
in interfaceDbAclGuiHelper
- Parameters:
group
- The specific groupname to matchnamespace
- The specific namespace to matchtableName
- The specific tablename to matchcolumns
- The specific columns string to match- Returns:
- A String column ACL filter or null if no match
- Throws:
AclStoreException
- if an error is reported by the underlying ACL store
-
retrieveOneEditable
public Boolean retrieveOneEditable(String group, String namespace, String tableName) throws AclStoreException Description copied from interface:DbAclGuiHelper
Retrieves a single input table editor permission Wildcards are not considered, so only highest priority (specific namespace and tableName) ACLs are returned, and, if there is no specifically assigned ACL, null is returned.- Specified by:
retrieveOneEditable
in interfaceDbAclGuiHelper
- Parameters:
group
- The specific groupname to matchnamespace
- The specific namespace to matchtableName
- The specific tablename to match- Returns:
- A Boolean input table editor permission, which is null if there is no match
- Throws:
AclStoreException
- if an error is reported by the underlying ACL store
-
userExists
- Specified by:
userExists
in interfacecom.illumon.iris.auth.AuthModule
-
isUserPassValid
- Specified by:
isUserPassValid
in interfacecom.illumon.iris.auth.AuthModule
-
getFilterDetailsForUser
@NotNull public List<PermissionFilterProvider.FilterDetails> getFilterDetailsForUser(io.deephaven.enterprise.auth.UserContext userContext) Description copied from interface:DbAclProvider
Gets the tableacls permissions filters for an effective user- Specified by:
getFilterDetailsForUser
in interfaceDbAclProvider
- Parameters:
userContext
- TheUserContext
from which the effective username to filter will be obtained- Returns:
- A List of
PermissionFilterProvider.FilterDetails
for the effective user
-
retrieveRowAcls
@NotNull public Collection<String> retrieveRowAcls(String effectiveUser, String namespace, String tableName) Description copied from interface:DbAclProvider
Returns the most specific tableacl per group for a specific user, namespace, and table.- Specified by:
retrieveRowAcls
in 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, retrieveColumnAclsString>>> (String effectiveUser, String namespace, String tableName) Description copied from interface:DbAclProvider
Returns the most specific Column ACL per group for a specific user, namespace, and table.- Specified by:
retrieveColumnAcls
in 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.
-
canEditInputTable
Description copied from interface:DbAclProvider
Checks whether a user has rights to edit an input table- Specified by:
canEditInputTable
in 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:DbAclProvider
Checks whether an input table can be edited by all users- Specified by:
canAnyoneEditInputTable
in 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:DbAclProvider
Retrieves all strategy accounts associated with a user, directly or through group membership- Specified by:
getAccountsForUser
in interfaceDbAclProvider
- Parameters:
effectiveUser
- The user for whom strategy account access should be checked- Returns:
- An array of String of associated strategy accounts
-
getAccountsForStrategy
Description copied from interface:DbAclProvider
Retrieves all strategy accounts associated with a particular strategy- Specified by:
getAccountsForStrategy
in 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:DbAclProvider
Retrieves all strategies associated with a particular strategy account- Specified by:
getStrategyForAccount
in 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:DbAclProvider
Retrieves all strategy accounts associated with a particular group- Specified by:
getAccountsForGroup
in 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:DbAclProvider
Retrieves all strategies associated with a particular group- Specified by:
getStrategiesForGroup
in interfaceDbAclProvider
- Parameters:
group
- The group name for which to filter strategies- Returns:
- An array of String of strategy names
-
groupStrategyExists
Description copied from interface:DbAclProvider
Checks whether a particular association of a group and a strategy exists- Specified by:
groupStrategyExists
in interfaceDbAclProvider
- Parameters:
groupName
- The group name to checkstrategy
- The strategy name to check- Returns:
- True if the mapping exists, false if it does not
-
getGroupsForUser
Description copied from interface:DbAclProvider
Get the groups to which a user is mapped- Specified by:
getGroupsForUser
in 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:DbAclProvider
Retrieves all strategies associated with a particular user, either directly or through group membership- Specified by:
getStrategiesForUser
in 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:DbAclProvider
Get the users that are members of a group- Specified by:
getUsersForGroup
in interfaceDbAclProvider
- Parameters:
group
- The String name of the group to find users for- Returns:
- A String array of users with membership in this group
-
getRunAsUser
Description copied from interface:DbAclProvider
Returns the systemuser to which the effectiveUser is mapped, or null if no mapping exists.- Specified by:
getRunAsUser
in 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.
-
getPublicKeys
Description copied from interface:DbAclProvider
Retrieve the public key data in the ACL database for the user. If the user is null then all keys are retrieved.- Specified by:
getPublicKeys
in interfaceDbAclProvider
- Parameters:
user
- The user identifier.- Returns:
- A list of PublicKeyRecord objects containing the user, the base64-encoded
PublicKey
key value, and a comment.
-