Interface DbAclProvider
- All Known Implementing Classes:
EtcdDbAclGuiHelper,EtcdDbAclProvider,MysqlDbAclGuiHelper,MysqlDbAclProvider,PermissionFilterProviderEtcdImpl,PermissionFilterProviderMysqlImpl,UnauthenticatedPermissionFilterProviderEtcdImpl,UnauthenticatedPermissionFilterProviderMysqlImpl
public interface DbAclProvider
-
Method Summary
Modifier and Type Method Description 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()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 systemList<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.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 existsMap<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.
-
Method Details
-
getFilterDetailsForUser
@NotNull List<PermissionFilterProvider.FilterDetails> getFilterDetailsForUser(io.deephaven.enterprise.auth.UserContext userContext)Gets the tableacls permissions filters for an effective user- Parameters:
userContext- TheUserContextfrom which the effective user name to filter will be obtained- Returns:
- A List of
PermissionFilterProvider.FilterDetailsfor the effective user
-
retrieveRowAcls
@NotNull Collection<String> retrieveRowAcls(String effectiveUser, String namespace, String tableName)Returns the most specific tableacl per group for a specific user, namespace, and table.- 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 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.- 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.- Parameters:
effectiveUser- The user to get ACLs forkey- The lookup value that applies- Returns:
- A collection of strings representing the applicable ACLs.
-
canEditInputTable
Checks whether a user has rights to edit an input table- 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
Checks whether an input table can be edited by all users- 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
Retrieves all strategy accounts associated with a user, directly or through group membership- Parameters:
effectiveUser- The user for whom strategy account access should be checked- Returns:
- An array of String of associated strategy accounts
-
getAllUsers
Retrieves all user accounts in the system- Returns:
- An array of String of user names
-
getAllGroups
Retrieves all groups accounts in the system- Returns:
- An array of String of groups names
-
getAllStrategies
Retrieves all strategy names by unioning strategies in strategyaccount with those in groupstrategy- Returns:
- An array of String of strategy names
- Throws:
SQLException- In the case of SQL implementations of this interface if something goes wrong
-
getAllAccounts
Retrieves all strategy accounts in the system- 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
Retrieves all strategy accounts associated with a particular strategy- Parameters:
strategy- The strategy name for which to filter accounts- Returns:
- An array of String of strategy account names
-
getStrategyForAccount
Retrieves all strategies associated with a particular strategy account- Parameters:
account- The strategy account name for which to filter strategies- Returns:
- An array of String of strategy account names
-
getAccountsForGroup
Retrieves all strategy accounts associated with a particular group- Parameters:
group- The group name for which to filter accounts- Returns:
- An array of String of strategy account names
-
getStrategiesForGroup
Retrieves all strategies associated with a particular group- Parameters:
group- The group name for which to filter strategies- Returns:
- An array of String of strategy names
-
groupStrategyExists
Checks whether a particular association of a group and a strategy exists- Parameters:
groupName- The group name to checkstrategy- The strategy name to check- Returns:
- True if the mapping exists, false if it does not
-
getGroupsForUser
Get the groups to which a user is mapped- Parameters:
effectiveUser- The String name of the user to find groups for- Returns:
- A String array of groups mapped to this user
-
getStrategiesForUser
Retrieves all strategies associated with a particular user, either directly or through group membership- Parameters:
effectiveUser- The user for whom strategy access should be checked- Returns:
- An array of String of strategy names
-
getUsersForGroup
Get the users that are members of a group- Parameters:
group- The String name of the group to find users for- Returns:
- A String array of users with membership in this group
-
changePassword
Changes the password of a user entry in passwd- 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
-
getSystemUsers
Returns an array of systemusers.- Returns:
- A String array of distinct systemuser names, sorted.
-
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.- Returns:
- A
ListofPair<String,String>objects which contain a user and password entry.
-
getRunAsUserMap
Returns a map of user names to systemuser names- Returns:
- a map of user names to systemuser names
-
getRunAsUser
Returns the systemuser to which the effectiveUser is mapped, or null if no mapping exists.- 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
Retrieve the public key data in the ACL database for the user. If the user is null then all keys are retrieved.- Parameters:
user- The user identifier.- Returns:
- A list of PublicKeyRecord objects containing the user, the base64-encoded
PublicKeykey value, and a comment.
-
getPublicKeys
Retrieve all public key data in the ACL database. Has the same effect as callinggetPublicKeys(String)with a nulluserparameter.- Returns:
- A list of PublicKeyRecord objects containing the user, the base64-encoded
PublicKeykey value, and a comment.
-
close
void close()
-