Class MysqlDbAclProvider
- All Implemented Interfaces:
com.illumon.iris.auth.AuthModule
,DbAclProvider
,DbAclWriter
,Closeable
,AutoCloseable
- Direct Known Subclasses:
MysqlDbAclGuiHelper
,UnauthenticatedPermissionFilterProviderMysqlImpl
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 ClassesModifier and TypeClassDescriptionstatic class
protected static interface
protected static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.illumon.iris.db.v2.permissions.AclValidator
protected Connection
static final String
-
Constructor Summary
ConstructorsConstructorDescriptionMysqlDbAclProvider
(com.fishlib.io.logger.Logger log) MysqlDbAclProvider
(com.fishlib.io.logger.Logger log, boolean readOnly) -
Method Summary
Modifier and TypeMethodDescriptionint
Adds an ACL entry.int
Adds a Column ACL entry.void
addGroupStrategy
(String group, String strategy) For AccountFilterGenerator() there are two levels of mappings.int
addInputTableEditor
(String group, String ns, String table, boolean canEdit) Adds an entry to the ACL database for editing an input table.void
addMembership
(String user, List<String> groups) Adds a user to a list of groupsint
addOrUpdateSystemUserAcl
(String user, String systemUser) Inserts or Updates an entry to the ACL database for run-as mappingint
addPublicKeyForUser
(String user, PublicKey publicKey, String comment) Adds a public key for the user into the ACL database.void
addStrategyAccount
(String strategy, String account) For AccountFilterGenerator() there are two levels of mappings.void
Adds a user to the Iris system.boolean
canAnyoneEditInputTable
(String namespace, String tableName) Checks whether an input table can be edited by all usersprotected boolean
canAnyoneEditInputTableImpl
(String namespace, String tableName) boolean
canEditInputTable
(String effectiveUser, String namespace, String tableName) Checks whether a user has rights to edit an input tableprotected boolean
canEditInputTableImpl
(String effectiveUser, String namespace, String tableName) void
changePassword
(String user, String passwordHash) Changes the password of a user entry in passwdvoid
close()
Releases network resources associated with this ACL provider.void
deleteAclData
(String... types) Deletes the specified data in the ACL store.void
deleteAcls
(String group, String ns, String table) Deletes an ACL entry for a group and table.void
Deletes all data in the ACL store.void
deleteColumnAcls
(String group, String ns, String table, String columns) Deletes a Column ACL entry for a group, table, and column set.void
deleteGroup
(String group) Deletes a group.void
deleteGroupStrategy
(String group, String strategy) For AccountFilterGenerator() there are two levels of mappings.void
deleteInputTableEditor
(String group, String ns, String table) Deletes an entry to the ACL database for editing an input table.boolean
deletePublicKeyForUser
(String user, PublicKey publicKey) Delete the public key from the ACL database, if it exists.void
deleteStrategyAccount
(String strategy, String account) For AccountFilterGenerator() there are two levels of mappings.void
deleteSystemUserAcl
(String user) Removes an entry from the ACL database for run-as mappingvoid
deleteUser
(String user) The user is deleted.String[]
getAccountsForGroup
(String group) Retrieves all strategy accounts associated with a particular groupprotected String[]
getAccountsForGroupImpl
(String group) String[]
getAccountsForStrategy
(String strategy) Retrieves all strategy accounts associated with a particular strategyprotected String[]
getAccountsForStrategyImpl
(String strategy) String[]
getAccountsForUser
(String effectiveUser) Retrieves all strategy accounts associated with a user, directly or through group membershipprotected String[]
getAccountsForUserImpl
(String effectiveUser) String[]
Retrieves all strategy accounts in the systemString[]
Retrieves all groups accounts in the systemString[]
Retrieves all strategy names by unioning strategies in strategyaccount with those in groupstrategyString[]
Retrieves all user accounts in the systemstatic String
Retrieve the stored password for connecting to the MySQL ACL database, leaving it encodedgetFilterDetailsForUser
(UserContext userContext) Gets the tableacls permissions filters for an effective userprotected List<PermissionFilterProvider.FilterDetails>
getFilterDetailsForUserImpl
(UserContext userContext) String[]
getGroupsForUser
(String effectiveUser) Get the groups to which a user is mappedprotected String[]
getGroupsForUserImpl
(String effectiveUser) Returns user and password entries from the passwd table.Retrieve all public key data in the ACL database.getPublicKeys
(String user) Retrieve the public key data in the ACL database for the user.protected List<PublicKeyRecord>
getPublicKeysImpl
(String user) getRunAsUser
(String effectiveUser) Returns the systemuser to which the effectiveUser is mapped, or null if no mapping exists.protected String
getRunAsUserImpl
(String effectiveUser) Returns a map of usernames to systemuser namesString[]
getStrategiesForGroup
(String group) Retrieves all strategies associated with a particular groupprotected String[]
getStrategiesForGroupImpl
(String group) String[]
getStrategiesForUser
(String effectiveUser) Retrieves all strategies associated with a particular user, either directly or through group membershipprotected String[]
getStrategiesForUserImpl
(String effectiveUser) String[]
getStrategyForAccount
(String account) Retrieves all strategies associated with a particular strategy accountprotected String[]
getStrategyForAccountImpl
(String account) String[]
Returns an array of systemusers.getUserByPublicKey
(PublicKey publicKey) String[]
getUsersForGroup
(String group) Get the users that are members of a groupprotected String[]
getUsersForGroupImpl
(String group) boolean
groupStrategyExists
(String groupName, String strategy) Checks whether a particular association of a group and a strategy existsprotected boolean
groupStrategyExistsImpl
(String groupName, String strategy) boolean
isUserPassValid
(String username, String password) protected boolean
isUserPassValidImpl
(String username, String password) protected boolean
isUserPresentInBasicGroups
(String username) Returns true if the username is present in the basic groups of 'allusers' and a group with the same name as given username.void
removeMembership
(String user, List<String> groups) Removes a user from a list of groups.retrieveColumnAcls
(String effectiveUser, String namespace, String tableName) Returns the most specific Column ACL per group for a specific user, namespace, and table.retrieveColumnAclsImpl
(String effectiveUser, String namespace, String tableName) retrieveRowAcls
(String effectiveUser, String namespace, String tableName) Returns the most specific tableacl per group for a specific user, namespace, and table.protected Collection<String>
retrieveRowAclsImpl
(String effectiveUser, String namespace, String tableName) protected <R> R
runCheckedFunctionWithSqlRetry
(MysqlDbAclProvider.SQLFunction<R> function, String errorMessage) protected <R> R
runFunctionWithSqlRetry
(MysqlDbAclProvider.SQLFunction<R> function, String errorMessage) protected <R> R
protected void
Delegates torunProcedureWithSqlRetryInternal(SQLProcedure)
.protected void
runProcedureWithRetry
(MysqlDbAclProvider.SQLProcedure procedure, String errorMessage) Delegates torunProcedureWithSqlRetryInternal(SQLProcedure)
.int
Changes an already existent ACL entry.int
Changes an already existent Column ACL entry.int
updateInputTableEditor
(String group, String ns, String table, boolean canEdit) Updates an entry to the ACL database for editing an input table.boolean
userExists
(String username) protected boolean
userExistsImpl
(String username) 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, getAccountsForGroup, getAccountsForStrategy, getAccountsForUser, getFilterDetailsForUser, getGroupsForUser, getPublicKeys, getRunAsUser, getStrategiesForGroup, getStrategiesForUser, getStrategyForAccount, getUsersForGroup, groupStrategyExists, retrieveColumnAcls, retrieveRowAcls
-
Field Details
-
PASSWORD_ENV
- See Also:
-
mysqlConnection
-
aclValidator
protected final com.illumon.iris.db.v2.permissions.AclValidator aclValidator
-
-
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()Description copied from interface:DbAclProvider
Releases network resources associated with this ACL provider. close() may only be called once. After calling close, the provider may not be used anymore.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceDbAclProvider
-
getFilterDetailsForUserImpl
@NotNull protected List<PermissionFilterProvider.FilterDetails> getFilterDetailsForUserImpl(UserContext userContext) -
retrieveRowAclsImpl
@NotNull protected Collection<String> retrieveRowAclsImpl(String effectiveUser, String namespace, String tableName) -
retrieveColumnAclsImpl
-
canEditInputTableImpl
-
canAnyoneEditInputTableImpl
-
getAccountsForUserImpl
-
getAllUsers
Description copied from interface:DbAclProvider
Retrieves all user accounts in the system- Specified by:
getAllUsers
in interfaceDbAclProvider
- Returns:
- An array of String of usernames
-
getSystemUsers
Description copied from interface:DbAclProvider
Returns an array of systemusers.- Specified by:
getSystemUsers
in interfaceDbAclProvider
- Returns:
- A String array of distinct systemuser names, sorted.
-
getAllGroups
Description copied from interface:DbAclProvider
Retrieves all groups accounts in the system- Specified by:
getAllGroups
in interfaceDbAclProvider
- Returns:
- An array of String of groups names
-
getAllStrategies
Description copied from interface:DbAclProvider
Retrieves all strategy names by unioning strategies in strategyaccount with those in groupstrategy- Specified by:
getAllStrategies
in interfaceDbAclProvider
- Returns:
- An array of String of strategy names
- Throws:
AclStoreException
- when operation results in backing store errors
-
getAllAccounts
Description copied from interface:DbAclProvider
Retrieves all strategy accounts in the system- Specified by:
getAllAccounts
in interfaceDbAclProvider
- Returns:
- An array of String of strategy account names
- Throws:
AclStoreException
- when operation results in backing store errors
-
getAccountsForStrategyImpl
-
getStrategyForAccountImpl
-
getAccountsForGroupImpl
-
getStrategiesForGroupImpl
-
groupStrategyExistsImpl
-
userExistsImpl
-
isUserPassValidImpl
-
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:
getPasswdsForMigration
in interfaceDbAclProvider
- Returns:
- A
List
ofPair<String,String>
objects which contain a user and password entry.
-
runFunctionWithSqlRetry
protected <R> R runFunctionWithSqlRetry(MysqlDbAclProvider.SQLFunction<R> function, String errorMessage) -
runCheckedFunctionWithSqlRetry
protected <R> R runCheckedFunctionWithSqlRetry(MysqlDbAclProvider.SQLFunction<R> function, String errorMessage) throws AclStoreException - Throws:
AclStoreException
-
runFunctionWithSqlRetryInternal
protected <R> R runFunctionWithSqlRetryInternal(MysqlDbAclProvider.SQLFunction<R> function) throws SQLException - Throws:
SQLException
-
runProcedureWithRetry
protected void runProcedureWithRetry(MysqlDbAclProvider.SQLProcedure procedure, String errorMessage) Delegates torunProcedureWithSqlRetryInternal(SQLProcedure)
. In case of exception will throwUncheckedPermissionException
with given errorMessage and include thrown exception as cause- Parameters:
procedure
- The sql procedure to invoke on the database
-
runProcedureWithRetry
protected void runProcedureWithRetry(MysqlDbAclProvider.SQLProcedure procedure) throws AclStoreException Delegates torunProcedureWithSqlRetryInternal(SQLProcedure)
. In case of exception will rethrow usingAclStoreException
- Parameters:
procedure
- The sql procedure to invoke on the database- Throws:
AclStoreException
- when operation fails to complete
-
getGroupsForUserImpl
-
getStrategiesForUserImpl
-
getUsersForGroupImpl
-
getRunAsUserMap
Description copied from interface:DbAclProvider
Returns a map of usernames to systemuser names- Specified by:
getRunAsUserMap
in interfaceDbAclProvider
- Returns:
- a map of usernames to systemuser names
-
getRunAsUserImpl
-
addMembership
Description copied from interface:DbAclWriter
Adds a user to a list of groupsIf the user could not be added to all the groups, a RuntimeException is thrown.
- Specified by:
addMembership
in interfaceDbAclWriter
- Parameters:
user
- the user to add to the groupsgroups
- a list of groups to add the user to- Throws:
AclStoreException
- if the underlying operation could not be completed
-
addUser
Description copied from interface:DbAclWriter
Adds a user to the Iris system.- Specified by:
addUser
in interfaceDbAclWriter
- Parameters:
user
- the user to add.passwordHash
- the optional APR1 hash of the user's password. Ignored if the system is not configured to manage user authentication.- Throws:
AclStoreException
- if the underlying operation could not be completed
-
changePassword
Description copied from interface:DbAclProvider
Changes the password of a user entry in passwd- Specified by:
changePassword
in interfaceDbAclProvider
- Specified by:
changePassword
in interfaceDbAclWriter
- Parameters:
user
- The user for which the password should be updatedpasswordHash
- The new password value to store- Throws:
AclStoreException
- when operation results in backing store errors
-
removeMembership
Description copied from interface:DbAclWriter
Removes 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 the specified groups (e.g., because they are not a member of those groups), a runtime exception is thrown.
- Specified by:
removeMembership
in interfaceDbAclWriter
- Parameters:
user
- the user to remove from groupsgroups
- a list of groups to remove the user from- Throws:
AclStoreException
- if the underlying operation could not be completed
-
deleteGroup
Description copied from interface:DbAclWriter
Deletes 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:
deleteGroup
in interfaceDbAclWriter
- Parameters:
group
- the group to delete.- Throws:
AclStoreException
- if the underlying operation could not be completed
-
deleteUser
Description copied from interface:DbAclWriter
The 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:
deleteUser
in interfaceDbAclWriter
- Parameters:
user
- the user to delete- Throws:
AclStoreException
- if the underlying operation could not be completed
-
addGroupStrategy
Description copied from interface:DbAclWriter
For 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:
addGroupStrategy
in interfaceDbAclWriter
- Parameters:
group
- the group to map to a strategystrategy
- the strategy that the group is added to- Throws:
AclStoreException
- if the underlying operation could not be completed
-
deleteGroupStrategy
Description copied from interface:DbAclWriter
For 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:
deleteGroupStrategy
in interfaceDbAclWriter
- Parameters:
group
- the group to remove a mapping to a strategystrategy
- the strategy that the group is removed from- Throws:
AclStoreException
- if the underlying operation could not be completed
-
addStrategyAccount
Description copied from interface:DbAclWriter
For 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:
addStrategyAccount
in interfaceDbAclWriter
- Parameters:
strategy
- the strategy that the account is added toaccount
- the account to add to a strategy- Throws:
AclStoreException
- if the underlying operation could not be completed
-
deleteStrategyAccount
Description copied from interface:DbAclWriter
For 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:
deleteStrategyAccount
in interfaceDbAclWriter
- Parameters:
strategy
- the strategy that the account is added toaccount
- the account to add to a strategy- Throws:
AclStoreException
- if the underlying operation could not be completed
-
addAcl
Description copied from interface:DbAclWriter
Adds an ACL entry.No ACL entry may currently exist for the group and table in question.
- Specified by:
addAcl
in interfaceDbAclWriter
- Parameters:
group
- the group to add the entry forns
- the namespace to add the entry for ("*" for all namespaces)table
- the tablename to add the entry for ("*" for all tables within a namespace, if ns is "*" table must also be "*")acl
- the ACL to add, see Acl Documentation.- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
AclStoreException
- if the underlying operation could not be completed
-
updateAcl
Description copied from interface:DbAclWriter
Changes an already existent ACL entry.An ACL entry must currently exist for the group and table in question.
- Specified by:
updateAcl
in interfaceDbAclWriter
- Parameters:
group
- the group to update the entry forns
- the namespace to update the entry for ("*" for all namespaces)table
- the tablename to update the entry for ("*" for all tables within a namespace, if ns is "*" table must also be "*")acl
- the new ACL, see Acl Documentation.- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
AclStoreException
- if the underlying operation could not be completed
-
deleteAcls
Description copied from interface:DbAclWriter
Deletes an ACL entry for a group and table.- Specified by:
deleteAcls
in interfaceDbAclWriter
- Parameters:
group
- the group to remove the entry forns
- the namespace to remove the entry for ("*" for all namespaces)table
- the tablename to remove the entry for ("*" for all tables within a namespace, if ns is "*" table must also be "*")- Throws:
AclStoreException
- if the underlying operation could not be completed
-
addColumnAcl
public int addColumnAcl(String group, String ns, String table, String columns, String acl) throws AclStoreException Description copied from interface:DbAclWriter
Adds a Column ACL entry.No ACL entry may currently exist for the group and table in question.
- Specified by:
addColumnAcl
in interfaceDbAclWriter
- Parameters:
group
- the group to add the entry forns
- the namespace to add the entry for ("*" for all namespaces)table
- the tablename to add the entry for ("*" for all tables within a namespace, if ns is "*" table must also be "*")columns
- the columns the ACL applies toacl
- the ACL to add, see Acl Documentation.- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
AclStoreException
- if the underlying operation could not be completed
-
updateColumnAcl
public int updateColumnAcl(String group, String ns, String table, String columns, String acl) throws AclStoreException Description copied from interface:DbAclWriter
Changes an already existent Column ACL entry.An ACL entry must currently exist for the group, table, and column set in question.
- Specified by:
updateColumnAcl
in interfaceDbAclWriter
- Parameters:
group
- the group to update the entry forns
- the namespace to update the entry for ("*" for all namespaces)table
- the tablename to update the entry for ("*" for all tables within a namespace, if ns is "*" table must also be "*")columns
- the columns the ACL applies toacl
- the new ACL, see Acl Documentation.- Returns:
- the number of rows within the ACL database that were modified.
- Throws:
AclStoreException
- if the underlying operation could not be completed
-
deleteColumnAcls
public void deleteColumnAcls(String group, String ns, String table, String columns) throws AclStoreException Description copied from interface:DbAclWriter
Deletes a Column ACL entry for a group, table, and column set.- Specified by:
deleteColumnAcls
in interfaceDbAclWriter
- Parameters:
group
- the group to remove the entry forns
- the namespace to add the entry for ("*" for all namespaces)table
- the tablename to add the entry for ("*" for all tables within a namespace, if ns is "*" table must also be "*")columns
- the applicable columns set- Throws:
AclStoreException
- if the underlying operation could not be completed
-
addInputTableEditor
public int addInputTableEditor(String group, String ns, String table, boolean canEdit) throws AclStoreException Description copied from interface:DbAclWriter
Adds an entry to the ACL database for editing an input table.- Specified by:
addInputTableEditor
in interfaceDbAclWriter
- Parameters:
group
- the group to add the entry forns
- the namespace to add the entry for ("*" for all namespaces)table
- the tablename to add the entry for ("*" for all 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:
AclStoreException
- if the underlying operation could not be completed
-
updateInputTableEditor
public int updateInputTableEditor(String group, String ns, String table, boolean canEdit) throws AclStoreException Description copied from interface:DbAclWriter
Updates an entry to the ACL database for editing an input table.- Specified by:
updateInputTableEditor
in interfaceDbAclWriter
- Parameters:
group
- the group to update the entry forns
- the namespace to update the entry for ("*" for all namespaces)table
- the tablename to update the entry for ("*" for all 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:
AclStoreException
- if the underlying operation could not be completed
-
deleteInputTableEditor
Description copied from interface:DbAclWriter
Deletes an entry to the ACL database for editing an input table.- Specified by:
deleteInputTableEditor
in interfaceDbAclWriter
- Parameters:
group
- the group to delete the entry forns
- the namespace to delete the entry for ("*" for all namespaces)table
- the tablename to delete the entry for ("*" for all tables within a namespace, if ns is "*" table must also be "*")- Throws:
AclStoreException
- if the underlying operation could not be completed
-
addOrUpdateSystemUserAcl
Description copied from interface:DbAclWriter
Inserts or Updates an entry to the ACL database for run-as mapping- Specified by:
addOrUpdateSystemUserAcl
in 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:
AclStoreException
- if the underlying operation could not be completed
-
deleteSystemUserAcl
Description copied from interface:DbAclWriter
Removes an entry from the ACL database for run-as mapping- Specified by:
deleteSystemUserAcl
in interfaceDbAclWriter
- Parameters:
user
- the user whose system-user mapping is to be deleted- Throws:
AclStoreException
- if the underlying operation could not be completed
-
getUserByPublicKey
- Specified by:
getUserByPublicKey
in interfacecom.illumon.iris.auth.AuthModule
-
getPublicKeysImpl
-
getPublicKeys
Description copied from interface:DbAclProvider
Retrieve all public key data in the ACL database. Has the same effect as callingDbAclProvider.getPublicKeys(String)
with a nulluser
parameter.- Specified by:
getPublicKeys
in interfaceDbAclProvider
- Returns:
- A list of PublicKeyRecord objects containing the user, the base64-encoded
PublicKey
key value, and a comment.
-
addPublicKeyForUser
public int addPublicKeyForUser(String user, PublicKey publicKey, String comment) throws AclStoreException Description copied from interface:DbAclWriter
Adds a public key for the user into the ACL database.- Specified by:
addPublicKeyForUser
in 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:
AclStoreException
- if the underlying operation could not be completed
-
deletePublicKeyForUser
Description copied from interface:DbAclWriter
Delete the public key from the ACL database, if it exists.- Specified by:
deletePublicKeyForUser
in 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:
AclStoreException
- if the underlying operation could not be completed
-
deleteAllAclData
Deletes all data in the ACL store. Use with great care.- Specified by:
deleteAllAclData
in interfaceDbAclWriter
- Throws:
AclStoreException
- if the underlying operation could not be completed
-
deleteAclData
Deletes the specified data in the ACL store. Use with great care.- Specified by:
deleteAclData
in interfaceDbAclWriter
- Parameters:
types
- the types to delete.- Throws:
AclStoreException
- if the underlying operation could not be completed
-
userExists
- Specified by:
userExists
in interfacecom.illumon.iris.auth.AuthModule
-
isUserPassValid
- Specified by:
isUserPassValid
in interfacecom.illumon.iris.auth.AuthModule
-
isUserPresentInBasicGroups
Returns true if the username is present in the basic groups of 'allusers' and a group with the same name as given username.- Parameters:
username
- the username for the check is being performed- Returns:
- true if username exists in basic groups
-
getFilterDetailsForUser
@NotNull public List<PermissionFilterProvider.FilterDetails> getFilterDetailsForUser(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.
-