Function: createRowFilterCompiler()
createRowFilterCompiler(
args):object
Defined in: compileRowFilter.ts:251
Compiles policy sets into the filter of the rows of list they allow action on.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | { conditions: { bindVariables: (args) => PolicyDocument; evaluateCondition: (args) => boolean; isActionConditionKey: (key) => boolean; isPlatformConditionKey: (key) => boolean; namespace: string; namesRequestTag: (args) => boolean; requestTagKey: (tag) => string; requestTagKeyPrefix: string; resourceTagKey: (tag) => string; resourceTagKeyPrefix: string; resourceTypeKey: string; unknownVariables: (value) => string[]; variables: string[]; }; evaluator: { chainMatches: (check) => boolean; decideOnChain: (check) => PolicyDecision; ownerRoot: (owner) => string | null; withinReach: (check) => boolean; }; names: { ancestors: (value) => string[]; buildName: (args) => string; buildPathAlias: (args) => string; isPathAliasPattern: (args) => boolean; leafType: (parsed) => string; matchPattern: (args) => boolean; parseName: (value) => NameResult<ParsedName>; pathAliasRootType: string | undefined; patternCovers: (args) => boolean; patternError: (pattern) => string | null; patternKinds: (pattern) => SegmentKind[]; patternRegex: (args) => string; patternsOverlap: (args) => boolean; patternTypes: (pattern) => string[]; prefix: string; splitPattern: (pattern) => string[]; }; } | - |
args.conditions | { bindVariables: (args) => PolicyDocument; evaluateCondition: (args) => boolean; isActionConditionKey: (key) => boolean; isPlatformConditionKey: (key) => boolean; namespace: string; namesRequestTag: (args) => boolean; requestTagKey: (tag) => string; requestTagKeyPrefix: string; resourceTagKey: (tag) => string; resourceTagKeyPrefix: string; resourceTypeKey: string; unknownVariables: (value) => string[]; variables: string[]; } | - |
args.conditions.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. |
args.conditions.evaluateCondition | (args) => boolean | - |
args.conditions.isActionConditionKey | (key) => boolean | Whether key is an action key (tasks:Transition): one only the actions declaring it supply, unlike the namespace's own family. |
args.conditions.isPlatformConditionKey | (key) => boolean | Whether key is one the namespace supplies to every check that has it. |
args.conditions.namespace | string | - |
args.conditions.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. |
args.conditions.requestTagKey | (tag) => string | - |
args.conditions.requestTagKeyPrefix | string | Followed by a tag name: the value the request writes for that tag. |
args.conditions.resourceTagKey | (tag) => string | - |
args.conditions.resourceTagKeyPrefix | string | Followed by a tag name, verbatim. |
args.conditions.resourceTypeKey | string | - |
args.conditions.unknownVariables | (value) => string[] | The variables value names that the namespace does not supply. |
args.conditions.variables | string[] | - |
args.evaluator | { chainMatches: (check) => boolean; decideOnChain: (check) => PolicyDecision; ownerRoot: (owner) => string | null; withinReach: (check) => boolean; } | - |
args.evaluator.chainMatches | (check) => boolean | True when pattern reaches the resource for action. |
args.evaluator.decideOnChain | (check) => PolicyDecision | Every tagged node's evaluation must allow; the first refusal decides. A path alias names a place, not a type, so a chain named by one alone states its type or is refused. |
args.evaluator.ownerRoot | (owner) => string | null | The name an owner's reach is rooted at; null for top, which reaches everything. |
args.evaluator.withinReach | (check) => boolean | True when the resource sits within the owner's reach for action. |
args.names | { ancestors: (value) => string[]; buildName: (args) => string; buildPathAlias: (args) => string; isPathAliasPattern: (args) => boolean; leafType: (parsed) => string; matchPattern: (args) => boolean; parseName: (value) => NameResult<ParsedName>; pathAliasRootType: string | undefined; patternCovers: (args) => boolean; patternError: (pattern) => string | null; patternKinds: (pattern) => SegmentKind[]; patternRegex: (args) => string; patternsOverlap: (args) => boolean; patternTypes: (pattern) => string[]; prefix: string; splitPattern: (pattern) => string[]; } | - |
args.names.ancestors | (value) => string[] | Every ancestor node of a name, itself first, the root last. |
args.names.buildName | (args) => string | Builds a name from its containment chain, root first. |
args.names.buildPathAlias | (args) => string | Builds a path alias from raw (unencoded) path segments. |
args.names.isPathAliasPattern | (args) => boolean | Whether pattern names path aliases: it names the path node. |
args.names.leafType | (parsed) => string | The leaf's type: the last step's, path for an alias. |
args.names.matchPattern | (args) => boolean | True when pattern matches name or any of its ancestors. |
args.names.parseName | (value) => NameResult<ParsedName> | Parses a name or a path alias; never a pattern. |
args.names.pathAliasRootType | string | undefined | - |
args.names.patternCovers | (args) => boolean | True when every name inner reaches, outer reaches. Sound: true is never wrong. |
args.names.patternError | (pattern) => string | null | Validates a resource pattern; null when it is well formed. |
args.names.patternKinds | (pattern) => SegmentKind[] | The kind of each segment of a well-formed pattern, aligned with splitPattern. |
args.names.patternRegex | (args) => string | The regular expression matching exactly the names matchPattern says pattern reaches, for a store that filters rows by it; JavaScript and PostgreSQL (~) read it alike. |
args.names.patternsOverlap | (args) => boolean | True when some name is reached by both patterns. |
args.names.patternTypes | (pattern) => string[] | The types a well-formed pattern names literally, for a registry to check. |
args.names.prefix | string | - |
args.names.splitPattern | (pattern) => string[] | A well-formed pattern's segments, ** among them. |
Returns
object
compileRowFilter
compileRowFilter: (
check) =>RowFilter
Parameters
| Parameter | Type |
|---|---|
check | { action: string; list: ListedRows; policies: PolicySets; } |
check.action | string |
check.list | ListedRows |
check.policies | PolicySets |