Class CerbosBlockingClient


  • public class CerbosBlockingClient
    extends java.lang.Object
    CerbosBlockingClient provides a client implementation that blocks waiting for a response from the PDP.
    • Method Detail

      • with

        public CerbosBlockingClient with​(AuxData auxData)
        Automatically attach the provided auxiliary data to requests.
        Parameters:
        auxData - AuxData instance
        Returns:
        new CerbosBlockingClient configured to attach the auxiliary data to requests.
      • check

        public CheckResult check​(Principal principal,
                                 Resource resource,
                                 java.lang.String... actions)
        Check whether the principal is allowed to perform the actions on the given resource.
        Parameters:
        principal - Principal performing the action
        resource - Resource being accessed
        actions - List of actions being performed on the resource
        Returns:
        Map keyed by action and a corresponding boolean to indicate whether it is allowed or not.
        Throws:
        CerbosException - if an RPC error occurs
      • plan

        public PlanResourcesResult plan​(Principal principal,
                                        Resource resource,
                                        java.lang.String action)
        Obtain a query plan for performing the given action on the given resource kind.
        Parameters:
        principal - Principal performing the action on the resource kind.
        resource - Resource kind.
        action - Action to generate the plan for.
        Returns:
        Instance of PlanResourcesResult
        Throws:
        CerbosException - if the RPC fails.