Interface DynamicAccessController

All Superinterfaces:
AccessController
All Known Implementing Classes:
NoOpDynamicAccessController

public interface DynamicAccessController extends AccessController
A DynamicAccessController is an AccessController with a mutable resource list. The resource list may be changed at runtime.
  • Method Details

    • init

      Initialize access controller.
      Parameters:
      resources - the initial resource list
      Returns:
      the access controller
    • hasAccess

      boolean hasAccess(X509Certificate clientCert, String resource, String method) throws AclException
      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:
      hasAccess in interface AccessController
      Parameters:
      clientCert - the X509Certificate submitted by client
      resource - the resource being requested, such as a Venice store
      method - the operation (GET, POST, ...) to perform against the resource
      Returns:
      true if client has permission to access, otherwise false.

      When hasAcl(String) == false, return isFailOpen().

      Throws:
      AclException
    • hasAcl

      boolean hasAcl(String resource) throws AclException
      Check if ACL exists for a particular resource.
      Parameters:
      resource - the resource name
      Returns:
      whether an ACL exists for the resource
      Throws:
      AclException
    • addAcl

      void addAcl(String resource) throws AclException
      Add a resource to the resource list. Call this method when a new resource gets created.
      Parameters:
      resource - the resource name
      Throws:
      AclException
    • removeAcl

      void removeAcl(String resource) throws AclException
      Remove a resource from the resource list. Call this method when a existing resource gets deleted.
      Parameters:
      resource - the resource name
      Throws:
      AclException
    • getAccessControlledResources

      Set<String> 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