evaluate
is used to evaluate the policy at the specified path with optional input.
The path to the policy, without /v1/data
: use authz/allow
to evaluate policy data.authz.allow
.
Optional
input: InThe input to the policy, if needed.
Optional
opts: RequestOptions<Res>Per-request options to control how the policy evaluation result is to be transformed
into Res
(via fromResult
), and low-level fetch options.
evaluateBatch
is used to evaluate the policy at the specified path, for a batch of many inputs.
The path to the policy, without /v1/batch/data
: use authz/allow
to evaluate policy data.authz.allow
.
The inputs to the policy.
Optional
opts: BatchRequestOptions<Res>Per-request options to control how the policy evaluation result is to be transformed
into Res
(via fromResult
), if any failures in the batch result should reject the promose (via
rejectMixed
), and low-level fetch options.
evaluateDefault
is used to evaluate the server's default policy with optional input.
Optional
input: InThe input to the default policy, defaults to {}
.
Optional
opts: RequestOptions<Res>Per-request options to control how the policy evaluation result is to be transformed
into Res
(via fromResult
), and low-level fetch options.
Optional
opts: BatchRequestOptions<Res>
OPAClient is the starting point for using the high-level API.
Use OpaApiClient if you need some low-level customization.