IF Commons GitHub

sql/extensions/operations/identity/expr

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0041-identity-authorize FR-004

The expression language of attribute-based policies (commons data 0041-identity-authorize): a small closed tree written as JSON, with no code in it, that reads attributes by their keys and answers true, false or unknown. An attribute that is not known makes what reads it unknown, and what is unknown never allows.

Source: commons/data/sql/extensions/operations/identity/expr.ts

2 of 3 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

checkExprfunction
function checkExpr(e: unknown, path?: string): string | undefined

Why a value is not an expression, or nothing.

Imported by 13 tests of the run (13 passed, 0 failed): the library's results

evaluatefunction
function evaluate(e: Expr, attrs: Readonly<Record<string, unknown>>): Truth

Evaluates an expression.

ParameterWhat it is
ethe expression
attrsthe attributes that are known, by key

Returns: true, false, or unknown

Imported by 13 tests of the run (13 passed, 0 failed): the library's results

Truthtypeno test imports it
type Truth = boolean | undefined;

What an expression says: true, false, or unknown (undefined).

Titles, headings, exports, tables, columns and requirements. Esc closes.