@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
|
@@ -79,12 +79,14 @@ export class BackgroundTasks {
|
|
|
79
79
|
* Wait until all tasks currently scheduled have finished.
|
|
80
80
|
* If tasks schedule more tasks, this will continue draining until idle.
|
|
81
81
|
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
82
|
+
* What happens to work waiting on the clock follows the clock. Where
|
|
83
|
+
* simulated time stands still the work stays where it is, scheduled for an
|
|
84
|
+
* instant only a caller can bring, and this returns without it. Where
|
|
85
|
+
* simulated time runs, the instant arrives by itself and this waits for the
|
|
86
|
+
* work to get through it.
|
|
85
87
|
*/
|
|
86
88
|
async complete() {
|
|
87
|
-
await this.pending.complete();
|
|
89
|
+
await this.pending.complete(this.clockIsRunning);
|
|
88
90
|
}
|
|
89
91
|
/**
|
|
90
92
|
* See how many outstanding background tasks are scheduled.
|
|
@@ -98,4 +100,12 @@ export class BackgroundTasks {
|
|
|
98
100
|
get dueTaskCount() {
|
|
99
101
|
return this.dueTasks.size;
|
|
100
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Whether simulated time reaches a scheduled instant on its own.
|
|
105
|
+
*
|
|
106
|
+
* A clock with nothing to say about it advances, as the host clock does.
|
|
107
|
+
*/
|
|
108
|
+
get clockIsRunning() {
|
|
109
|
+
return this.clock.advances !== false;
|
|
110
|
+
}
|
|
101
111
|
}
|
|
@@ -55,6 +55,10 @@ export declare class NonDeterministicBackgroundTasks implements BackgroundSchedu
|
|
|
55
55
|
/**
|
|
56
56
|
* Wait until all tasks currently scheduled have finished.
|
|
57
57
|
* If tasks schedule more tasks, this will continue draining until idle.
|
|
58
|
+
*
|
|
59
|
+
* Work waiting on the clock is waited for where simulated time runs, and
|
|
60
|
+
* left where it is where simulated time stands still, exactly as it is on
|
|
61
|
+
* the deterministic scheduler.
|
|
58
62
|
*/
|
|
59
63
|
complete(): Promise<void>;
|
|
60
64
|
/**
|
|
@@ -79,9 +79,13 @@ export class NonDeterministicBackgroundTasks {
|
|
|
79
79
|
/**
|
|
80
80
|
* Wait until all tasks currently scheduled have finished.
|
|
81
81
|
* If tasks schedule more tasks, this will continue draining until idle.
|
|
82
|
+
*
|
|
83
|
+
* Work waiting on the clock is waited for where simulated time runs, and
|
|
84
|
+
* left where it is where simulated time stands still, exactly as it is on
|
|
85
|
+
* the deterministic scheduler.
|
|
82
86
|
*/
|
|
83
87
|
async complete() {
|
|
84
|
-
await this.pending.complete();
|
|
88
|
+
await this.pending.complete(this.clock.advances !== false);
|
|
85
89
|
}
|
|
86
90
|
/**
|
|
87
91
|
* See how many outstanding background tasks are scheduled.
|
|
@@ -11,6 +11,18 @@ export interface SimClock {
|
|
|
11
11
|
* Get the current time in this simulation.
|
|
12
12
|
*/
|
|
13
13
|
now(): Date;
|
|
14
|
+
/**
|
|
15
|
+
* Whether simulated time moves on this clock by itself.
|
|
16
|
+
*
|
|
17
|
+
* A scheduler reads this to decide what waiting for a simulation to settle
|
|
18
|
+
* means. Time that advances brings the instant a task is scheduled for on
|
|
19
|
+
* its own, and settling waits for that task. Time that stands still leaves
|
|
20
|
+
* the instant to whoever moves the clock, and settling leaves the task where
|
|
21
|
+
* it is.
|
|
22
|
+
*
|
|
23
|
+
* A clock that says nothing advances, as the host clock does.
|
|
24
|
+
*/
|
|
25
|
+
readonly advances?: boolean;
|
|
14
26
|
}
|
|
15
27
|
/**
|
|
16
28
|
* Clock that reports the real system time.
|
|
@@ -19,6 +31,8 @@ export interface SimClock {
|
|
|
19
31
|
* something deliberately replaces it.
|
|
20
32
|
*/
|
|
21
33
|
export declare class SimRealClock implements SimClock {
|
|
34
|
+
/** Real time moves by itself. */
|
|
35
|
+
readonly advances = true;
|
|
22
36
|
/**
|
|
23
37
|
* Get the current real system time.
|
|
24
38
|
*/
|
|
@@ -31,6 +45,8 @@ export declare class SimRealClock implements SimClock {
|
|
|
31
45
|
* reaching for a library that replaces the clock for the whole process.
|
|
32
46
|
*/
|
|
33
47
|
export declare class SimFixedClock implements SimClock {
|
|
48
|
+
/** A fixed instant is the whole of this clock. Time stands still on it. */
|
|
49
|
+
readonly advances = false;
|
|
34
50
|
private readonly instant;
|
|
35
51
|
constructor(instant: Date);
|
|
36
52
|
/**
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* something deliberately replaces it.
|
|
6
6
|
*/
|
|
7
7
|
export class SimRealClock {
|
|
8
|
+
/** Real time moves by itself. */
|
|
9
|
+
advances = true;
|
|
8
10
|
/**
|
|
9
11
|
* Get the current real system time.
|
|
10
12
|
*/
|
|
@@ -19,6 +21,8 @@ export class SimRealClock {
|
|
|
19
21
|
* reaching for a library that replaces the clock for the whole process.
|
|
20
22
|
*/
|
|
21
23
|
export class SimFixedClock {
|
|
24
|
+
/** A fixed instant is the whole of this clock. Time stands still on it. */
|
|
25
|
+
advances = false;
|
|
22
26
|
instant;
|
|
23
27
|
constructor(instant) {
|
|
24
28
|
this.instant = new Date(instant);
|
|
@@ -33,6 +33,17 @@ export declare class SimControllableClock implements SimClock {
|
|
|
33
33
|
* Whether simulated time is currently standing still.
|
|
34
34
|
*/
|
|
35
35
|
get isFrozen(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether simulated time moves here by itself.
|
|
38
|
+
*
|
|
39
|
+
* A frozen clock moves only where something moves it. So does a running
|
|
40
|
+
* clock over a base that stands still. The offset a running mode applies is
|
|
41
|
+
* fixed, so simulated time here moves exactly as far as the clock underneath
|
|
42
|
+
* moves, and a fixed clock underneath moves nowhere. Freezing and resuming
|
|
43
|
+
* such a clock changes which instant it reports and leaves it as still as it
|
|
44
|
+
* was.
|
|
45
|
+
*/
|
|
46
|
+
get advances(): boolean;
|
|
36
47
|
/**
|
|
37
48
|
* Stop simulated time where it currently reads.
|
|
38
49
|
*/
|
|
@@ -32,6 +32,19 @@ export class SimControllableClock {
|
|
|
32
32
|
get isFrozen() {
|
|
33
33
|
return this.mode.isFrozen;
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Whether simulated time moves here by itself.
|
|
37
|
+
*
|
|
38
|
+
* A frozen clock moves only where something moves it. So does a running
|
|
39
|
+
* clock over a base that stands still. The offset a running mode applies is
|
|
40
|
+
* fixed, so simulated time here moves exactly as far as the clock underneath
|
|
41
|
+
* moves, and a fixed clock underneath moves nowhere. Freezing and resuming
|
|
42
|
+
* such a clock changes which instant it reports and leaves it as still as it
|
|
43
|
+
* was.
|
|
44
|
+
*/
|
|
45
|
+
get advances() {
|
|
46
|
+
return !this.mode.isFrozen && this.base.advances !== false;
|
|
47
|
+
}
|
|
35
48
|
/**
|
|
36
49
|
* Stop simulated time where it currently reads.
|
|
37
50
|
*/
|
|
@@ -3648,6 +3648,22 @@ The condition takes the `ForAllValues:` qualifier, as AWS requires for this key.
|
|
|
3648
3648
|
value the request reaches has to match. A batch or a write naming one item outside the allowed set
|
|
3649
3649
|
is refused whole, and nothing it asked for is applied.
|
|
3650
3650
|
|
|
3651
|
+
The same commands, along with `Scan`, supply the top-level attribute names they reach as
|
|
3652
|
+
`dynamodb:Attributes`. A name reaches the condition wherever the request writes one, in a
|
|
3653
|
+
`ProjectionExpression`, an `UpdateExpression`, a `ConditionExpression`, a `FilterExpression`, a
|
|
3654
|
+
`KeyConditionExpression`, and in the `Key` or `Item` a request names outright. A `#` placeholder is
|
|
3655
|
+
resolved first, so the policy is matched against the attribute rather than the alias. A nested path
|
|
3656
|
+
counts as the attribute it starts at, so `address.city` reaches `address`.
|
|
3657
|
+
|
|
3658
|
+
A policy conditioned on `dynamodb:Attributes` has to name every primary key and index key attribute
|
|
3659
|
+
of the table alongside the attributes it is restricting, as AWS requires. A request names its key,
|
|
3660
|
+
and a policy leaving the key attributes out refuses every request that reads or writes an item.
|
|
3661
|
+
|
|
3662
|
+
A request reaching no attribute at all leaves the key out of the condition context, which a
|
|
3663
|
+
`ForAllValues:` condition matches. A `Scan` carrying no expression is the case to watch. AWS asks
|
|
3664
|
+
for a `Null` check beside such a statement to close it, covered under
|
|
3665
|
+
[policy conditions](https://yulinsim.dev/services/iam/#policy-conditions).
|
|
3666
|
+
|
|
3651
3667
|
```typescript sim-dynamodb-leading-keys
|
|
3652
3668
|
import { CreateTableCommand, PutItemCommand } from "@aws-sdk/client-dynamodb";
|
|
3653
3669
|
import { CreateRoleCommand, PutRolePolicyCommand } from "@aws-sdk/client-iam";
|
|
@@ -3755,6 +3771,8 @@ is written.
|
|
|
3755
3771
|
- `dynamodb:LeadingKeys` on `GetItem`, `BatchGetItem`, `Query`, `PutItem`, `UpdateItem`,
|
|
3756
3772
|
`DeleteItem` and `BatchWriteItem`, carrying the partition key values the request reaches so a
|
|
3757
3773
|
`ForAllValues:` condition can scope a caller to particular items.
|
|
3774
|
+
- `dynamodb:Attributes` on those seven and on `Scan`, carrying the top-level attribute names the
|
|
3775
|
+
request reaches, read from every expression it carries and from its `Key` or `Item`.
|
|
3758
3776
|
- `DescribeTable`, answering with the full table description, by table name or ARN.
|
|
3759
3777
|
- `ListTables`, ordered by UTF-8 bytes and paged with `Limit` and `ExclusiveStartTableName`.
|
|
3760
3778
|
- `DeleteTable`, following the table status DynamoDB moves a deleted table through, and refusing a
|
|
@@ -3828,10 +3846,11 @@ Arn`, `Fn::GetAtt … StreamArn` and `Fn::GetAtt … TableId` answering. A CDK `
|
|
|
3828
3846
|
|
|
3829
3847
|
## Limitations
|
|
3830
3848
|
|
|
3831
|
-
- `dynamodb:LeadingKeys`
|
|
3832
|
-
`dynamodb:Select
|
|
3833
|
-
|
|
3834
|
-
|
|
3849
|
+
- `dynamodb:LeadingKeys` and `dynamodb:Attributes` are the DynamoDB condition keys supplied.
|
|
3850
|
+
`dynamodb:Select`, `dynamodb:ReturnValues`, `dynamodb:ReturnConsumedCapacity` and the numbered
|
|
3851
|
+
partition key families are absent from the condition context, and a statement conditioned on one
|
|
3852
|
+
of them matches no request. The transactional operations supply neither key, and are authorized by
|
|
3853
|
+
action and table alone.
|
|
3835
3854
|
- A partition key value reaches a policy condition as a string for a `S` key and as its digits for
|
|
3836
3855
|
an `N` key. A binary partition key has no documented form for the condition key. A request
|
|
3837
3856
|
carrying one leaves the value out.
|
|
@@ -236,7 +236,7 @@ repository that still says it is there.
|
|
|
236
236
|
## Policy conditions
|
|
237
237
|
|
|
238
238
|
Policy statements can carry `Condition` blocks. Sim IAM currently supports the `StringEquals`,
|
|
239
|
-
`StringLike`, `ArnLike`, `ArnEquals` and `
|
|
239
|
+
`StringLike`, `ArnLike`, `ArnEquals`, `NumericLessThanEquals` and `Null` operators, along with the
|
|
240
240
|
`ForAllValues:` and `ForAnyValue:` set variants of `StringEquals` and `StringLike`.
|
|
241
241
|
|
|
242
242
|
The negated operators `StringNotEquals`, `StringNotLike`, `ArnNotEquals` and `ArnNotLike` are
|
|
@@ -337,8 +337,20 @@ request value is there to satisfy it.
|
|
|
337
337
|
|
|
338
338
|
A `ForAllValues:` operator answers true for an absent key, which is also AWS behaviour. Every value
|
|
339
339
|
the request carries matches when it carries none. AWS warns that this leaves a `ForAllValues:`
|
|
340
|
-
`Allow` overly permissive, and asks for a `Null` check with a `false` value beside it.
|
|
341
|
-
|
|
340
|
+
`Allow` overly permissive, and asks for a `Null` check with a `false` value beside it. Write the
|
|
341
|
+
guard and sim IAM evaluates it.
|
|
342
|
+
|
|
343
|
+
`Null` asks whether the request carries a value for a context key rather than comparing one. `"true"`
|
|
344
|
+
matches where the key is absent and `"false"` where it is present. A key carrying an empty string or
|
|
345
|
+
an empty list of values counts as absent, which is the null dataset AWS describes. The two values
|
|
346
|
+
can also be written as JSON booleans. Any other policy value leaves the condition matching nothing.
|
|
347
|
+
|
|
348
|
+
```json
|
|
349
|
+
"Condition": {
|
|
350
|
+
"ForAllValues:StringLike": { "dynamodb:LeadingKeys": ["ORDER#*"] },
|
|
351
|
+
"Null": { "dynamodb:LeadingKeys": "false" }
|
|
352
|
+
}
|
|
353
|
+
```
|
|
342
354
|
|
|
343
355
|
### Statements left unevaluated
|
|
344
356
|
|
|
@@ -1689,6 +1701,8 @@ Sim IAM models the policy behaviour that multi-service tests most commonly need.
|
|
|
1689
1701
|
- Only the condition operators listed above are supported. A statement using any other operator
|
|
1690
1702
|
fails closed, matching no request. `decision.unevaluatedStatements` names those statements, and a
|
|
1691
1703
|
test can assert that a decision was reached over policies read in full
|
|
1704
|
+
- The `...IfExists` operator suffix is absent. AWS reads it as the sibling of `Null`, treating a
|
|
1705
|
+
condition on a key the request leaves out as true. A statement using it fails closed here
|
|
1692
1706
|
- A positive `ForAllValues:` condition fails to match an empty value set, where AWS matches one. An
|
|
1693
1707
|
absent context key matches, as it does on AWS. A service here leaves a key out where the request
|
|
1694
1708
|
carries no value for it, and the empty set is reached only by a caller passing one to `authorize`
|
|
@@ -3269,6 +3269,17 @@ An interval runs once for each period an advance covers. Advancing eleven second
|
|
|
3269
3269
|
interval runs it five times. A delay of zero, or none at all, is due at the instant it was asked
|
|
3270
3270
|
for, and a handler yielding with `setTimeout(resolve, 0)` gets going again without the clock moving.
|
|
3271
3271
|
|
|
3272
|
+
Where the clock is left running, the delay passes in real time and nothing has to move it.
|
|
3273
|
+
`simAws.backgroundTasksComplete()` waits for a handler sleeping on a clock that is moving. An S3
|
|
3274
|
+
event notification, a stream record or an asynchronous invocation whose handler uses a timer has
|
|
3275
|
+
finished by the time the drain returns, and the function's `Timeout` bounds how long that wait can
|
|
3276
|
+
last.
|
|
3277
|
+
|
|
3278
|
+
Two things leave a clock standing still. `freeze()`, `advanceBy(...)` and `setTo(...)` all leave it
|
|
3279
|
+
frozen, and a `SimAws` built on a `SimFixedClock` reports one instant however long the host runs.
|
|
3280
|
+
Under either the drain comes back while the handler sleeps, and moving the clock is what releases
|
|
3281
|
+
it.
|
|
3282
|
+
|
|
3272
3283
|
The function's `Timeout` is a deadline on the same clock. Where it arrives before the handler
|
|
3273
3284
|
answers, the invocation ends in the error the real runtime reports.
|
|
3274
3285
|
|
package/docs/time/README.md
CHANGED
|
@@ -63,6 +63,13 @@ example, a simulation advanced by one hour continues to run one hour ahead of th
|
|
|
63
63
|
|
|
64
64
|
Read `simAws.clock().isFrozen` to check the current mode.
|
|
65
65
|
|
|
66
|
+
The mode also decides what waiting for the simulation to settle means.
|
|
67
|
+
`simAws.backgroundTasksComplete()` waits for background work sleeping on a clock that is moving,
|
|
68
|
+
because the instant that work sleeps until arrives by itself. Under a clock standing still the same
|
|
69
|
+
work is left where it is, and `advanceBy(...)` or a forward `setTo(...)` is what brings the instant
|
|
70
|
+
and waits for what follows from it. A simulation built on a `SimFixedClock` stands still under a
|
|
71
|
+
running mode too, since simulated time here moves only as far as the clock underneath moves.
|
|
72
|
+
|
|
66
73
|
## Advancing time
|
|
67
74
|
|
|
68
75
|
`advanceBy(...)` accepts days, hours, minutes, seconds, and milliseconds. The values are added
|
package/package.json
CHANGED