Class DbAclWriteClient
- All Implemented Interfaces:
DbAclWriter
IrisDbUserMod-
Constructor Summary
ConstructorsConstructorDescriptionDbAclWriteClient(com.fishlib.io.logger.Logger logger) Constructor that initializes the base web target for all acl rest api callsDbAclWriteClient(com.fishlib.io.logger.Logger logger, TokenFactoryFactory tokenFactoryFactory) Constructor that initializes the base web target for all acl rest api calls -
Method Summary
Modifier and TypeMethodDescriptionintAdds an ACL entry.intAdds 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 groupsintaddOrUpdateSystemUserAcl(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.voidAdds a user to the Iris system.voidchangePassword(String user, String passwordHash) Changes the password for a user.voiddeleteAclData(String... types) Deletes ACL data for the requested types.voiddeleteAcls(String group, String ns, String table) Deletes an ACL entry for a group and table.voidDeletes 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.voiddeleteSystemUserAcl(String user) Removes an entry from the ACL database for run-as mappingvoiddeleteUser(String user) The user is deleted.static DbAclWriteClientgetInstance(com.fishlib.io.logger.Logger log) Static method to allow simple way to get a DbAclWriteClient from a console.voidremoveMembership(String user, List<String> groups) Removes a user from a list of groups.intChanges an already existent ACL entry.intChanges 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.
-
Constructor Details
-
DbAclWriteClient
public DbAclWriteClient(com.fishlib.io.logger.Logger logger) Constructor that initializes the base web target for all acl rest api calls- Parameters:
logger- The passed in logger used to log api failures
-
DbAclWriteClient
public DbAclWriteClient(com.fishlib.io.logger.Logger logger, @NotNull TokenFactoryFactory tokenFactoryFactory) Constructor that initializes the base web target for all acl rest api calls- Parameters:
logger- The passed in logger used to log api failurestokenFactoryFactory- a factory for creating tokens used for REST calls
-
-
Method Details
-
getInstance
Static method to allow simple way to get a DbAclWriteClient from a console.- Parameters:
log- A logger instance- Returns:
- DbAclWriteClient
-
addUser
Description copied from interface:DbAclWriterAdds a user to the Iris system.- Specified by:
addUserin 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:DbAclWriterChanges the password for a user.- Specified by:
changePasswordin interfaceDbAclWriter- Parameters:
user- the user to change a password for.passwordHash- the APR1 hash of the user's password.- Throws:
AclStoreException- if the underlying operation could not be completed
-
addMembership
Description copied from interface:DbAclWriterAdds a user to a list of groupsIf the user could not be added to all 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
-
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 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:
AclStoreException- if the underlying 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:
AclStoreException- if the underlying 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:
AclStoreException- if the underlying 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:
AclStoreException- if the underlying 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:
AclStoreException- if the underlying 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:
AclStoreException- if the underlying 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:
AclStoreException- if the underlying 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 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: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 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: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 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: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 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: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 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: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 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: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 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: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 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: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 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: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:
AclStoreException- if the underlying 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:
AclStoreException- if the underlying operation could not be completed
-
addPublicKeyForUser
public int addPublicKeyForUser(@NotNull String user, @NotNull PublicKey publicKey, @Nullable String comment) throws AclStoreException Description 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:
AclStoreException- if the underlying operation could not be completed
-
deletePublicKeyForUser
public boolean deletePublicKeyForUser(@NotNull String user, @NotNull PublicKey publicKey) throws AclStoreException 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:
AclStoreException- if the underlying operation could not be completed
-
deleteAllAclData
Description copied from interface:DbAclWriterDeletes all data in the ACL store. Use with great care.- Specified by:
deleteAllAclDatain interfaceDbAclWriter- Throws:
AclStoreException- if the underlying operation could not be completed
-
deleteAclData
Description copied from interface:DbAclWriterDeletes ACL data for the requested types. SeeAclEntryTypes.- Specified by:
deleteAclDatain interfaceDbAclWriter- Parameters:
types- the types to delete.- Throws:
AclStoreException- if the underlying operation could not be completed
-