Package com.linkedin.venice.acl
Interface DynamicAccessController
- All Superinterfaces:
AccessController
- All Known Implementing Classes:
NoOpDynamicAccessController
A DynamicAccessController is an AccessController with a mutable resource list.
The resource list may be changed at runtime.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a resource to the resource list.Get a list of currently being access-controlled resources.booleanhasAccess(X509Certificate clientCert, String resource, String method) Check if client has permission to access a particular resource.booleanCheck if ACL exists for a particular resource.Initialize access controller.booleanUse this method to determine if clients will be granted access to a resource when the corresponding ACL of the resource is missing.voidRemove a resource from the resource list.Methods inherited from interface com.linkedin.venice.acl.AccessController
getPrincipalId, hasAccessToAdminOperation, hasAccessToTopic, isAllowlistUsers
-
Method Details
-
init
Initialize access controller.- Parameters:
resources- the initial resource list- Returns:
- the access controller
-
hasAccess
Check if client has permission to access a particular resource. This method is invoked by every single request, therefore minimized execution time will result the best latency and throughput.- Specified by:
hasAccessin interfaceAccessController- Parameters:
clientCert- the X509Certificate submitted by clientresource- the resource being requested, such as a Venice storemethod- the operation (GET, POST, ...) to perform against the resource- Returns:
trueif client has permission to access, otherwisefalse.When
hasAcl(String)== false, returnisFailOpen().- Throws:
AclException
-
hasAcl
Check if ACL exists for a particular resource.- Parameters:
resource- the resource name- Returns:
- whether an ACL exists for the resource
- Throws:
AclException
-
addAcl
Add a resource to the resource list. Call this method when a new resource gets created.- Parameters:
resource- the resource name- Throws:
AclException
-
removeAcl
Remove a resource from the resource list. Call this method when a existing resource gets deleted.- Parameters:
resource- the resource name- Throws:
AclException
-
getAccessControlledResources
Get a list of currently being access-controlled resources. Ideally, this list should be identical the list of existing resources, so that each and every resource (e.g. Venice store) is being access-controlled.- Returns:
- the set of access-controlled resources
-
isFailOpen
boolean isFailOpen()Use this method to determine if clients will be granted access to a resource when the corresponding ACL of the resource is missing.- Returns:
- whether the implementation uses a fail-open policy
-