Package org.apache.cassandra.auth
Class CassandraCIDRAuthorizer
java.lang.Object
org.apache.cassandra.auth.AbstractCIDRAuthorizer
org.apache.cassandra.auth.CassandraCIDRAuthorizer
- All Implemented Interfaces:
ICIDRAuthorizer
CassandraCIDRAuthorizer is backend for CIDR authorization checks
1, Provides functionality to populate Role to CIDR permisssions cache and
2, Uses CIDR groups mapping cache as backend to lookup CIDR groups of an IP
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.cassandra.auth.ICIDRAuthorizer
ICIDRAuthorizer.CIDRAuthorizerMode -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static CIDRGroupsMappingCacheprotected static CIDRPermissionsCacheFields inherited from class org.apache.cassandra.auth.AbstractCIDRAuthorizer
cidrAuthorizerMetrics, cidrGroupsMappingManager, cidrPermissionsManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasAccessFromIp(RoleResource role, InetAddress ipAddress) Determines does the given role has access from CIDR groups associated with given IPvoidInit caches held by CIDR authorizerbooleaninvalidateCidrPermissionsCache(String roleName) Invalidate given role from CIDR permissions cacheprotected booleanvoidLoad CIDR groups mapping cacheLookup IP in CIDR groups mapping cachevoidsetup()Methods inherited from class org.apache.cassandra.auth.AbstractCIDRAuthorizer
commonSetup, dropCidrPermissionsForRole, getCidrAuthorizerMetrics, getCidrGroupsMappingManager, requireAuthorization, setCidrGroupsForRole, validateConfiguration
-
Field Details
-
cidrPermissionsCache
-
cidrGroupsMappingCache
-
-
Constructor Details
-
CassandraCIDRAuthorizer
-
-
Method Details
-
setup
public void setup() -
initCaches
public void initCaches()Description copied from interface:ICIDRAuthorizerInit caches held by CIDR authorizer -
invalidateCidrPermissionsCache
Description copied from interface:ICIDRAuthorizerInvalidate given role from CIDR permissions cache- Parameters:
roleName- role to invalidate- Returns:
- returns true if given role found in the cache and invalidated, false otherwise
-
loadCidrGroupsCache
public void loadCidrGroupsCache()Description copied from interface:ICIDRAuthorizerLoad CIDR groups mapping cache -
lookupCidrGroupsForIp
Description copied from interface:ICIDRAuthorizerLookup IP in CIDR groups mapping cache- Parameters:
ip- input IP to lookup CIDR group- Returns:
- returns best matching CIDR group for this IP
-
isMonitorMode
protected boolean isMonitorMode() -
hasAccessFromIp
Description copied from interface:ICIDRAuthorizerDetermines does the given role has access from CIDR groups associated with given IP- Parameters:
role- role to check accessipAddress- IP of the client- Returns:
- returns true if role has access from given IP, false otherwise
-