Package org.apache.hadoop.ozone.om
Class OMMultiTenantManagerImpl.AuthorizerOp
java.lang.Object
org.apache.hadoop.ozone.om.OMMultiTenantManagerImpl.AuthorizerOp
- All Implemented Interfaces:
TenantOp
- Enclosing class:
OMMultiTenantManagerImpl
Implements tenant authorizer operations.
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignTenantAdmin(String accessId, boolean delegated) Given an accessId, grant that user admin privilege in the tenant.voidassignUserToTenant(String userPrincipal, String tenantId, String accessId) Algorithm Authorizer-plugin(Ranger) State : - create User in Ranger DB - For every user created Add them to # GroupTenantAllUsers In case of failure : - Undo all Ranger State - remove updates to the Map Locking : - Create/Manage Tenant/User operations are control path operations.voidcreateTenant(String tenantId, String userRoleName, String adminRoleName) Algorithm OM State : - Validation (Part of Ratis Request) - create volume {Part of RATIS request} - Persistence to OM DB {Part of RATIS request} Authorizer-plugin(Ranger) State : - For every tenant create two user groups # GroupTenantAllUsers # GroupTenantAllAdmins - For every tenant create two default policies - Note: plugin states are made idempotent.voiddeleteTenant(org.apache.hadoop.ozone.om.multitenant.Tenant tenant) Given a Tenant object, remove all policies and roles from Ranger that are added during tenant creation.voidrevokeTenantAdmin(String accessId) Given an accessId, revoke that user's admin privilege in that tenant.voidrevokeUserAccessId(String accessId, String tenantId) Revoke user accessId in a tenant.
-
Method Details
-
createTenant
public void createTenant(String tenantId, String userRoleName, String adminRoleName) throws IOException Algorithm OM State : - Validation (Part of Ratis Request) - create volume {Part of RATIS request} - Persistence to OM DB {Part of RATIS request} Authorizer-plugin(Ranger) State : - For every tenant create two user groups # GroupTenantAllUsers # GroupTenantAllAdmins - For every tenant create two default policies - Note: plugin states are made idempotent. Onus of returning EEXIST is part of validation in Ratis-Request. if the groups/policies exist with the same name (Due to an earlier failed/success request), in plugin, we just update in-memory-map here and return success. - The job of cleanup of any half-done authorizer-plugin state is done by a background thread. Finally : - Update all Maps maintained by Multi-Tenant-Manager In case of failure : - Undo all Ranger State - remove updates to the Map Locking : - Create/Manage Tenant/User operations are control path operations. We can do all of this as part of holding a coarse lock and synchronize these control path operations.- Specified by:
createTenantin interfaceTenantOp- Parameters:
tenantId- tenant nameuserRoleName- user role nameadminRoleName- admin role name- Throws:
IOException
-
deleteTenant
Description copied from interface:TenantOpGiven a Tenant object, remove all policies and roles from Ranger that are added during tenant creation. Note this differs from deactivateTenant() above.- Specified by:
deleteTenantin interfaceTenantOp- Parameters:
tenant- tenant object- Throws:
IOException
-
assignUserToTenant
public void assignUserToTenant(String userPrincipal, String tenantId, String accessId) throws IOException Algorithm Authorizer-plugin(Ranger) State : - create User in Ranger DB - For every user created Add them to # GroupTenantAllUsers In case of failure : - Undo all Ranger State - remove updates to the Map Locking : - Create/Manage Tenant/User operations are control path operations. We can do all of this as part of holding a coarse lock and synchronize these control path operations.- Specified by:
assignUserToTenantin interfaceTenantOp- Parameters:
userPrincipal-tenantId-accessId-- Throws:
IOException
-
revokeUserAccessId
Description copied from interface:TenantOpRevoke user accessId in a tenant.- Specified by:
revokeUserAccessIdin interfaceTenantOp- Parameters:
accessId- access IDtenantId- tenant name- Throws:
IOException
-
assignTenantAdmin
Description copied from interface:TenantOpGiven an accessId, grant that user admin privilege in the tenant.- Specified by:
assignTenantAdminin interfaceTenantOp- Parameters:
accessId- access IDdelegated- true if intending to assign as the user as the tenant's delegated admin (who can assign and revoke other tenant admins in this tenant)- Throws:
IOException
-
revokeTenantAdmin
Description copied from interface:TenantOpGiven an accessId, revoke that user's admin privilege in that tenant.- Specified by:
revokeTenantAdminin interfaceTenantOp- Parameters:
accessId- access ID- Throws:
IOException
-