Search in sources :

Example 6 with BasicAuthorizerRoleMapBundle

use of org.apache.druid.security.basic.authorization.entity.BasicAuthorizerRoleMapBundle in project druid by druid-io.

the class CoordinatorBasicAuthorizerMetadataStorageUpdater method getCurrentGroupMappingAndRoleMapSerialized.

private byte[] getCurrentGroupMappingAndRoleMapSerialized(String prefix) throws IOException {
    BasicAuthorizerGroupMappingMapBundle groupMappingMapBundle = cachedGroupMappingMaps.get(prefix);
    BasicAuthorizerRoleMapBundle roleMapBundle = cachedRoleMaps.get(prefix);
    GroupMappingAndRoleMap groupMappingAndRoleMap = new GroupMappingAndRoleMap(groupMappingMapBundle == null ? null : groupMappingMapBundle.getGroupMappingMap(), roleMapBundle == null ? null : roleMapBundle.getRoleMap());
    return objectMapper.writeValueAsBytes(groupMappingAndRoleMap);
}
Also used : GroupMappingAndRoleMap(org.apache.druid.security.basic.authorization.entity.GroupMappingAndRoleMap) BasicAuthorizerGroupMappingMapBundle(org.apache.druid.security.basic.authorization.entity.BasicAuthorizerGroupMappingMapBundle) BasicAuthorizerRoleMapBundle(org.apache.druid.security.basic.authorization.entity.BasicAuthorizerRoleMapBundle)

Aggregations

BasicAuthorizerRoleMapBundle (org.apache.druid.security.basic.authorization.entity.BasicAuthorizerRoleMapBundle)6 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 MetadataCASUpdate (org.apache.druid.metadata.MetadataCASUpdate)3 BasicSecurityDBResourceException (org.apache.druid.security.basic.BasicSecurityDBResourceException)3 BasicAuthorizerGroupMappingMapBundle (org.apache.druid.security.basic.authorization.entity.BasicAuthorizerGroupMappingMapBundle)3 BasicAuthorizerUserMapBundle (org.apache.druid.security.basic.authorization.entity.BasicAuthorizerUserMapBundle)3 GroupMappingAndRoleMap (org.apache.druid.security.basic.authorization.entity.GroupMappingAndRoleMap)2 UserAndRoleMap (org.apache.druid.security.basic.authorization.entity.UserAndRoleMap)2 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ISE (org.apache.druid.java.util.common.ISE)1 LifecycleStart (org.apache.druid.java.util.common.lifecycle.LifecycleStart)1 BasicAuthDBConfig (org.apache.druid.security.basic.BasicAuthDBConfig)1 BasicRoleBasedAuthorizer (org.apache.druid.security.basic.authorization.BasicRoleBasedAuthorizer)1 BasicAuthorizerGroupMapping (org.apache.druid.security.basic.authorization.entity.BasicAuthorizerGroupMapping)1 BasicAuthorizerRole (org.apache.druid.security.basic.authorization.entity.BasicAuthorizerRole)1 BasicAuthorizerUser (org.apache.druid.security.basic.authorization.entity.BasicAuthorizerUser)1 Authorizer (org.apache.druid.server.security.Authorizer)1 Duration (org.joda.time.Duration)1