@kensio/yulin 1.21.13 → 1.21.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/service/dynamodb/command/authorize/sim-dynamodb-attributes.d.ts +27 -0
- package/dist/service/dynamodb/command/authorize/sim-dynamodb-attributes.js +35 -0
- package/dist/service/dynamodb/command/authorize/sim-dynamodb-authorizer.d.ts +2 -1
- package/dist/service/dynamodb/command/authorize/sim-dynamodb-authorizer.js +5 -18
- package/dist/service/dynamodb/command/authorize/sim-dynamodb-reached.d.ts +17 -0
- package/dist/service/dynamodb/command/authorize/sim-dynamodb-reached.js +11 -0
- package/dist/service/dynamodb/command/batch/sim-dynamodb-batch-get-item.js +4 -1
- package/dist/service/dynamodb/command/batch/sim-dynamodb-batch-read-limit.d.ts +6 -0
- package/dist/service/dynamodb/command/batch/sim-dynamodb-batch-read-limit.js +16 -0
- package/dist/service/dynamodb/command/batch/sim-dynamodb-batch-reads.d.ts +2 -0
- package/dist/service/dynamodb/command/batch/sim-dynamodb-batch-reads.js +14 -22
- package/dist/service/dynamodb/command/batch/sim-dynamodb-batch-tables.d.ts +5 -5
- package/dist/service/dynamodb/command/batch/sim-dynamodb-batch-tables.js +1 -1
- package/dist/service/dynamodb/command/batch/sim-dynamodb-batch-write-item.js +5 -1
- package/dist/service/dynamodb/command/item/sim-dynamodb-condition-check.d.ts +5 -1
- package/dist/service/dynamodb/command/item/sim-dynamodb-condition-check.js +9 -2
- package/dist/service/dynamodb/command/item/sim-dynamodb-delete-item.js +7 -1
- package/dist/service/dynamodb/command/item/sim-dynamodb-get-item.js +9 -2
- package/dist/service/dynamodb/command/item/sim-dynamodb-put-item.js +5 -1
- package/dist/service/dynamodb/command/item/sim-dynamodb-update-expressions.d.ts +2 -0
- package/dist/service/dynamodb/command/item/sim-dynamodb-update-expressions.js +1 -1
- package/dist/service/dynamodb/command/item/sim-dynamodb-update-item.js +7 -1
- package/dist/service/dynamodb/command/item/sim-dynamodb-update-plan.d.ts +8 -6
- package/dist/service/dynamodb/command/item/sim-dynamodb-update-plan.js +14 -13
- package/dist/service/dynamodb/command/item/sim-dynamodb-update-touched.d.ts +10 -0
- package/dist/service/dynamodb/command/item/sim-dynamodb-update-touched.js +16 -0
- package/dist/service/dynamodb/command/query/sim-dynamodb-query-expressions.d.ts +2 -0
- package/dist/service/dynamodb/command/query/sim-dynamodb-query-expressions.js +6 -1
- package/dist/service/dynamodb/command/query/sim-dynamodb-query.js +5 -2
- package/dist/service/dynamodb/command/scan/sim-dynamodb-scan-expressions.d.ts +2 -0
- package/dist/service/dynamodb/command/scan/sim-dynamodb-scan-expressions.js +2 -2
- package/dist/service/dynamodb/command/scan/sim-dynamodb-scan.js +1 -1
- package/dist/service/dynamodb/command/table/sim-dynamodb-table-access.d.ts +3 -3
- package/dist/service/dynamodb/command/table/sim-dynamodb-table-access.js +5 -21
- package/dist/service/dynamodb/command/table/sim-dynamodb-table-reach.d.ts +25 -0
- package/dist/service/dynamodb/command/table/sim-dynamodb-table-reach.js +27 -0
- package/dist/service/dynamodb/command/transact/sim-dynamodb-transact-gets.js +1 -1
- package/dist/service/dynamodb/expression/condition/sim-dynamodb-condition-expression.d.ts +9 -1
- package/dist/service/dynamodb/expression/condition/sim-dynamodb-condition-expression.js +2 -2
- package/dist/service/dynamodb/expression/condition/sim-dynamodb-condition-grammar.js +1 -1
- package/dist/service/dynamodb/expression/condition/sim-dynamodb-condition-operand-parser.d.ts +3 -2
- package/dist/service/dynamodb/expression/condition/sim-dynamodb-condition-operand-parser.js +3 -3
- package/dist/service/dynamodb/expression/condition/sim-dynamodb-condition-parser.d.ts +2 -1
- package/dist/service/dynamodb/expression/condition/sim-dynamodb-condition-parser.js +1 -1
- package/dist/service/dynamodb/expression/key-condition/sim-dynamodb-key-condition-expression.js +1 -1
- package/dist/service/dynamodb/expression/key-condition/sim-dynamodb-key-condition-operands.d.ts +3 -2
- package/dist/service/dynamodb/expression/key-condition/sim-dynamodb-key-condition-operands.js +8 -6
- package/dist/service/dynamodb/expression/key-condition/sim-dynamodb-key-condition-parser.d.ts +2 -1
- package/dist/service/dynamodb/expression/key-condition/sim-dynamodb-key-condition-parser.js +1 -1
- package/dist/service/dynamodb/expression/projection/sim-dynamodb-projection-expression.d.ts +9 -1
- package/dist/service/dynamodb/expression/projection/sim-dynamodb-projection-expression.js +5 -5
- package/dist/service/dynamodb/expression/sim-dynamodb-document-path-parser.d.ts +3 -3
- package/dist/service/dynamodb/expression/sim-dynamodb-document-path-parser.js +8 -4
- package/dist/service/dynamodb/expression/sim-dynamodb-expression-attributes.d.ts +33 -0
- package/dist/service/dynamodb/expression/sim-dynamodb-expression-attributes.js +40 -0
- package/dist/service/dynamodb/expression/sim-dynamodb-expression-parameters.d.ts +6 -0
- package/dist/service/dynamodb/expression/sim-dynamodb-expression-parameters.js +7 -0
- package/dist/service/dynamodb/expression/update/sim-dynamodb-update-clause.d.ts +3 -3
- package/dist/service/dynamodb/expression/update/sim-dynamodb-update-clause.js +3 -3
- package/dist/service/dynamodb/expression/update/sim-dynamodb-update-expression.js +1 -1
- package/dist/service/dynamodb/expression/update/sim-dynamodb-update-operand-parser.d.ts +3 -2
- package/dist/service/dynamodb/expression/update/sim-dynamodb-update-operand-parser.js +3 -3
- package/dist/service/dynamodb/expression/update/sim-dynamodb-update-parser.d.ts +2 -1
- package/dist/service/iam/authorize/match/condition/negated/sim-iam-negated-for-all-values-string-operator.d.ts +4 -1
- package/dist/service/iam/authorize/match/condition/negated/sim-iam-negated-for-all-values-string-operator.js +6 -1
- package/dist/service/iam/authorize/match/condition/negated/sim-iam-negated-for-any-value-string-operator.d.ts +4 -1
- package/dist/service/iam/authorize/match/condition/negated/sim-iam-negated-for-any-value-string-operator.js +6 -1
- package/dist/service/iam/authorize/match/condition/negated/sim-iam-negated-scalar-string-operator.d.ts +4 -1
- package/dist/service/iam/authorize/match/condition/negated/sim-iam-negated-scalar-string-operator.js +6 -1
- package/dist/service/iam/authorize/match/condition/null/sim-iam-null.d.ts +23 -0
- package/dist/service/iam/authorize/match/condition/null/sim-iam-null.js +59 -0
- package/dist/service/iam/authorize/match/condition/numeric/less-than-equals/sim-iam-number-lte.d.ts +4 -1
- package/dist/service/iam/authorize/match/condition/numeric/less-than-equals/sim-iam-number-lte.js +6 -1
- package/dist/service/iam/authorize/match/condition/sim-iam-condition-operator-parser.js +2 -0
- package/dist/service/iam/authorize/match/condition/sim-iam-condition-operator.d.ts +5 -1
- package/dist/service/iam/authorize/match/condition/sim-iam-policy-condition-matcher.js +1 -1
- package/dist/service/iam/authorize/match/condition/string/all-values/sim-iam-for-all-values-string-condition-operator.d.ts +4 -1
- package/dist/service/iam/authorize/match/condition/string/all-values/sim-iam-for-all-values-string-condition-operator.js +6 -1
- package/dist/service/iam/authorize/match/condition/string/any-value/sim-iam-for-any-value-string-condition-operator.d.ts +4 -1
- package/dist/service/iam/authorize/match/condition/string/any-value/sim-iam-for-any-value-string-condition-operator.js +6 -1
- package/dist/service/iam/authorize/match/condition/string/sim-iam-scalar-string-condition-operator.d.ts +4 -1
- package/dist/service/iam/authorize/match/condition/string/sim-iam-scalar-string-condition-operator.js +6 -1
- package/dist/util/background/background-clock-waits.d.ts +10 -3
- package/dist/util/background/background-clock-waits.js +11 -4
- package/dist/util/background/background-pending-tasks.d.ts +15 -9
- package/dist/util/background/background-pending-tasks.js +18 -12
- package/dist/util/background/background.d.ts +11 -3
- package/dist/util/background/background.js +14 -4
- package/dist/util/background/non-deterministic-background.d.ts +4 -0
- package/dist/util/background/non-deterministic-background.js +5 -1
- package/dist/util/clock/sim-clock.d.ts +16 -0
- package/dist/util/clock/sim-clock.js +4 -0
- package/dist/util/clock/sim-controllable-clock.d.ts +11 -0
- package/dist/util/clock/sim-controllable-clock.js +13 -0
- package/docs/services/dynamodb/README.md +23 -4
- package/docs/services/iam/README.md +17 -3
- package/docs/services/lambda/README.md +11 -0
- package/docs/time/README.md +7 -0
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SimDynamoDbExpressionAttributes } from "../sim-dynamodb-expression-attributes.js";
|
|
2
2
|
import type { SimDynamoDbExpressionTokens } from "../sim-dynamodb-expression-tokens.js";
|
|
3
3
|
import { SimDynamoDbUpdateTarget } from "./sim-dynamodb-update-target.js";
|
|
4
4
|
interface SimDynamoDbUpdateClausesProperties {
|
|
5
5
|
readonly tokens: SimDynamoDbExpressionTokens;
|
|
6
|
-
readonly
|
|
6
|
+
readonly attributes: SimDynamoDbExpressionAttributes;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* The clauses of an update expression, and the paths their actions write to.
|
|
@@ -14,7 +14,7 @@ interface SimDynamoDbUpdateClausesProperties {
|
|
|
14
14
|
*/
|
|
15
15
|
export declare class SimDynamoDbUpdateClauses {
|
|
16
16
|
private readonly tokens;
|
|
17
|
-
private readonly
|
|
17
|
+
private readonly attributes;
|
|
18
18
|
private readonly read;
|
|
19
19
|
constructor(properties: SimDynamoDbUpdateClausesProperties);
|
|
20
20
|
/**
|
|
@@ -19,11 +19,11 @@ const clauseWords = new Set([
|
|
|
19
19
|
*/
|
|
20
20
|
export class SimDynamoDbUpdateClauses {
|
|
21
21
|
tokens;
|
|
22
|
-
|
|
22
|
+
attributes;
|
|
23
23
|
read = new Set();
|
|
24
24
|
constructor(properties) {
|
|
25
25
|
this.tokens = properties.tokens;
|
|
26
|
-
this.
|
|
26
|
+
this.attributes = properties.attributes;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Read the keyword the next clause starts with, refusing one already used.
|
|
@@ -47,7 +47,7 @@ export class SimDynamoDbUpdateClauses {
|
|
|
47
47
|
target() {
|
|
48
48
|
return new SimDynamoDbUpdateTarget(new SimDynamoDbDocumentPathParser({
|
|
49
49
|
tokens: this.tokens,
|
|
50
|
-
|
|
50
|
+
attributes: this.attributes,
|
|
51
51
|
}).parse());
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
@@ -13,7 +13,7 @@ import { SimDynamoDbUpdateParser } from "./sim-dynamodb-update-parser.js";
|
|
|
13
13
|
export function parseSimDynamoDbUpdate(expression, parameters) {
|
|
14
14
|
return new SimDynamoDbUpdateParser({
|
|
15
15
|
tokens: SimDynamoDbExpressionTokens.of(updateExpressionName, expression, "the expression says nothing, and an expression cannot be empty"),
|
|
16
|
-
|
|
16
|
+
attributes: parameters.attributes,
|
|
17
17
|
values: parameters.values,
|
|
18
18
|
}).parse();
|
|
19
19
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { SimDynamoDbValue } from "../../item/sim-dynamodb-value.js";
|
|
2
|
+
import type { SimDynamoDbExpressionAttributes } from "../sim-dynamodb-expression-attributes.js";
|
|
2
3
|
import type { SimDynamoDbExpressionPlaceholders } from "../sim-dynamodb-expression-placeholders.js";
|
|
3
4
|
import type { SimDynamoDbExpressionTokens } from "../sim-dynamodb-expression-tokens.js";
|
|
4
5
|
import { type SimDynamoDbUpdateOperand, SimDynamoDbUpdatePathOperand, SimDynamoDbUpdateValueOperand } from "./sim-dynamodb-update-operand.js";
|
|
5
6
|
interface SimDynamoDbUpdateOperandParserProperties {
|
|
6
7
|
readonly tokens: SimDynamoDbExpressionTokens;
|
|
7
|
-
readonly
|
|
8
|
+
readonly attributes: SimDynamoDbExpressionAttributes;
|
|
8
9
|
readonly values: SimDynamoDbExpressionPlaceholders<SimDynamoDbValue>;
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
@@ -20,7 +21,7 @@ interface SimDynamoDbUpdateOperandParserProperties {
|
|
|
20
21
|
*/
|
|
21
22
|
export declare class SimDynamoDbUpdateOperandParser {
|
|
22
23
|
private readonly tokens;
|
|
23
|
-
private readonly
|
|
24
|
+
private readonly attributes;
|
|
24
25
|
private readonly values;
|
|
25
26
|
private readonly functions;
|
|
26
27
|
constructor(properties: SimDynamoDbUpdateOperandParserProperties);
|
|
@@ -20,12 +20,12 @@ const operators = new Set(["+", "-"]);
|
|
|
20
20
|
*/
|
|
21
21
|
export class SimDynamoDbUpdateOperandParser {
|
|
22
22
|
tokens;
|
|
23
|
-
|
|
23
|
+
attributes;
|
|
24
24
|
values;
|
|
25
25
|
functions;
|
|
26
26
|
constructor(properties) {
|
|
27
27
|
this.tokens = properties.tokens;
|
|
28
|
-
this.
|
|
28
|
+
this.attributes = properties.attributes;
|
|
29
29
|
this.values = properties.values;
|
|
30
30
|
this.functions = new SimDynamoDbUpdateFunctionParser({
|
|
31
31
|
tokens: properties.tokens,
|
|
@@ -80,7 +80,7 @@ export class SimDynamoDbUpdateOperandParser {
|
|
|
80
80
|
path() {
|
|
81
81
|
return new SimDynamoDbUpdatePathOperand(new SimDynamoDbDocumentPathParser({
|
|
82
82
|
tokens: this.tokens,
|
|
83
|
-
|
|
83
|
+
attributes: this.attributes,
|
|
84
84
|
}).parse());
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { SimDynamoDbValue } from "../../item/sim-dynamodb-value.js";
|
|
2
|
+
import type { SimDynamoDbExpressionAttributes } from "../sim-dynamodb-expression-attributes.js";
|
|
2
3
|
import type { SimDynamoDbExpressionPlaceholders } from "../sim-dynamodb-expression-placeholders.js";
|
|
3
4
|
import type { SimDynamoDbExpressionTokens } from "../sim-dynamodb-expression-tokens.js";
|
|
4
5
|
import { SimDynamoDbUpdate } from "./sim-dynamodb-update.js";
|
|
5
6
|
interface SimDynamoDbUpdateParserProperties {
|
|
6
7
|
readonly tokens: SimDynamoDbExpressionTokens;
|
|
7
|
-
readonly
|
|
8
|
+
readonly attributes: SimDynamoDbExpressionAttributes;
|
|
8
9
|
readonly values: SimDynamoDbExpressionPlaceholders<SimDynamoDbValue>;
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
@@ -11,8 +11,11 @@ import type { SimIamStringComparison } from "../sim-iam-string-comparison.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export declare class SimIamNegatedForAllValuesStringOperator implements SimIamConditionOperator {
|
|
13
13
|
private readonly comparison;
|
|
14
|
-
readonly matchesAbsentKey = true;
|
|
15
14
|
constructor(comparison: SimIamStringComparison);
|
|
15
|
+
/**
|
|
16
|
+
* Answer for a request carrying no value for the key.
|
|
17
|
+
*/
|
|
18
|
+
matchesAbsentKey(): boolean;
|
|
16
19
|
/**
|
|
17
20
|
* Check whether every request value differs from every policy value.
|
|
18
21
|
*/
|
|
@@ -9,10 +9,15 @@ import { simIamStringValues } from "../string/sim-iam-string-values.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export class SimIamNegatedForAllValuesStringOperator {
|
|
11
11
|
comparison;
|
|
12
|
-
matchesAbsentKey = true;
|
|
13
12
|
constructor(comparison) {
|
|
14
13
|
this.comparison = comparison;
|
|
15
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Answer for a request carrying no value for the key.
|
|
17
|
+
*/
|
|
18
|
+
matchesAbsentKey() {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
16
21
|
/**
|
|
17
22
|
* Check whether every request value differs from every policy value.
|
|
18
23
|
*/
|
|
@@ -12,8 +12,11 @@ import type { SimIamStringComparison } from "../sim-iam-string-comparison.js";
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class SimIamNegatedForAnyValueStringOperator implements SimIamConditionOperator {
|
|
14
14
|
private readonly comparison;
|
|
15
|
-
readonly matchesAbsentKey = false;
|
|
16
15
|
constructor(comparison: SimIamStringComparison);
|
|
16
|
+
/**
|
|
17
|
+
* Answer for a request carrying no value for the key.
|
|
18
|
+
*/
|
|
19
|
+
matchesAbsentKey(): boolean;
|
|
17
20
|
/**
|
|
18
21
|
* Check whether any request value differs from every policy value.
|
|
19
22
|
*/
|
|
@@ -10,10 +10,15 @@ import { simIamStringValues } from "../string/sim-iam-string-values.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export class SimIamNegatedForAnyValueStringOperator {
|
|
12
12
|
comparison;
|
|
13
|
-
matchesAbsentKey = false;
|
|
14
13
|
constructor(comparison) {
|
|
15
14
|
this.comparison = comparison;
|
|
16
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Answer for a request carrying no value for the key.
|
|
18
|
+
*/
|
|
19
|
+
matchesAbsentKey() {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
17
22
|
/**
|
|
18
23
|
* Check whether any request value differs from every policy value.
|
|
19
24
|
*/
|
|
@@ -11,8 +11,11 @@ import type { SimIamStringComparison } from "../sim-iam-string-comparison.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export declare class SimIamNegatedScalarStringOperator implements SimIamConditionOperator {
|
|
13
13
|
private readonly comparison;
|
|
14
|
-
readonly matchesAbsentKey = true;
|
|
15
14
|
constructor(comparison: SimIamStringComparison);
|
|
15
|
+
/**
|
|
16
|
+
* Answer for a request carrying no value for the key.
|
|
17
|
+
*/
|
|
18
|
+
matchesAbsentKey(): boolean;
|
|
16
19
|
/**
|
|
17
20
|
* Check whether a request value differs from every policy value.
|
|
18
21
|
*/
|
package/dist/service/iam/authorize/match/condition/negated/sim-iam-negated-scalar-string-operator.js
CHANGED
|
@@ -9,10 +9,15 @@ import { simIamStringValues } from "../string/sim-iam-string-values.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export class SimIamNegatedScalarStringOperator {
|
|
11
11
|
comparison;
|
|
12
|
-
matchesAbsentKey = true;
|
|
13
12
|
constructor(comparison) {
|
|
14
13
|
this.comparison = comparison;
|
|
15
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Answer for a request carrying no value for the key.
|
|
17
|
+
*/
|
|
18
|
+
matchesAbsentKey() {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
16
21
|
/**
|
|
17
22
|
* Check whether a request value differs from every policy value.
|
|
18
23
|
*/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SimIamConditionValue } from "../../../../policy/sim-iam-policy.js";
|
|
2
|
+
import type { SimIamConditionOperator } from "../sim-iam-condition-operator.js";
|
|
3
|
+
/**
|
|
4
|
+
* IAM `Null` condition operator.
|
|
5
|
+
*
|
|
6
|
+
* `Null` checks whether the request carries a value for a context key, rather
|
|
7
|
+
* than comparing one. `"true"` matches where the key is absent and `"false"`
|
|
8
|
+
* where it is present. AWS names it and the `...IfExists` suffix as the two
|
|
9
|
+
* exceptions to the rule that an absent key fails a condition.
|
|
10
|
+
*
|
|
11
|
+
* It is what guards a `ForAllValues` `Allow`, which matches an absent key on
|
|
12
|
+
* its own. See `SimIamForAllValuesStringConditionOperator`.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SimIamNull implements SimIamConditionOperator {
|
|
15
|
+
/**
|
|
16
|
+
* Answer for a request carrying no value for the key.
|
|
17
|
+
*/
|
|
18
|
+
matchesAbsentKey(expected: SimIamConditionValue): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Answer for a request carrying a value for the key.
|
|
21
|
+
*/
|
|
22
|
+
matches(actual: SimIamConditionValue, expected: SimIamConditionValue): boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read the policy value of a `Null` condition.
|
|
3
|
+
*
|
|
4
|
+
* AWS documents `"true"` and `"false"` as strings, which is the form a policy
|
|
5
|
+
* document and the CDK both write. The condition value type also admits a JSON
|
|
6
|
+
* boolean, and a policy written that way means the same thing. Anything else
|
|
7
|
+
* has no meaning here and leaves the condition matching nothing.
|
|
8
|
+
*/
|
|
9
|
+
function expectsAbsentKey(expected) {
|
|
10
|
+
if (typeof expected === "boolean") {
|
|
11
|
+
return expected;
|
|
12
|
+
}
|
|
13
|
+
if (expected === "true") {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
return expected === "false" ? false : undefined;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Whether a request value counts as present for a `Null` check.
|
|
20
|
+
*
|
|
21
|
+
* AWS asks whether the key exists and its value is not null. A multi-valued key
|
|
22
|
+
* carrying no values resolves to a null dataset, and an empty string is the
|
|
23
|
+
* example AWS gives of one.
|
|
24
|
+
*/
|
|
25
|
+
function isPresent(actual) {
|
|
26
|
+
if (Array.isArray(actual)) {
|
|
27
|
+
return actual.length > 0;
|
|
28
|
+
}
|
|
29
|
+
return actual !== "";
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* IAM `Null` condition operator.
|
|
33
|
+
*
|
|
34
|
+
* `Null` checks whether the request carries a value for a context key, rather
|
|
35
|
+
* than comparing one. `"true"` matches where the key is absent and `"false"`
|
|
36
|
+
* where it is present. AWS names it and the `...IfExists` suffix as the two
|
|
37
|
+
* exceptions to the rule that an absent key fails a condition.
|
|
38
|
+
*
|
|
39
|
+
* It is what guards a `ForAllValues` `Allow`, which matches an absent key on
|
|
40
|
+
* its own. See `SimIamForAllValuesStringConditionOperator`.
|
|
41
|
+
*/
|
|
42
|
+
export class SimIamNull {
|
|
43
|
+
/**
|
|
44
|
+
* Answer for a request carrying no value for the key.
|
|
45
|
+
*/
|
|
46
|
+
matchesAbsentKey(expected) {
|
|
47
|
+
return expectsAbsentKey(expected) === true;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Answer for a request carrying a value for the key.
|
|
51
|
+
*/
|
|
52
|
+
matches(actual, expected) {
|
|
53
|
+
const absentExpected = expectsAbsentKey(expected);
|
|
54
|
+
if (absentExpected === undefined) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return absentExpected !== isPresent(actual);
|
|
58
|
+
}
|
|
59
|
+
}
|
package/dist/service/iam/authorize/match/condition/numeric/less-than-equals/sim-iam-number-lte.d.ts
CHANGED
|
@@ -15,7 +15,10 @@ import type { SimIamConditionOperator } from "../../sim-iam-condition-operator.j
|
|
|
15
15
|
* are rejected rather than being converted through JavaScript coercion rules.
|
|
16
16
|
*/
|
|
17
17
|
export declare class SimIamNumericLessThanEquals implements SimIamConditionOperator {
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Answer for a request carrying no value for the key.
|
|
20
|
+
*/
|
|
21
|
+
matchesAbsentKey(): boolean;
|
|
19
22
|
/**
|
|
20
23
|
* Compare one request value with one or more policy limits.
|
|
21
24
|
*/
|
package/dist/service/iam/authorize/match/condition/numeric/less-than-equals/sim-iam-number-lte.js
CHANGED
|
@@ -13,7 +13,12 @@
|
|
|
13
13
|
* are rejected rather than being converted through JavaScript coercion rules.
|
|
14
14
|
*/
|
|
15
15
|
export class SimIamNumericLessThanEquals {
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Answer for a request carrying no value for the key.
|
|
18
|
+
*/
|
|
19
|
+
matchesAbsentKey() {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
17
22
|
/**
|
|
18
23
|
* Compare one request value with one or more policy limits.
|
|
19
24
|
*/
|
|
@@ -8,6 +8,7 @@ import { SimIamStringLike } from "./string/like/sim-iam-string-like.js";
|
|
|
8
8
|
import { SimIamNumericLessThanEquals } from "./numeric/less-than-equals/sim-iam-number-lte.js";
|
|
9
9
|
import { SimIamArnEquals } from "./arn/equals/sim-iam-arn-equals.js";
|
|
10
10
|
import { SimIamArnLike } from "./arn/like/sim-iam-arn-like.js";
|
|
11
|
+
import { SimIamNull } from "./null/sim-iam-null.js";
|
|
11
12
|
const operatorFactories = new Map([
|
|
12
13
|
["ArnEquals", () => new SimIamArnEquals()],
|
|
13
14
|
["ArnLike", () => new SimIamArnLike()],
|
|
@@ -17,6 +18,7 @@ const operatorFactories = new Map([
|
|
|
17
18
|
],
|
|
18
19
|
["StringEquals", () => new SimIamStringEquals()],
|
|
19
20
|
["StringLike", () => new SimIamStringLike()],
|
|
21
|
+
["Null", () => new SimIamNull()],
|
|
20
22
|
[
|
|
21
23
|
"ForAnyValue:StringEquals",
|
|
22
24
|
() => new SimIamForAnyValueStringEquals(),
|
|
@@ -19,8 +19,12 @@ export interface SimIamConditionOperator {
|
|
|
19
19
|
* true, because every value the request carries matches vacuously. AWS
|
|
20
20
|
* documents all three rules, and warns that the `ForAllValues` rule leaves
|
|
21
21
|
* an `Allow` overly permissive without a `Null` guard beside it.
|
|
22
|
+
*
|
|
23
|
+
* The policy value is passed because `Null` reads it. Every comparison
|
|
24
|
+
* operator answers the same way whatever the policy says, and takes no
|
|
25
|
+
* argument.
|
|
22
26
|
*/
|
|
23
|
-
|
|
27
|
+
matchesAbsentKey(expected: SimIamConditionValue): boolean;
|
|
24
28
|
/**
|
|
25
29
|
* Determine whether an actual request value satisfies the expected policy value.
|
|
26
30
|
*/
|
|
@@ -59,7 +59,7 @@ export class SimIamPolicyConditionMatcher {
|
|
|
59
59
|
entryMatches(operator, key, expected) {
|
|
60
60
|
const actual = this.conditionContext.get(this.normalizeContextKey(key));
|
|
61
61
|
if (actual === undefined) {
|
|
62
|
-
return operator.matchesAbsentKey;
|
|
62
|
+
return operator.matchesAbsentKey(expected);
|
|
63
63
|
}
|
|
64
64
|
return operator.matches(actual, expected);
|
|
65
65
|
}
|
|
@@ -8,7 +8,10 @@ import type { SimIamConditionOperator } from "../../sim-iam-condition-operator.j
|
|
|
8
8
|
* guard beside it to stay tight.
|
|
9
9
|
*/
|
|
10
10
|
export declare abstract class SimIamForAllValuesStringConditionOperator implements SimIamConditionOperator {
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Answer for a request carrying no value for the key.
|
|
13
|
+
*/
|
|
14
|
+
matchesAbsentKey(): boolean;
|
|
12
15
|
/**
|
|
13
16
|
* Check whether a given value matches the expected value.
|
|
14
17
|
*/
|
|
@@ -7,7 +7,12 @@ import { simIamStringValues } from "../sim-iam-string-values.js";
|
|
|
7
7
|
* guard beside it to stay tight.
|
|
8
8
|
*/
|
|
9
9
|
export class SimIamForAllValuesStringConditionOperator {
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Answer for a request carrying no value for the key.
|
|
12
|
+
*/
|
|
13
|
+
matchesAbsentKey() {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
11
16
|
/**
|
|
12
17
|
* Check whether a given value matches the expected value.
|
|
13
18
|
*/
|
|
@@ -4,7 +4,10 @@ import type { SimIamConditionOperator } from "../../sim-iam-condition-operator.j
|
|
|
4
4
|
* Base for `ForAnyValue` IAM string operators.
|
|
5
5
|
*/
|
|
6
6
|
export declare abstract class SimIamForAnyValueStringConditionOperator implements SimIamConditionOperator {
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Answer for a request carrying no value for the key.
|
|
9
|
+
*/
|
|
10
|
+
matchesAbsentKey(): boolean;
|
|
8
11
|
/**
|
|
9
12
|
* Check whether a given value matches the expected value.
|
|
10
13
|
*/
|
|
@@ -3,7 +3,12 @@ import { simIamStringValues } from "../sim-iam-string-values.js";
|
|
|
3
3
|
* Base for `ForAnyValue` IAM string operators.
|
|
4
4
|
*/
|
|
5
5
|
export class SimIamForAnyValueStringConditionOperator {
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Answer for a request carrying no value for the key.
|
|
8
|
+
*/
|
|
9
|
+
matchesAbsentKey() {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
7
12
|
/**
|
|
8
13
|
* Check whether a given value matches the expected value.
|
|
9
14
|
*/
|
|
@@ -7,7 +7,10 @@ import type { SimIamConditionOperator } from "../sim-iam-condition-operator.js";
|
|
|
7
7
|
* scalar or an array, with multiple policy values using OR semantics.
|
|
8
8
|
*/
|
|
9
9
|
export declare abstract class SimIamScalarStringConditionOperator implements SimIamConditionOperator {
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Answer for a request carrying no value for the key.
|
|
12
|
+
*/
|
|
13
|
+
matchesAbsentKey(): boolean;
|
|
11
14
|
/**
|
|
12
15
|
* Check whether a given value matches the expected value.
|
|
13
16
|
*/
|
|
@@ -6,7 +6,12 @@ import { simIamStringValues } from "./sim-iam-string-values.js";
|
|
|
6
6
|
* scalar or an array, with multiple policy values using OR semantics.
|
|
7
7
|
*/
|
|
8
8
|
export class SimIamScalarStringConditionOperator {
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Answer for a request carrying no value for the key.
|
|
11
|
+
*/
|
|
12
|
+
matchesAbsentKey() {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
10
15
|
/**
|
|
11
16
|
* Check whether a given value matches the expected value.
|
|
12
17
|
*/
|
|
@@ -26,10 +26,17 @@ export declare class BackgroundClockWaits {
|
|
|
26
26
|
*/
|
|
27
27
|
around<T>(wait: BackgroundClockWait, work: () => Promise<T>): Promise<T>;
|
|
28
28
|
/**
|
|
29
|
-
* The work in a set that
|
|
30
|
-
*
|
|
29
|
+
* The work in a set that completion has anything to wait for.
|
|
30
|
+
*
|
|
31
|
+
* The work asking is always left out. Waiting for the invocation the asking
|
|
32
|
+
* code is part of would be waiting for itself.
|
|
33
|
+
*
|
|
34
|
+
* Work waiting on the clock is left out where simulated time stands still,
|
|
35
|
+
* since only a caller moving the clock brings the instant it waits for, and
|
|
36
|
+
* that caller is the one waiting here. A running clock reaches the instant on
|
|
37
|
+
* its own, and this waits for the work to get there.
|
|
31
38
|
*/
|
|
32
|
-
runnable(held: ReadonlyMap<Promise<unknown>, BackgroundClockWait
|
|
39
|
+
runnable(held: ReadonlyMap<Promise<unknown>, BackgroundClockWait>, clockIsRunning?: boolean): Promise<unknown>[];
|
|
33
40
|
/**
|
|
34
41
|
* Whether the code running now is already inside outstanding work, and so
|
|
35
42
|
* already counted.
|
|
@@ -23,14 +23,21 @@ export class BackgroundClockWaits {
|
|
|
23
23
|
return await this.storage.run(wait, work);
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
* The work in a set that
|
|
27
|
-
*
|
|
26
|
+
* The work in a set that completion has anything to wait for.
|
|
27
|
+
*
|
|
28
|
+
* The work asking is always left out. Waiting for the invocation the asking
|
|
29
|
+
* code is part of would be waiting for itself.
|
|
30
|
+
*
|
|
31
|
+
* Work waiting on the clock is left out where simulated time stands still,
|
|
32
|
+
* since only a caller moving the clock brings the instant it waits for, and
|
|
33
|
+
* that caller is the one waiting here. A running clock reaches the instant on
|
|
34
|
+
* its own, and this waits for the work to get there.
|
|
28
35
|
*/
|
|
29
|
-
runnable(held) {
|
|
36
|
+
runnable(held, clockIsRunning = false) {
|
|
30
37
|
const own = this.storage.getStore();
|
|
31
38
|
return held
|
|
32
39
|
.entries()
|
|
33
|
-
.filter(([, wait]) => wait
|
|
40
|
+
.filter(([, wait]) => wait !== own && (clockIsRunning || wait.count === 0))
|
|
34
41
|
.map(([promise]) => promise)
|
|
35
42
|
.toArray();
|
|
36
43
|
}
|
|
@@ -35,21 +35,27 @@ export declare class BackgroundPendingTasks {
|
|
|
35
35
|
*/
|
|
36
36
|
get size(): number;
|
|
37
37
|
/**
|
|
38
|
-
* Wait until nothing is outstanding
|
|
38
|
+
* Wait until nothing is outstanding that can still get somewhere.
|
|
39
39
|
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* here. The loop then looks again at what is
|
|
43
|
-
* carries on is waited for again.
|
|
40
|
+
* Where simulated time stands still, work that parks on the clock ends the
|
|
41
|
+
* wait rather than extending it. Only moving the clock releases it, and
|
|
42
|
+
* moving the clock is what waits here. The loop then looks again at what is
|
|
43
|
+
* left running, so work that carries on is waited for again.
|
|
44
|
+
*
|
|
45
|
+
* A running clock reaches those instants by itself, and the work parked on
|
|
46
|
+
* them is waited for like any other. What bounds the wait is the instant
|
|
47
|
+
* itself, which arrives in the real time between here and there.
|
|
44
48
|
*/
|
|
45
|
-
complete(): Promise<void>;
|
|
49
|
+
complete(clockIsRunning?: boolean): Promise<void>;
|
|
46
50
|
/**
|
|
47
|
-
* The work completion has anything to wait for
|
|
48
|
-
* neither waiting on the clock nor waiting for completion itself.
|
|
51
|
+
* The work completion has anything to wait for.
|
|
49
52
|
*
|
|
50
53
|
* Work that asks for the simulation to settle from inside itself is left
|
|
51
54
|
* out. A handler advancing the clock is the ordinary case, and waiting for
|
|
52
55
|
* the invocation it is part of would be waiting for itself.
|
|
56
|
+
*
|
|
57
|
+
* Work waiting on the clock joins it once simulated time is running, since
|
|
58
|
+
* a running clock is what brings the instant it waits for.
|
|
53
59
|
*/
|
|
54
|
-
running(): Promise<unknown>[];
|
|
60
|
+
running(clockIsRunning?: boolean): Promise<unknown>[];
|
|
55
61
|
}
|
|
@@ -52,15 +52,19 @@ export class BackgroundPendingTasks {
|
|
|
52
52
|
return this.#held.size;
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
|
-
* Wait until nothing is outstanding
|
|
55
|
+
* Wait until nothing is outstanding that can still get somewhere.
|
|
56
56
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* here. The loop then looks again at what is
|
|
60
|
-
* carries on is waited for again.
|
|
57
|
+
* Where simulated time stands still, work that parks on the clock ends the
|
|
58
|
+
* wait rather than extending it. Only moving the clock releases it, and
|
|
59
|
+
* moving the clock is what waits here. The loop then looks again at what is
|
|
60
|
+
* left running, so work that carries on is waited for again.
|
|
61
|
+
*
|
|
62
|
+
* A running clock reaches those instants by itself, and the work parked on
|
|
63
|
+
* them is waited for like any other. What bounds the wait is the instant
|
|
64
|
+
* itself, which arrives in the real time between here and there.
|
|
61
65
|
*/
|
|
62
|
-
async complete() {
|
|
63
|
-
let running = this.running();
|
|
66
|
+
async complete(clockIsRunning = false) {
|
|
67
|
+
let running = this.running(clockIsRunning);
|
|
64
68
|
while (running.length > 0) {
|
|
65
69
|
// oxlint-disable-next-line no-await-in-loop
|
|
66
70
|
const settled = await Promise.race([
|
|
@@ -68,19 +72,21 @@ export class BackgroundPendingTasks {
|
|
|
68
72
|
this.#clockWaits.next,
|
|
69
73
|
]);
|
|
70
74
|
new BackgroundSettledTasks(settled).throwFirstFailure();
|
|
71
|
-
running = this.running();
|
|
75
|
+
running = this.running(clockIsRunning);
|
|
72
76
|
}
|
|
73
77
|
}
|
|
74
78
|
/**
|
|
75
|
-
* The work completion has anything to wait for
|
|
76
|
-
* neither waiting on the clock nor waiting for completion itself.
|
|
79
|
+
* The work completion has anything to wait for.
|
|
77
80
|
*
|
|
78
81
|
* Work that asks for the simulation to settle from inside itself is left
|
|
79
82
|
* out. A handler advancing the clock is the ordinary case, and waiting for
|
|
80
83
|
* the invocation it is part of would be waiting for itself.
|
|
84
|
+
*
|
|
85
|
+
* Work waiting on the clock joins it once simulated time is running, since
|
|
86
|
+
* a running clock is what brings the instant it waits for.
|
|
81
87
|
*/
|
|
82
|
-
running() {
|
|
83
|
-
return this.#clockWaits.runnable(this.#held);
|
|
88
|
+
running(clockIsRunning = false) {
|
|
89
|
+
return this.#clockWaits.runnable(this.#held, clockIsRunning);
|
|
84
90
|
}
|
|
85
91
|
/**
|
|
86
92
|
* Keep work outstanding under its own record until it settles.
|
|
@@ -141,9 +141,11 @@ export declare class BackgroundTasks implements BackgroundScheduler, BackgroundC
|
|
|
141
141
|
* Wait until all tasks currently scheduled have finished.
|
|
142
142
|
* If tasks schedule more tasks, this will continue draining until idle.
|
|
143
143
|
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
144
|
+
* What happens to work waiting on the clock follows the clock. Where
|
|
145
|
+
* simulated time stands still the work stays where it is, scheduled for an
|
|
146
|
+
* instant only a caller can bring, and this returns without it. Where
|
|
147
|
+
* simulated time runs, the instant arrives by itself and this waits for the
|
|
148
|
+
* work to get through it.
|
|
147
149
|
*/
|
|
148
150
|
complete(): Promise<void>;
|
|
149
151
|
/**
|
|
@@ -154,5 +156,11 @@ export declare class BackgroundTasks implements BackgroundScheduler, BackgroundC
|
|
|
154
156
|
* See how many tasks are waiting for simulated time to reach them.
|
|
155
157
|
*/
|
|
156
158
|
get dueTaskCount(): number;
|
|
159
|
+
/**
|
|
160
|
+
* Whether simulated time reaches a scheduled instant on its own.
|
|
161
|
+
*
|
|
162
|
+
* A clock with nothing to say about it advances, as the host clock does.
|
|
163
|
+
*/
|
|
164
|
+
private get clockIsRunning();
|
|
157
165
|
}
|
|
158
166
|
export {};
|