Skip to content

Latest commit

 

History

History
193 lines (85 loc) · 3.27 KB

embedded.options.md

File metadata and controls

193 lines (85 loc) · 3.27 KB

Home > @cerbos/embedded > Options

Options interface

Options for creating a new Embedded client or Loader.

Signature:

export interface Options extends Pick<CoreOptions, "headers" | "userAgent"> 

Extends: Pick<CoreOptions, "headers" | "userAgent">

Properties

Property

Modifiers

Type

Description

decodeJWTPayload?

DecodeJWTPayload | undefined

(Optional) A function to verify and decode JWTs passed as auxiliary data, returning the JWT payload.

defaultPolicyVersion?

string | undefined

(Optional) Default policy version to apply to requests that do not specify one.

globals?

Record<string, Value> | undefined

(Optional) Global variables to pass environment-specific information to policy conditions.

lenientScopeSearch?

boolean | undefined

(Optional) Enable lenient scope search?

By default, when a request specifies a scope of a.b.c then a policy must exist with that exact scope. If lenient scope search is enabled, then the policy decision point will fall back to trying scopes a.b, a, and "" if a policy with scope a.b.c does not exist.

now?

(() => Date | number) | undefined

(Optional) A function returning the current time, to be used when evaluating policy conditions.

onDecision?

((entry: DecisionLogEntry) => void | Promise<void>) | undefined

(Optional) A callback to invoke when a decision is made by the embedded policy decision point.

onError?

((error: LoadError) => void | Promise<void>) | undefined

(Optional) A callback to invoke when the embedded policy decision point bundle has failed to load.

onLoad?

((metadata: BundleMetadata) => void | Promise<void>) | undefined

(Optional) A callback to invoke when the embedded policy decision point bundle has been loaded.