Documentation
¶
Index ¶
Constants ¶
View Source
const ( ERR_CODE_BUILD_MANAGER_FAILURE = "OPA_BUILD_MANAGER_FAILURE" ERR_CODE_BUILD_DISCOVERY_FAILURE = "OPA_BUILD_DISCOVERY_FAILURE" ERR_CODE_START_MANAGER_FAILURE = "OPA_START_MANAGER_FAILURE" ERR_CODE_BUILD_REGO_OBJECT_FAILURE = "OPA_BUILD_REGO_FAILURE" ERR_CODE_EVAL_REGO_FAILURE = "OPA_EVAL_REGO_FAILURE" ERR_CODE_NO_DECISION = "OPA_NO_DECISION" ERR_CODE_NON_BOOLEAN_DECISION = "OPA_NON_BOOLEAN_DECISION" )
Variables ¶
View Source
var ( ErrNoDecision = errors.New("Undefined decision").WithCode(ERR_CODE_NO_DECISION) ErrNonBooleanDecision errors.CustomError = errors.New("Non-boolean decision").WithCode(ERR_CODE_NON_BOOLEAN_DECISION) )
Functions ¶
This section is empty.
Types ¶
type AuthorizationResult ¶
type AuthorizationResult []map[string]interface{}
AuthorizationResult ...
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an OPA authorization client
func MustNewClient ¶
MustNewClient creates a new Client object. It panics if any error is found.
func (Client) DecideIfAllowed ¶
func (c Client) DecideIfAllowed(ctx context.Context, regoQuery, method, path, brandID, userID string) (bool, error)
DecideIfAllowed indicates if the given user is allowed to perform the given action
func (Client) ExecuteQuery ¶
func (c Client) ExecuteQuery(ctx context.Context, query string, input map[string]interface{}) (AuthorizationResult, error)
ExecuteQuery ...
Click to show internal directories.
Click to hide internal directories.