Skip to main content

Function: createConditions()

createConditions(config): object

Defined in: conditions.ts:212

The condition keys, variables and evaluation of one namespace.

Parameters​

ParameterType
configConditionsConfig

Returns​

bindVariables​

bindVariables: (args) => PolicyDocument

document with each ${variable} of values replaced; a null or absent value leaves it unbound, so a Deny naming it applies and an Allow grants nothing.

Parameters​

ParameterType
args{ document: PolicyDocument; values: Record<string, string | null | undefined>; }
args.documentPolicyDocument
args.valuesRecord<string, string | null | undefined>

Returns​

PolicyDocument

evaluateCondition​

evaluateCondition: (args) => boolean

Parameters​

ParameterTypeDescription
args{ condition: Condition; context: Record<string, string>; effect: Effect; }-
args.conditionCondition-
args.contextRecord<string, string>-
args.effectEffectThe statement's effect, which decides a condition on an absent key.

Returns​

boolean

isActionConditionKey​

isActionConditionKey: (key) => boolean

Whether key is an action key (tasks:Transition): one only the actions declaring it supply, unlike the namespace's own family.

Parameters​

ParameterType
keystring

Returns​

boolean

isPlatformConditionKey​

isPlatformConditionKey: (key) => boolean

Whether key is one the namespace supplies to every check that has it.

Parameters​

ParameterType
keystring

Returns​

boolean

namespace​

namespace: string

namesRequestTag​

namesRequestTag: (args) => boolean

Whether a statement in sets conditions on a request tag for one of keys: asked before authorizing a write whose value for such a key is not known yet, which no evaluation can answer.

Parameters​

ParameterType
args{ keys: readonly string[]; sets: PolicySets; }
args.keysreadonly string[]
args.setsPolicySets

Returns​

boolean

requestTagKey​

requestTagKey: (tag) => string

Parameters​

ParameterType
tagstring

Returns​

string

requestTagKeyPrefix​

requestTagKeyPrefix: string

Followed by a tag name: the value the request writes for that tag.

resourceTagKey​

resourceTagKey: (tag) => string

Parameters​

ParameterType
tagstring

Returns​

string

resourceTagKeyPrefix​

resourceTagKeyPrefix: string

Followed by a tag name, verbatim.

resourceTypeKey​

resourceTypeKey: string

unknownVariables​

unknownVariables: (value) => string[]

The variables value names that the namespace does not supply.

Parameters​

ParameterType
valuestring

Returns​

string[]

variables​

variables: string[]