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>getFilters
is used to translate the policy at the specified path into query filters of
the desired target type, with optional input.
Returns a promise that resolves to an object containing the query filters (key query
) and optional masks (key masks
).
The path to the policy, without /v1/compile
: use filters/include
to translate the policy data.filters.include
.
Optional
input: InThe input to the policy, if needed.
Optional
opts: string | FiltersRequestOptions & Partial<TargetOptions>Per-request options to control how the policy is translated into query filters, and low-level fetch options.
getMultipleFilters
is used to translate the policy at the specified path into query filters of
the multiple target types in one request, with optional input.
Returns a promise that resolves to an object containing the query filters (key query
) and optional masks (key masks
) for each requested target.
The path to the policy, without /v1/compile
: use filters/include
to translate the policy data.filters.include
.
Optional
input: InThe input to the policy, if needed.
Optional
opts: MultipleFiltersRequestOptionsPer-request options to control how the policy is translated into query filters, and low-level fetch options.
OPAClient is the starting point for using the high-level API.
Use OpaApiClient if you need some low-level customization.