@kensio/yulin 1.15.0 → 1.15.1
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/cognito/cfn/user-pool/sim-cfn-cognito-account-recovery.d.ts +32 -0
- package/dist/service/cognito/cfn/user-pool/sim-cfn-cognito-account-recovery.d.ts.map +1 -0
- package/dist/service/cognito/cfn/user-pool/sim-cfn-cognito-account-recovery.js +61 -0
- package/dist/service/cognito/cfn/user-pool/sim-cfn-cognito-account-recovery.js.map +1 -0
- package/dist/service/cognito/cfn/user-pool/sim-cfn-cognito-user-pool-properties.d.ts +2 -3
- package/dist/service/cognito/cfn/user-pool/sim-cfn-cognito-user-pool-properties.d.ts.map +1 -1
- package/dist/service/cognito/cfn/user-pool/sim-cfn-cognito-user-pool-properties.js +16 -9
- package/dist/service/cognito/cfn/user-pool/sim-cfn-cognito-user-pool-properties.js.map +1 -1
- package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-features.d.ts +3 -4
- package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-features.d.ts.map +1 -1
- package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-features.js +3 -22
- package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-features.js.map +1 -1
- package/dist/service/cognito/command/user-pool/sim-cognito-user-pool-view.d.ts +3 -2
- package/dist/service/cognito/command/user-pool/sim-cognito-user-pool-view.d.ts.map +1 -1
- package/dist/service/cognito/command/user-pool/sim-cognito-user-pool-view.js +4 -3
- package/dist/service/cognito/command/user-pool/sim-cognito-user-pool-view.js.map +1 -1
- package/dist/service/cognito/command/user-pool/user-pool.command.d.ts +3 -2
- package/dist/service/cognito/command/user-pool/user-pool.command.d.ts.map +1 -1
- package/dist/service/cognito/user-pool/sim-cognito-account-recovery.d.ts +86 -0
- package/dist/service/cognito/user-pool/sim-cognito-account-recovery.d.ts.map +1 -0
- package/dist/service/cognito/user-pool/sim-cognito-account-recovery.js +127 -0
- package/dist/service/cognito/user-pool/sim-cognito-account-recovery.js.map +1 -0
- package/dist/service/cognito/user-pool/sim-cognito-user-pool-settings.d.ts +8 -6
- package/dist/service/cognito/user-pool/sim-cognito-user-pool-settings.d.ts.map +1 -1
- package/dist/service/cognito/user-pool/sim-cognito-user-pool-settings.js +7 -6
- package/dist/service/cognito/user-pool/sim-cognito-user-pool-settings.js.map +1 -1
- package/package.json +1 -1
- package/dist/service/cognito/command/sim-cognito-canonical-value.d.ts +0 -28
- package/dist/service/cognito/command/sim-cognito-canonical-value.d.ts.map +0 -1
- package/dist/service/cognito/command/sim-cognito-canonical-value.js +0 -44
- package/dist/service/cognito/command/sim-cognito-canonical-value.js.map +0 -1
- package/dist/service/cognito/command/sim-cognito-unsimulated-structure.d.ts +0 -23
- package/dist/service/cognito/command/sim-cognito-unsimulated-structure.d.ts.map +0 -1
- package/dist/service/cognito/command/sim-cognito-unsimulated-structure.js +0 -38
- package/dist/service/cognito/command/sim-cognito-unsimulated-structure.js.map +0 -1
- package/dist/service/cognito/user-pool/sim-cognito-unsimulated-pool-settings.d.ts +0 -45
- package/dist/service/cognito/user-pool/sim-cognito-unsimulated-pool-settings.d.ts.map +0 -1
- package/dist/service/cognito/user-pool/sim-cognito-unsimulated-pool-settings.js +0 -46
- package/dist/service/cognito/user-pool/sim-cognito-unsimulated-pool-settings.js.map +0 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { SimCfnResource } from "../../../cloudformation/resource/sim-cfn-resource.js";
|
|
2
|
+
import type { SimCfnTemplateValue } from "../../../cloudformation/template/value/sim-cfn-template-value.js";
|
|
3
|
+
import type { SimCognitoAccountRecoverySettingType } from "../../user-pool/sim-cognito-account-recovery.js";
|
|
4
|
+
import type { SimCfnCognitoPropertyParser } from "../sim-cfn-cognito-property-parser.js";
|
|
5
|
+
interface SimCfnCognitoAccountRecoveryProperties {
|
|
6
|
+
readonly resource: SimCfnResource;
|
|
7
|
+
readonly propertyParser: SimCfnCognitoPropertyParser;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Reads the `AccountRecoverySetting` property of an AWS::Cognito::UserPool
|
|
11
|
+
* Resource into the shape CreateUserPool takes.
|
|
12
|
+
*
|
|
13
|
+
* A mechanism carries a name and a priority, and both are read. The names are
|
|
14
|
+
* passed on rather than judged here: CreateUserPool refuses one Cognito does
|
|
15
|
+
* not have, so a template asking for it fails the stack with the same words an
|
|
16
|
+
* SDK caller would have been given.
|
|
17
|
+
*/
|
|
18
|
+
export declare class SimCfnCognitoAccountRecovery {
|
|
19
|
+
private readonly resource;
|
|
20
|
+
private readonly parser;
|
|
21
|
+
constructor(properties: SimCfnCognitoAccountRecoveryProperties);
|
|
22
|
+
/**
|
|
23
|
+
* The recovery the template declares, or undefined where it declares none.
|
|
24
|
+
*/
|
|
25
|
+
parse(value: SimCfnTemplateValue | undefined): SimCognitoAccountRecoverySettingType | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The mechanisms the setting lists, in the order it lists them.
|
|
28
|
+
*/
|
|
29
|
+
private mechanisms;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=sim-cfn-cognito-account-recovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-cfn-cognito-account-recovery.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/cfn/user-pool/sim-cfn-cognito-account-recovery.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kEAAkE,CAAC;AAC5G,OAAO,KAAK,EACV,oCAAoC,EAErC,MAAM,iDAAiD,CAAC;AACzD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAQzF,UAAU,sCAAsC;IAC9C,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,cAAc,EAAE,2BAA2B,CAAC;CACtD;AAED;;;;;;;;GAQG;AACH,qBAAa,4BAA4B;IACvC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiB;IAC1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8B;IAErD,YAAY,UAAU,EAAE,sCAAsC,EAG7D;IAED;;OAEG;IACH,KAAK,CACH,KAAK,EAAE,mBAAmB,GAAG,SAAS,GACrC,oCAAoC,GAAG,SAAS,CA4BlD;IAED;;OAEG;IACH,OAAO,CAAC,UAAU;CAiCnB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { assertDefined } from "../../../../util/type-guard/defined.js";
|
|
2
|
+
/**
|
|
3
|
+
* The `AccountRecoverySetting` fields this simulation reads, which is the one
|
|
4
|
+
* field it has.
|
|
5
|
+
*/
|
|
6
|
+
const modelledFields = ["RecoveryMechanisms"];
|
|
7
|
+
/**
|
|
8
|
+
* Reads the `AccountRecoverySetting` property of an AWS::Cognito::UserPool
|
|
9
|
+
* Resource into the shape CreateUserPool takes.
|
|
10
|
+
*
|
|
11
|
+
* A mechanism carries a name and a priority, and both are read. The names are
|
|
12
|
+
* passed on rather than judged here: CreateUserPool refuses one Cognito does
|
|
13
|
+
* not have, so a template asking for it fails the stack with the same words an
|
|
14
|
+
* SDK caller would have been given.
|
|
15
|
+
*/
|
|
16
|
+
export class SimCfnCognitoAccountRecovery {
|
|
17
|
+
resource;
|
|
18
|
+
parser;
|
|
19
|
+
constructor(properties) {
|
|
20
|
+
this.resource = properties.resource;
|
|
21
|
+
this.parser = properties.propertyParser;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The recovery the template declares, or undefined where it declares none.
|
|
25
|
+
*/
|
|
26
|
+
parse(value) {
|
|
27
|
+
const setting = this.parser.optionalRecord(this.resource, value, "AccountRecoverySetting");
|
|
28
|
+
if (setting === undefined) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
this.parser.ignoreUnmodelledKeys(this.resource, setting, modelledFields, "AccountRecoverySetting ");
|
|
32
|
+
const listed = setting["RecoveryMechanisms"];
|
|
33
|
+
// A setting that lists no mechanisms is passed on as it was written.
|
|
34
|
+
// CreateUserPool holds a list to the one or two entries Cognito takes, and
|
|
35
|
+
// a list invented here would be one the template never asked for.
|
|
36
|
+
if (listed === undefined) {
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
return { RecoveryMechanisms: this.mechanisms(listed) };
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The mechanisms the setting lists, in the order it lists them.
|
|
43
|
+
*/
|
|
44
|
+
mechanisms(listed) {
|
|
45
|
+
if (!Array.isArray(listed)) {
|
|
46
|
+
throw this.parser.invalidPropertyError(this.resource, "AccountRecoverySetting RecoveryMechanisms", "a list of recovery mechanisms");
|
|
47
|
+
}
|
|
48
|
+
return listed.map((entry, index) => {
|
|
49
|
+
const label = `RecoveryMechanisms[${String(index)}]`;
|
|
50
|
+
const mechanism = this.parser.optionalRecord(this.resource, entry, label);
|
|
51
|
+
// A list entry is always something, so the parser above has either
|
|
52
|
+
// answered with the object or refused whatever else the template wrote.
|
|
53
|
+
assertDefined(mechanism, label);
|
|
54
|
+
return {
|
|
55
|
+
Name: this.parser.optionalString(this.resource, mechanism["Name"], `${label} Name`),
|
|
56
|
+
Priority: this.parser.optionalNumber(this.resource, mechanism["Priority"], `${label} Priority`),
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=sim-cfn-cognito-account-recovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-cfn-cognito-account-recovery.js","sourceRoot":"","sources":["../../../../../src/service/cognito/cfn/user-pool/sim-cfn-cognito-account-recovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AASvE;;;GAGG;AACH,MAAM,cAAc,GAAG,CAAC,oBAAoB,CA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M,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;YAE1E,mEAAmE;YACnE,wEAAwE;YACxE,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;YAEhC,OAAO;gBACL,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAC9B,IAAI,CAAC,QAAQ,EACb,SAAS,CAAC,MAAM,CAAC,EACjB,GAAG,KAAK,OAAO,CAChB;gBACD,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAClC,IAAI,CAAC,QAAQ,EACb,SAAS,CAAC,UAAU,CAAC,EACrB,GAAG,KAAK,WAAW,CACpB;aACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -40,9 +40,8 @@ export declare class SimCfnCognitoUserPoolProperties {
|
|
|
40
40
|
/**
|
|
41
41
|
* A property carried as an object, passed on to CreateUserPool as written.
|
|
42
42
|
*
|
|
43
|
-
* The keys inside are not checked here. CreateUserPool
|
|
44
|
-
*
|
|
45
|
-
* along with everything else that differs.
|
|
43
|
+
* The keys inside are not checked here. CreateUserPool reads them itself, a
|
|
44
|
+
* key at a time, so the value is judged in one place rather than two.
|
|
46
45
|
*/
|
|
47
46
|
private record;
|
|
48
47
|
private string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cfn-cognito-user-pool-properties.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/cfn/user-pool/sim-cfn-cognito-user-pool-properties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,KAAK,EAEV,yBAAyB,EAC1B,MAAM,kEAAkE,CAAC;AAC1E,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,kDAAkD,CAAC;AAC5G,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-cfn-cognito-user-pool-properties.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/cfn/user-pool/sim-cfn-cognito-user-pool-properties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,KAAK,EAEV,yBAAyB,EAC1B,MAAM,kEAAkE,CAAC;AAC1E,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,kDAAkD,CAAC;AAC5G,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAkElG,UAAU,yCAAyC;IACjD,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,UAAU,EAAE,yBAAyB,CAAC;CAChD;AAED;;;;;;;GAOG;AACH,qBAAa,+BAA+B;IAC1C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiB;IAC1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA4B;IACvD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAG5B;IAEH,YAAY,UAAU,EAAE,yCAAyC,EAKhE;IAED;;;;;OAKG;IACH,mBAAmB,IAAI,6BAA6B,CAqDnD;IAED;;;;OAIG;IACH,yBAAyB,CACvB,UAAU,EAAE,MAAM,GACjB,mCAAmC,GAAG,SAAS,CAKjD;IAED;;;OAGG;IACH,OAAO,CAAC,QAAQ;IAahB;;;;;OAKG;IACH,OAAO,CAAC,MAAM;IAOd,OAAO,CAAC,MAAM;CAMf"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SimCfnCognitoGeneratedName } from "../sim-cfn-cognito-generated-name.js";
|
|
2
2
|
import { SimCfnCognitoPropertyParser } from "../sim-cfn-cognito-property-parser.js";
|
|
3
|
+
import { SimCfnCognitoAccountRecovery } from "./sim-cfn-cognito-account-recovery.js";
|
|
3
4
|
import { SimCfnCognitoAdminCreateUserConfig } from "./sim-cfn-cognito-admin-create-user-config.js";
|
|
4
5
|
import { SimCfnCognitoUserPoolMfa } from "./sim-cfn-cognito-user-pool-mfa.js";
|
|
5
6
|
import { SimCfnCognitoUserPoolSchema } from "./sim-cfn-cognito-user-pool-schema.js";
|
|
@@ -32,12 +33,16 @@ import { SimCfnCognitoPolicies } from "./sim-cfn-cognito-policies.js";
|
|
|
32
33
|
* this simulation fires deploys and one asking for a trigger it does not fails
|
|
33
34
|
* the stack, rather than the two being decided together.
|
|
34
35
|
*
|
|
35
|
-
*
|
|
36
|
+
* `AccountRecoverySetting` is here because the pool records the mechanisms it
|
|
37
|
+
* names and reports them back. Nothing here starts a recovery, so a template
|
|
38
|
+
* declaring email-only recovery deploys, and CreateUserPool refuses a setting
|
|
39
|
+
* outside the shape Cognito states for it.
|
|
40
|
+
*
|
|
41
|
+
* The four from `EmailVerificationMessage` down are here because a CDK
|
|
36
42
|
* `UserPool` construct emits them when it was asked for nothing in
|
|
37
|
-
* particular.
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* and refuses it at every other.
|
|
43
|
+
* particular. They are the wording of the messages the pool records, and
|
|
44
|
+
* `VerificationMessageTemplate` is refused where it asks for verification by
|
|
45
|
+
* following a link.
|
|
41
46
|
*/
|
|
42
47
|
const simulatedProperties = [
|
|
43
48
|
"UserPoolName",
|
|
@@ -92,7 +97,10 @@ export class SimCfnCognitoUserPoolProperties {
|
|
|
92
97
|
DeletionProtection: this.string(this.properties["DeletionProtection"], "DeletionProtection"),
|
|
93
98
|
LambdaConfig: this.record(this.properties["LambdaConfig"], "LambdaConfig"),
|
|
94
99
|
UserPoolTier: this.string(this.properties["UserPoolTier"], "UserPoolTier"),
|
|
95
|
-
AccountRecoverySetting:
|
|
100
|
+
AccountRecoverySetting: new SimCfnCognitoAccountRecovery({
|
|
101
|
+
resource: this.resource,
|
|
102
|
+
propertyParser: this.propertyParser,
|
|
103
|
+
}).parse(this.properties["AccountRecoverySetting"]),
|
|
96
104
|
AdminCreateUserConfig: new SimCfnCognitoAdminCreateUserConfig({
|
|
97
105
|
resource: this.resource,
|
|
98
106
|
propertyParser: this.propertyParser,
|
|
@@ -136,9 +144,8 @@ export class SimCfnCognitoUserPoolProperties {
|
|
|
136
144
|
/**
|
|
137
145
|
* A property carried as an object, passed on to CreateUserPool as written.
|
|
138
146
|
*
|
|
139
|
-
* The keys inside are not checked here. CreateUserPool
|
|
140
|
-
*
|
|
141
|
-
* along with everything else that differs.
|
|
147
|
+
* The keys inside are not checked here. CreateUserPool reads them itself, a
|
|
148
|
+
* key at a time, so the value is judged in one place rather than two.
|
|
142
149
|
*/
|
|
143
150
|
record(value, label) {
|
|
144
151
|
return this.propertyParser.optionalRecord(this.resource, value, label);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cfn-cognito-user-pool-properties.js","sourceRoot":"","sources":["../../../../../src/service/cognito/cfn/user-pool/sim-cfn-cognito-user-pool-properties.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,kCAAkC,EAAE,MAAM,+CAA+C,CAAC;AACnG,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE
|
|
1
|
+
{"version":3,"file":"sim-cfn-cognito-user-pool-properties.js","sourceRoot":"","sources":["../../../../../src/service/cognito/cfn/user-pool/sim-cfn-cognito-user-pool-properties.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,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nC,IAAI,CAAC,UAAU,CAAC,0BAA0B,CAAC,EAC3C,0BAA0B,CAC3B;YACD,sBAAsB,EAAE,IAAI,CAAC,MAAM,CACjC,IAAI,CAAC,UAAU,CAAC,wBAAwB,CAAC,EACzC,wBAAwB,CACzB;SACF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,yBAAyB,CACvB,UAAkB;QAElB,OAAO,IAAI,wBAAwB,CAAC;YAClC,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,cAAc,EAAE,IAAI,CAAC,cAAc;SACpC,CAAC,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACK,QAAQ;QACd,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,CAAC;QAE3E,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,IAAI,0BAA0B,CAAC;YACpC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS;YAClC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS;SACnC,CAAC,CAAC,KAAK,CAAC;IACX,CAAC;IAED;;;;;OAKG;IACK,MAAM,CACZ,KAAsC,EACtC,KAAa;QAEb,OAAO,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACzE,CAAC;IAEO,MAAM,CACZ,KAAsC,EACtC,KAAa;QAEb,OAAO,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACzE,CAAC;CACF"}
|
|
@@ -6,9 +6,9 @@ import type { SimCognitoUserPoolCommandInput } from "./user-pool.command.js";
|
|
|
6
6
|
* them cannot be honoured here at all, and a pool created as if they had been
|
|
7
7
|
* would behave differently in a deployment.
|
|
8
8
|
*
|
|
9
|
-
* `AccountRecoverySetting` is
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* `AccountRecoverySetting` is not here. A pool records the mechanisms it was
|
|
10
|
+
* asked for and reports them back, and SimCognitoAccountRecovery refuses a
|
|
11
|
+
* setting outside the shape Cognito states for it.
|
|
12
12
|
*
|
|
13
13
|
* `AdminCreateUserConfig` is simulated as far as `AllowAdminCreateUserOnly`
|
|
14
14
|
* goes, which is what decides whether `SignUp` is allowed. The two keys beside
|
|
@@ -22,7 +22,6 @@ import type { SimCognitoUserPoolCommandInput } from "./user-pool.command.js";
|
|
|
22
22
|
*/
|
|
23
23
|
export declare class SimCognitoUnsimulatedUserPoolFeatures {
|
|
24
24
|
private readonly unsimulated;
|
|
25
|
-
private readonly structure;
|
|
26
25
|
constructor(operation: string);
|
|
27
26
|
/**
|
|
28
27
|
* Refuse a request carrying a feature this simulation cannot honour.
|
package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-features.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cognito-unsimulated-pool-features.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-features.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sim-cognito-unsimulated-pool-features.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-features.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,qCAAqC;IAChD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA6B;IAEzD,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,8BAA8B,GAAG,IAAI,CAqCpD;CACF"}
|
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
import { SimCognitoUnsimulatedInput } from "../sim-cognito-unsimulated-input.js";
|
|
2
|
-
import { SimCognitoUnsimulatedStructure } from "../sim-cognito-unsimulated-structure.js";
|
|
3
|
-
/**
|
|
4
|
-
* The account recovery a pool is accepted with, which is what `aws-cdk-lib`
|
|
5
|
-
* 2.262.1 emits for a `UserPool` construct asking for nothing in particular.
|
|
6
|
-
*
|
|
7
|
-
* There is no `ForgotPassword` command here, so no mechanism is ever reached
|
|
8
|
-
* whichever ones are listed. A request listing its own is still refused,
|
|
9
|
-
* because choosing them is choosing behaviour, and a pool that ignored the
|
|
10
|
-
* choice would recover accounts differently on real AWS.
|
|
11
|
-
*/
|
|
12
|
-
const accountRecoverySetting = {
|
|
13
|
-
RecoveryMechanisms: [
|
|
14
|
-
{ Name: "verified_phone_number", Priority: 1 },
|
|
15
|
-
{ Name: "verified_email", Priority: 2 },
|
|
16
|
-
],
|
|
17
|
-
};
|
|
18
2
|
/**
|
|
19
3
|
* Refuses the user pool features this simulation does not model.
|
|
20
4
|
*
|
|
@@ -22,9 +6,9 @@ const accountRecoverySetting = {
|
|
|
22
6
|
* them cannot be honoured here at all, and a pool created as if they had been
|
|
23
7
|
* would behave differently in a deployment.
|
|
24
8
|
*
|
|
25
|
-
* `AccountRecoverySetting` is
|
|
26
|
-
*
|
|
27
|
-
*
|
|
9
|
+
* `AccountRecoverySetting` is not here. A pool records the mechanisms it was
|
|
10
|
+
* asked for and reports them back, and SimCognitoAccountRecovery refuses a
|
|
11
|
+
* setting outside the shape Cognito states for it.
|
|
28
12
|
*
|
|
29
13
|
* `AdminCreateUserConfig` is simulated as far as `AllowAdminCreateUserOnly`
|
|
30
14
|
* goes, which is what decides whether `SignUp` is allowed. The two keys beside
|
|
@@ -38,10 +22,8 @@ const accountRecoverySetting = {
|
|
|
38
22
|
*/
|
|
39
23
|
export class SimCognitoUnsimulatedUserPoolFeatures {
|
|
40
24
|
unsimulated;
|
|
41
|
-
structure;
|
|
42
25
|
constructor(operation) {
|
|
43
26
|
this.unsimulated = new SimCognitoUnsimulatedInput(operation);
|
|
44
|
-
this.structure = new SimCognitoUnsimulatedStructure(operation);
|
|
45
27
|
}
|
|
46
28
|
/**
|
|
47
29
|
* Refuse a request carrying a feature this simulation cannot honour.
|
|
@@ -49,7 +31,6 @@ export class SimCognitoUnsimulatedUserPoolFeatures {
|
|
|
49
31
|
refuseIn(input) {
|
|
50
32
|
this.unsimulated.refuse("UserAttributeUpdateSettings", input.UserAttributeUpdateSettings, "verification before an attribute changes");
|
|
51
33
|
this.unsimulated.refuse("DeviceConfiguration", input.DeviceConfiguration, "device remembering");
|
|
52
|
-
this.structure.refuseUnless("AccountRecoverySetting", input.AccountRecoverySetting, accountRecoverySetting, "account recovery");
|
|
53
34
|
this.unsimulated.refuse("AdminCreateUserConfig InviteMessageTemplate", input.AdminCreateUserConfig?.InviteMessageTemplate, "the wording of the invitation an admin-created user is sent");
|
|
54
35
|
this.unsimulated.refuse("AdminCreateUserConfig UnusedAccountValidityDays", input.AdminCreateUserConfig?.UnusedAccountValidityDays, "expiring the temporary password an admin-created user was sent");
|
|
55
36
|
this.unsimulated.refuse("UserPoolAddOns", input.UserPoolAddOns, "threat protection");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cognito-unsimulated-pool-features.js","sourceRoot":"","sources":["../../../../../src/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-features.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-cognito-unsimulated-pool-features.js","sourceRoot":"","sources":["../../../../../src/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-features.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAGjF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,qCAAqC;IAC/B,WAAW,CAA6B;IAEzD,YAAY,SAAiB;QAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,0BAA0B,CAAC,SAAS,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,KAAqC;QAC5C,IAAI,CAAC,WAAW,CAAC,MAAM,CACrB,6BAA6B,EAC7B,KAAK,CAAC,2BAA2B,EACjC,0CAA0C,CAC3C,CAAC;QACF,IAAI,CAAC,WAAW,CAAC,MAAM,CACrB,qBAAqB,EACrB,KAAK,CAAC,mBAAmB,EACzB,oBAAoB,CACrB,CAAC;QACF,IAAI,CAAC,WAAW,CAAC,MAAM,CACrB,6CAA6C,EAC7C,KAAK,CAAC,qBAAqB,EAAE,qBAAqB,EAClD,6DAA6D,CAC9D,CAAC;QACF,IAAI,CAAC,WAAW,CAAC,MAAM,CACrB,iDAAiD,EACjD,KAAK,CAAC,qBAAqB,EAAE,yBAAyB,EACtD,gEAAgE,CACjE,CAAC;QACF,IAAI,CAAC,WAAW,CAAC,MAAM,CACrB,gBAAgB,EAChB,KAAK,CAAC,cAAc,EACpB,mBAAmB,CACpB,CAAC;QACF,IAAI,CAAC,WAAW,CAAC,MAAM,CACrB,kBAAkB,EAClB,KAAK,CAAC,gBAAgB,EACtB,yCAAyC,CAC1C,CAAC;QACF,IAAI,CAAC,WAAW,CAAC,MAAM,CACrB,qBAAqB,EACrB,KAAK,CAAC,mBAAmB,EACzB,uBAAuB,CACxB,CAAC;QACF,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,cAAc,EAAE,KAAK,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC;CACF"}
|
|
@@ -11,8 +11,9 @@ export declare class SimCognitoUserPoolView {
|
|
|
11
11
|
/**
|
|
12
12
|
* A pool as `CreateUserPool` and `DescribeUserPool` report it.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* `AccountRecoverySetting` is reported back as the request set it, so a
|
|
15
|
+
* template's declaration stays visible, and only by a pool that was created
|
|
16
|
+
* with one. Nothing here reads it: there is no `ForgotPassword`. The
|
|
16
17
|
* verification wording is reported the same way, and that one the pool does
|
|
17
18
|
* read: it is what the messages it records say.
|
|
18
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cognito-user-pool-view.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/command/user-pool/sim-cognito-user-pool-view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE;;;;;GAKG;AACH,qBAAa,sBAAsB;IACjC
|
|
1
|
+
{"version":3,"file":"sim-cognito-user-pool-view.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/command/user-pool/sim-cognito-user-pool-view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE;;;;;GAKG;AACH,qBAAa,sBAAsB;IACjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,QAAQ,CAAC,IAAI,EAAE,kBAAkB,GAAG,sBAAsB,CAkBzD;IAED;;;OAGG;IACH,SAAS,CAAC,IAAI,EAAE,kBAAkB,GAAG,iCAAiC,CAOrE;CACF"}
|
|
@@ -8,8 +8,9 @@ export class SimCognitoUserPoolView {
|
|
|
8
8
|
/**
|
|
9
9
|
* A pool as `CreateUserPool` and `DescribeUserPool` report it.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* `AccountRecoverySetting` is reported back as the request set it, so a
|
|
12
|
+
* template's declaration stays visible, and only by a pool that was created
|
|
13
|
+
* with one. Nothing here reads it: there is no `ForgotPassword`. The
|
|
13
14
|
* verification wording is reported the same way, and that one the pool does
|
|
14
15
|
* read: it is what the messages it records say.
|
|
15
16
|
*
|
|
@@ -38,6 +39,7 @@ export class SimCognitoUserPoolView {
|
|
|
38
39
|
Id: pool.id,
|
|
39
40
|
Name: pool.name,
|
|
40
41
|
Arn: pool.arn.value,
|
|
42
|
+
AccountRecoverySetting: pool.settings.accountRecovery.toOutput(),
|
|
41
43
|
Policies: { PasswordPolicy: pool.settings.passwordPolicy.toOutput() },
|
|
42
44
|
DeletionProtection: pool.settings.deletionProtection.value,
|
|
43
45
|
LambdaConfig: pool.settings.lambdaConfig.toOutput(),
|
|
@@ -48,7 +50,6 @@ export class SimCognitoUserPoolView {
|
|
|
48
50
|
EstimatedNumberOfUsers: pool.userCount,
|
|
49
51
|
CreationDate: pool.creationDate,
|
|
50
52
|
LastModifiedDate: pool.lastModifiedDate,
|
|
51
|
-
...pool.settings.unsimulated.toOutput(),
|
|
52
53
|
...pool.settings.verificationMessages.toOutput(),
|
|
53
54
|
};
|
|
54
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cognito-user-pool-view.js","sourceRoot":"","sources":["../../../../../src/service/cognito/command/user-pool/sim-cognito-user-pool-view.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,OAAO,sBAAsB;IACjC
|
|
1
|
+
{"version":3,"file":"sim-cognito-user-pool-view.js","sourceRoot":"","sources":["../../../../../src/service/cognito/command/user-pool/sim-cognito-user-pool-view.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,OAAO,sBAAsB;IACjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,QAAQ,CAAC,IAAwB;QAC/B,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK;YACnB,sBAAsB,EAAE,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE;YAChE,QAAQ,EAAE,EAAE,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE,EAAE;YACrE,kBAAkB,EAAE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK;YAC1D,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE;YACnD,gBAAgB,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK;YACvD,qBAAqB,EAAE,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,QAAQ,EAAE;YACrE,sBAAsB,EAAE,IAAI,CAAC,QAAQ,CAAC,sBAAsB,CAAC,QAAQ,EAAE;YACvE,gBAAgB,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE;YACjD,sBAAsB,EAAE,IAAI,CAAC,SAAS;YACtC,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,GAAG,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,EAAE;SACjD,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,IAAwB;QAChC,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;SACxC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { SimResponseMetadata } from "../../../aws/metadata/response-metadata.type.js";
|
|
2
|
+
import type { SimCognitoAccountRecoverySettingType } from "../../user-pool/sim-cognito-account-recovery.js";
|
|
2
3
|
import type { SimCognitoAdminCreateUserConfigType } from "../../user-pool/sim-cognito-admin-create-user-config.js";
|
|
3
4
|
import type { SimCognitoUserPoolPoliciesType } from "../../user-pool/sim-cognito-password-policy.js";
|
|
4
5
|
import type { SimCognitoVerificationMessagesType } from "../../user-pool/message/sim-cognito-verification-messages.js";
|
|
5
|
-
import type { SimCognitoUnsimulatedPoolSettingsType } from "../../user-pool/sim-cognito-unsimulated-pool-settings.js";
|
|
6
6
|
import type { SimCognitoSchemaAttributeType } from "../../user-pool/schema/sim-cognito-schema-attribute.js";
|
|
7
7
|
import type { SimCognitoUserPoolSettingsInput } from "../../user-pool/sim-cognito-user-pool-settings.js";
|
|
8
8
|
import type { SimCognitoLambdaConfigType } from "../../user-pool/trigger/sim-cognito-lambda-config.js";
|
|
@@ -15,10 +15,11 @@ import type { SimCognitoLambdaConfigType } from "../../user-pool/trigger/sim-cog
|
|
|
15
15
|
*
|
|
16
16
|
* https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_UserPoolType.html
|
|
17
17
|
*/
|
|
18
|
-
export interface SimCognitoUserPoolType extends
|
|
18
|
+
export interface SimCognitoUserPoolType extends SimCognitoVerificationMessagesType {
|
|
19
19
|
readonly Id?: string | undefined;
|
|
20
20
|
readonly Name?: string | undefined;
|
|
21
21
|
readonly Arn?: string | undefined;
|
|
22
|
+
readonly AccountRecoverySetting?: SimCognitoAccountRecoverySettingType | undefined;
|
|
22
23
|
readonly Policies?: SimCognitoUserPoolPoliciesType | undefined;
|
|
23
24
|
readonly DeletionProtection?: string | undefined;
|
|
24
25
|
readonly LambdaConfig?: SimCognitoLambdaConfigType | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-pool.command.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/command/user-pool/user-pool.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,KAAK,EAAE,
|
|
1
|
+
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AA6B;IAC5C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1C;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;CACzC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One way a pool offers to recover a forgotten password, and where it comes in
|
|
3
|
+
* the order they are offered.
|
|
4
|
+
*
|
|
5
|
+
* https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_RecoveryOptionType.html
|
|
6
|
+
*/
|
|
7
|
+
export interface SimCognitoRecoveryOptionType {
|
|
8
|
+
readonly Name?: string | undefined;
|
|
9
|
+
readonly Priority?: number | undefined;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The `AccountRecoverySetting` a pool can be created or updated with.
|
|
13
|
+
*
|
|
14
|
+
* https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AccountRecoverySettingType.html
|
|
15
|
+
*/
|
|
16
|
+
export interface SimCognitoAccountRecoverySettingType {
|
|
17
|
+
readonly RecoveryMechanisms?: readonly SimCognitoRecoveryOptionType[] | undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* How a pool recovers an account whose password was forgotten.
|
|
21
|
+
*
|
|
22
|
+
* A pool records the mechanisms it was asked for and `DescribeUserPool`
|
|
23
|
+
* reports them back, which is how a test sees that a template's declaration
|
|
24
|
+
* reached the pool rather than being dropped on the way. Email-only recovery
|
|
25
|
+
* is the setting that goes with a pool that sends no SMS, and it is written as
|
|
26
|
+
* `AccountRecovery.EMAIL_ONLY` by CDK.
|
|
27
|
+
*
|
|
28
|
+
* Nothing reads the mechanisms back out. There is no `ForgotPassword` here, so
|
|
29
|
+
* no recovery is ever started and no mechanism is ever chosen. The refusal
|
|
30
|
+
* belongs at the command that would have to choose one, where it can say what
|
|
31
|
+
* was being attempted, rather than at the pool that named them.
|
|
32
|
+
*
|
|
33
|
+
* The setting is still held to the shape real Cognito states for it, because a
|
|
34
|
+
* pool created outside that shape would exist here and fail to be created on
|
|
35
|
+
* real AWS. A list of mechanisms carries one or two of them, each naming a
|
|
36
|
+
* mechanism Cognito has at a priority of one or two.
|
|
37
|
+
*/
|
|
38
|
+
export declare class SimCognitoAccountRecovery {
|
|
39
|
+
private readonly operation;
|
|
40
|
+
private readonly requested;
|
|
41
|
+
/**
|
|
42
|
+
* The setting the request carried, and the operation a refusal names, which
|
|
43
|
+
* is `CreateUserPool` or `UpdateUserPool`.
|
|
44
|
+
*/
|
|
45
|
+
constructor(requested: SimCognitoAccountRecoverySettingType | undefined, operation: string);
|
|
46
|
+
/**
|
|
47
|
+
* This setting as a described pool reports it, or nothing where the request
|
|
48
|
+
* named none.
|
|
49
|
+
*
|
|
50
|
+
* A pool created without one describes without it, rather than describing
|
|
51
|
+
* the mechanisms real Cognito would have given it. Nothing here recovers an
|
|
52
|
+
* account, so reporting a default would say the pool had chosen something it
|
|
53
|
+
* never chose.
|
|
54
|
+
*/
|
|
55
|
+
toOutput(): SimCognitoAccountRecoverySettingType | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* The setting copied out of the request rather than kept by reference, once
|
|
58
|
+
* it says what real Cognito would have accepted.
|
|
59
|
+
*
|
|
60
|
+
* The copy goes all the way down, so a described pool reports what the
|
|
61
|
+
* request said at the time it was made even where the caller edits the
|
|
62
|
+
* object afterwards to create a second pool from it.
|
|
63
|
+
*
|
|
64
|
+
* A setting naming no mechanisms at all is left alone. Real Cognito states
|
|
65
|
+
* `RecoveryMechanisms` as optional, and a list is only held to its bounds
|
|
66
|
+
* where the request wrote one.
|
|
67
|
+
*/
|
|
68
|
+
private accepted;
|
|
69
|
+
/**
|
|
70
|
+
* Refuse a list of mechanisms real Cognito would refuse for its length.
|
|
71
|
+
*
|
|
72
|
+
* There are three mechanisms and a pool ranks at most two of them, so an
|
|
73
|
+
* empty list and a list of all three are both outside what Cognito takes.
|
|
74
|
+
*/
|
|
75
|
+
private requireOneOrTwo;
|
|
76
|
+
/**
|
|
77
|
+
* Refuse a mechanism real Cognito would refuse.
|
|
78
|
+
*/
|
|
79
|
+
private requireMechanism;
|
|
80
|
+
/**
|
|
81
|
+
* The refusal this setting answers with, named after the operation that
|
|
82
|
+
* carried it.
|
|
83
|
+
*/
|
|
84
|
+
private refuse;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=sim-cognito-account-recovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-cognito-account-recovery.d.ts","sourceRoot":"","sources":["../../../../src/service/cognito/user-pool/sim-cognito-account-recovery.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC;AAED;;;;GAIG;AACH,MAAM,WAAW,oCAAoC;IACnD,QAAQ,CAAC,kBAAkB,CAAC,EACxB,SAAS,4BAA4B,EAAE,GACvC,SAAS,CAAC;CACf;AAqBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,yBAAyB;IACpC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAmD;IAE7E;;;OAGG;IACH,YACE,SAAS,EAAE,oCAAoC,GAAG,SAAS,EAC3D,SAAS,EAAE,MAAM,EAIlB;IAED;;;;;;;;OAQG;IACH,QAAQ,IAAI,oCAAoC,GAAG,SAAS,CAM3D;IAED;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,QAAQ;IAoBhB;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IAavB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAuBxB;;;OAGG;IACH,OAAO,CAAC,MAAM;CAKf"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { SimCognitoInvalidParameterException } from "../error/sim-cognito.error.js";
|
|
2
|
+
/**
|
|
3
|
+
* The mechanisms Cognito recovers an account through.
|
|
4
|
+
*
|
|
5
|
+
* `admin_only` is the one that recovers nothing by itself: it says a user
|
|
6
|
+
* cannot start a recovery at all, and an administrator resets the password
|
|
7
|
+
* instead. CDK writes it for `AccountRecovery.NONE`.
|
|
8
|
+
*/
|
|
9
|
+
const recoveryMechanismNames = [
|
|
10
|
+
"verified_email",
|
|
11
|
+
"verified_phone_number",
|
|
12
|
+
"admin_only",
|
|
13
|
+
];
|
|
14
|
+
/**
|
|
15
|
+
* The priorities Cognito takes, which is one for the mechanism it tries first
|
|
16
|
+
* and two for the one it falls back to.
|
|
17
|
+
*/
|
|
18
|
+
const recoveryPriorities = new Set([1, 2]);
|
|
19
|
+
/**
|
|
20
|
+
* How a pool recovers an account whose password was forgotten.
|
|
21
|
+
*
|
|
22
|
+
* A pool records the mechanisms it was asked for and `DescribeUserPool`
|
|
23
|
+
* reports them back, which is how a test sees that a template's declaration
|
|
24
|
+
* reached the pool rather than being dropped on the way. Email-only recovery
|
|
25
|
+
* is the setting that goes with a pool that sends no SMS, and it is written as
|
|
26
|
+
* `AccountRecovery.EMAIL_ONLY` by CDK.
|
|
27
|
+
*
|
|
28
|
+
* Nothing reads the mechanisms back out. There is no `ForgotPassword` here, so
|
|
29
|
+
* no recovery is ever started and no mechanism is ever chosen. The refusal
|
|
30
|
+
* belongs at the command that would have to choose one, where it can say what
|
|
31
|
+
* was being attempted, rather than at the pool that named them.
|
|
32
|
+
*
|
|
33
|
+
* The setting is still held to the shape real Cognito states for it, because a
|
|
34
|
+
* pool created outside that shape would exist here and fail to be created on
|
|
35
|
+
* real AWS. A list of mechanisms carries one or two of them, each naming a
|
|
36
|
+
* mechanism Cognito has at a priority of one or two.
|
|
37
|
+
*/
|
|
38
|
+
export class SimCognitoAccountRecovery {
|
|
39
|
+
operation;
|
|
40
|
+
requested;
|
|
41
|
+
/**
|
|
42
|
+
* The setting the request carried, and the operation a refusal names, which
|
|
43
|
+
* is `CreateUserPool` or `UpdateUserPool`.
|
|
44
|
+
*/
|
|
45
|
+
constructor(requested, operation) {
|
|
46
|
+
this.operation = operation;
|
|
47
|
+
this.requested = this.accepted(requested);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* This setting as a described pool reports it, or nothing where the request
|
|
51
|
+
* named none.
|
|
52
|
+
*
|
|
53
|
+
* A pool created without one describes without it, rather than describing
|
|
54
|
+
* the mechanisms real Cognito would have given it. Nothing here recovers an
|
|
55
|
+
* account, so reporting a default would say the pool had chosen something it
|
|
56
|
+
* never chose.
|
|
57
|
+
*/
|
|
58
|
+
toOutput() {
|
|
59
|
+
if (this.requested === undefined) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
return structuredClone(this.requested);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The setting copied out of the request rather than kept by reference, once
|
|
66
|
+
* it says what real Cognito would have accepted.
|
|
67
|
+
*
|
|
68
|
+
* The copy goes all the way down, so a described pool reports what the
|
|
69
|
+
* request said at the time it was made even where the caller edits the
|
|
70
|
+
* object afterwards to create a second pool from it.
|
|
71
|
+
*
|
|
72
|
+
* A setting naming no mechanisms at all is left alone. Real Cognito states
|
|
73
|
+
* `RecoveryMechanisms` as optional, and a list is only held to its bounds
|
|
74
|
+
* where the request wrote one.
|
|
75
|
+
*/
|
|
76
|
+
accepted(requested) {
|
|
77
|
+
if (requested === undefined) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
const mechanisms = requested.RecoveryMechanisms;
|
|
81
|
+
if (mechanisms !== undefined) {
|
|
82
|
+
this.requireOneOrTwo(mechanisms);
|
|
83
|
+
for (const mechanism of mechanisms) {
|
|
84
|
+
this.requireMechanism(mechanism);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return structuredClone(requested);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Refuse a list of mechanisms real Cognito would refuse for its length.
|
|
91
|
+
*
|
|
92
|
+
* There are three mechanisms and a pool ranks at most two of them, so an
|
|
93
|
+
* empty list and a list of all three are both outside what Cognito takes.
|
|
94
|
+
*/
|
|
95
|
+
requireOneOrTwo(mechanisms) {
|
|
96
|
+
if (mechanisms.length > 0 && mechanisms.length <= 2) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
throw this.refuse(`RecoveryMechanisms lists ${String(mechanisms.length)} mechanisms: ` +
|
|
100
|
+
`Cognito takes one or two`);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Refuse a mechanism real Cognito would refuse.
|
|
104
|
+
*/
|
|
105
|
+
requireMechanism(mechanism) {
|
|
106
|
+
if (mechanism.Name === undefined) {
|
|
107
|
+
throw this.refuse("RecoveryMechanisms has a mechanism with no Name");
|
|
108
|
+
}
|
|
109
|
+
if (!recoveryMechanismNames.includes(mechanism.Name)) {
|
|
110
|
+
throw this.refuse(`RecoveryMechanisms '${mechanism.Name}' is not a Cognito account ` +
|
|
111
|
+
`recovery mechanism: use ${recoveryMechanismNames.join(", ")}`);
|
|
112
|
+
}
|
|
113
|
+
if (mechanism.Priority === undefined ||
|
|
114
|
+
!recoveryPriorities.has(mechanism.Priority)) {
|
|
115
|
+
throw this.refuse(`RecoveryMechanisms '${mechanism.Name}' has a Priority of ` +
|
|
116
|
+
`${String(mechanism.Priority)}: Cognito takes 1 or 2`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* The refusal this setting answers with, named after the operation that
|
|
121
|
+
* carried it.
|
|
122
|
+
*/
|
|
123
|
+
refuse(problem) {
|
|
124
|
+
return new SimCognitoInvalidParameterException(`${this.operation} AccountRecoverySetting ${problem}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=sim-cognito-account-recovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-cognito-account-recovery.js","sourceRoot":"","sources":["../../../../src/service/cognito/user-pool/sim-cognito-account-recovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mCAAmC,EAAE,MAAM,+BAA+B,CAAC;AAwBpF;;;;;;GAMG;AACH,MAAM,sBAAsB,GAAsB;IAChD,gBAAgB;IAChB,uBAAuB;IACvB,YAAY;CACb,CAAC;AAEF;;;GAGG;AACH,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEhE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,yBAAyB;IACnB,SAAS,CAAS;IAClB,SAAS,CAAmD;IAE7E;;;OAGG;IACH,YACE,SAA2D,EAC3D,SAAiB;QAEjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC;IAED;;;;;;;;OAQG;IACH,QAAQ;QACN,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;YACjC,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;IAED;;;;;;;;;;;OAWG;IACK,QAAQ,CACd,SAA2D;QAE3D,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,UAAU,GAAG,SAAS,CAAC,kBAAkB,CAAC;QAEhD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;YAEjC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;gBACnC,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;QAED,OAAO,eAAe,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IAED;;;;;OAKG;IACK,eAAe,CACrB,UAAmD;QAEnD,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YACpD,OAAO;QACT,CAAC;QAED,MAAM,IAAI,CAAC,MAAM,CACf,4BAA4B,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,eAAe;YAClE,0BAA0B,CAC7B,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,gBAAgB,CAAC,SAAuC;QAC9D,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YACjC,MAAM,IAAI,CAAC,MAAM,CAAC,iDAAiD,CAAC,CAAC;QACvE,CAAC;QAED,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;YACrD,MAAM,IAAI,CAAC,MAAM,CACf,uBAAuB,SAAS,CAAC,IAAI,6BAA6B;gBAChE,2BAA2B,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACjE,CAAC;QACJ,CAAC;QAED,IACE,SAAS,CAAC,QAAQ,KAAK,SAAS;YAChC,CAAC,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,EAC3C,CAAC;YACD,MAAM,IAAI,CAAC,MAAM,CACf,uBAAuB,SAAS,CAAC,IAAI,sBAAsB;gBACzD,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,wBAAwB,CACxD,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;;OAGG;IACK,MAAM,CAAC,OAAe;QAC5B,OAAO,IAAI,mCAAmC,CAC5C,GAAG,IAAI,CAAC,SAAS,2BAA2B,OAAO,EAAE,CACtD,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { SimCognitoAccountRecovery, type SimCognitoAccountRecoverySettingType } from "./sim-cognito-account-recovery.js";
|
|
1
2
|
import { SimCognitoAdminCreateUserConfig, type SimCognitoAdminCreateUserConfigType } from "./sim-cognito-admin-create-user-config.js";
|
|
2
3
|
import { SimCognitoAutoVerifiedAttributes } from "./sim-cognito-auto-verified-attributes.js";
|
|
3
4
|
import { SimCognitoDeletionProtection } from "./sim-cognito-deletion-protection.js";
|
|
4
5
|
import { SimCognitoUserPoolMfa } from "./mfa/sim-cognito-user-pool-mfa.js";
|
|
5
6
|
import { SimCognitoPasswordPolicy, type SimCognitoUserPoolPoliciesType } from "./sim-cognito-password-policy.js";
|
|
6
7
|
import { SimCognitoVerificationMessages, type SimCognitoVerificationMessagesType } from "./message/sim-cognito-verification-messages.js";
|
|
7
|
-
import { SimCognitoUnsimulatedPoolSettings, type SimCognitoUnsimulatedPoolSettingsType } from "./sim-cognito-unsimulated-pool-settings.js";
|
|
8
8
|
import type { SimCognitoSchemaAttributeType } from "./schema/sim-cognito-schema-attribute.js";
|
|
9
9
|
import { SimCognitoUserPoolSchema } from "./schema/sim-cognito-user-pool-schema.js";
|
|
10
10
|
import { SimCognitoLambdaConfig } from "./trigger/sim-cognito-lambda-config.js";
|
|
@@ -14,7 +14,8 @@ import { SimCognitoLambdaConfig } from "./trigger/sim-cognito-lambda-config.js";
|
|
|
14
14
|
* `CreateUserPool` and `UpdateUserPool` both carry these, which is what lets
|
|
15
15
|
* an update build a pool's settings the same way a creation does.
|
|
16
16
|
*/
|
|
17
|
-
export interface SimCognitoUserPoolSettingsInput extends
|
|
17
|
+
export interface SimCognitoUserPoolSettingsInput extends SimCognitoVerificationMessagesType {
|
|
18
|
+
readonly AccountRecoverySetting?: SimCognitoAccountRecoverySettingType | undefined;
|
|
18
19
|
readonly Policies?: SimCognitoUserPoolPoliciesType | undefined;
|
|
19
20
|
readonly DeletionProtection?: string | undefined;
|
|
20
21
|
readonly MfaConfiguration?: string | undefined;
|
|
@@ -43,7 +44,8 @@ interface SimCognitoUserPoolSettingsProperties {
|
|
|
43
44
|
* The settings of one simulated user pool that a request can change: the
|
|
44
45
|
* password policy, the deletion protection, whether users may sign themselves
|
|
45
46
|
* up, what confirming a sign-up verifies, the Lambda triggers the pool runs,
|
|
46
|
-
* whether it asks for a second factor and what its
|
|
47
|
+
* whether it asks for a second factor, how it recovers an account and what its
|
|
48
|
+
* messages say.
|
|
47
49
|
*
|
|
48
50
|
* The pool's id, ARN and name are not among them. The first two identify the
|
|
49
51
|
* pool, and renaming one is not simulated.
|
|
@@ -84,10 +86,10 @@ export declare class SimCognitoUserPoolSettings {
|
|
|
84
86
|
*/
|
|
85
87
|
readonly verificationMessages: SimCognitoVerificationMessages;
|
|
86
88
|
/**
|
|
87
|
-
*
|
|
88
|
-
* reports it.
|
|
89
|
+
* How the pool recovers an account whose password was forgotten, kept so a
|
|
90
|
+
* described pool reports it. Nothing here starts a recovery.
|
|
89
91
|
*/
|
|
90
|
-
readonly
|
|
92
|
+
readonly accountRecovery: SimCognitoAccountRecovery;
|
|
91
93
|
constructor(properties: SimCognitoUserPoolSettingsProperties);
|
|
92
94
|
/**
|
|
93
95
|
* The attributes the pool holds on its users: the standard ones, and the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cognito-user-pool-settings.d.ts","sourceRoot":"","sources":["../../../../src/service/cognito/user-pool/sim-cognito-user-pool-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,KAAK,mCAAmC,EACzC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAEpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EACL,wBAAwB,EACxB,KAAK,8BAA8B,EACpC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,8BAA8B,EAC9B,KAAK,kCAAkC,EACxC,MAAM,gDAAgD,CAAC;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"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AAS,CAAC;IAE3C;;;;;;;OAOG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,6BAA6B,EAAE,GAAG,SAAS,CAAC;CACxE;AAED,UAAU,oCAAoC;IAC5C,QAAQ,CAAC,KAAK,EAAE,+BAA+B,CAAC;IAEhD;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,0BAA0B;;IACrC,SAAgB,cAAc,EAAE,wBAAwB,CAAC;IACzD,SAAgB,kBAAkB,EAAE,4BAA4B,CAAC;IACjE,SAAgB,qBAAqB,EAAE,+BAA+B,CAAC;IACvE,SAAgB,sBAAsB,EAAE,gCAAgC,CAAC;IAEzE;;OAEG;IACH,SAAgB,YAAY,EAAE,sBAAsB,CAAC;IAErD;;;;;;;;;OASG;IACH,SAAgB,GAAG,EAAE,qBAAqB,CAAC;IAE3C;;OAEG;IACH,SAAgB,oBAAoB,EAAE,8BAA8B,CAAC;IAErE;;;OAGG;IACH,SAAgB,eAAe,EAAE,yBAAyB,CAAC;IAI3D,YAAY,UAAU,EAAE,oCAAoC,EA4B3D;IAED;;;OAGG;IACH,IAAI,MAAM,IAAI,wBAAwB,CAErC;IAED;;;;;;;OAOG;IACH,YAAY,CAAC,QAAQ,EAAE,0BAA0B,GAAG,IAAI,CAEvD;CACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SimCognitoAccountRecovery, } from "./sim-cognito-account-recovery.js";
|
|
1
2
|
import { SimCognitoAdminCreateUserConfig, } from "./sim-cognito-admin-create-user-config.js";
|
|
2
3
|
import { SimCognitoAutoVerifiedAttributes } from "./sim-cognito-auto-verified-attributes.js";
|
|
3
4
|
import { SimCognitoDeletionProtection } from "./sim-cognito-deletion-protection.js";
|
|
@@ -5,14 +6,14 @@ import { SimCognitoMfaConfiguration } from "./mfa/sim-cognito-mfa-configuration.
|
|
|
5
6
|
import { SimCognitoUserPoolMfa } from "./mfa/sim-cognito-user-pool-mfa.js";
|
|
6
7
|
import { SimCognitoPasswordPolicy, } from "./sim-cognito-password-policy.js";
|
|
7
8
|
import { SimCognitoVerificationMessages, } from "./message/sim-cognito-verification-messages.js";
|
|
8
|
-
import { SimCognitoUnsimulatedPoolSettings, } from "./sim-cognito-unsimulated-pool-settings.js";
|
|
9
9
|
import { SimCognitoUserPoolSchema } from "./schema/sim-cognito-user-pool-schema.js";
|
|
10
10
|
import { SimCognitoLambdaConfig } from "./trigger/sim-cognito-lambda-config.js";
|
|
11
11
|
/**
|
|
12
12
|
* The settings of one simulated user pool that a request can change: the
|
|
13
13
|
* password policy, the deletion protection, whether users may sign themselves
|
|
14
14
|
* up, what confirming a sign-up verifies, the Lambda triggers the pool runs,
|
|
15
|
-
* whether it asks for a second factor and what its
|
|
15
|
+
* whether it asks for a second factor, how it recovers an account and what its
|
|
16
|
+
* messages say.
|
|
16
17
|
*
|
|
17
18
|
* The pool's id, ARN and name are not among them. The first two identify the
|
|
18
19
|
* pool, and renaming one is not simulated.
|
|
@@ -52,10 +53,10 @@ export class SimCognitoUserPoolSettings {
|
|
|
52
53
|
*/
|
|
53
54
|
verificationMessages;
|
|
54
55
|
/**
|
|
55
|
-
*
|
|
56
|
-
* reports it.
|
|
56
|
+
* How the pool recovers an account whose password was forgotten, kept so a
|
|
57
|
+
* described pool reports it. Nothing here starts a recovery.
|
|
57
58
|
*/
|
|
58
|
-
|
|
59
|
+
accountRecovery;
|
|
59
60
|
#schema;
|
|
60
61
|
constructor(properties) {
|
|
61
62
|
const { input, operation } = properties;
|
|
@@ -66,7 +67,7 @@ export class SimCognitoUserPoolSettings {
|
|
|
66
67
|
this.lambdaConfig = new SimCognitoLambdaConfig(input.LambdaConfig, operation);
|
|
67
68
|
this.mfa = new SimCognitoUserPoolMfa(new SimCognitoMfaConfiguration(input.MfaConfiguration));
|
|
68
69
|
this.verificationMessages = new SimCognitoVerificationMessages(input);
|
|
69
|
-
this.
|
|
70
|
+
this.accountRecovery = new SimCognitoAccountRecovery(input.AccountRecoverySetting, operation);
|
|
70
71
|
this.#schema = new SimCognitoUserPoolSchema(input.Schema);
|
|
71
72
|
}
|
|
72
73
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cognito-user-pool-settings.js","sourceRoot":"","sources":["../../../../src/service/cognito/user-pool/sim-cognito-user-pool-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,GAEhC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EACL,wBAAwB,GAEzB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,8BAA8B,GAE/B,MAAM,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-cognito-user-pool-settings.js","sourceRoot":"","sources":["../../../../src/service/cognito/user-pool/sim-cognito-user-pool-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,GAE1B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,+BAA+B,GAEhC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EACL,wBAAwB,GAEzB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,8BAA8B,GAE/B,MAAM,gDAAgD,CAAC;AAExD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,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C,CAAC;IAC5D,CAAC;IAED;;;OAGG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED;;;;;;;OAOG;IACH,YAAY,CAAC,QAAoC;QAC/C,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC;IACjC,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A request value rendered in a form two of them can be compared by.
|
|
3
|
-
*
|
|
4
|
-
* A structured input arrives as plain JSON, from a template or from an SDK
|
|
5
|
-
* call, and the order its keys were written in carries no meaning. Rendering
|
|
6
|
-
* it with the keys in a fixed order makes two values that say the same thing
|
|
7
|
-
* render the same, and gives a refusal something readable to print back.
|
|
8
|
-
*/
|
|
9
|
-
export declare class SimCognitoCanonicalValue {
|
|
10
|
-
private readonly value;
|
|
11
|
-
constructor(value: unknown);
|
|
12
|
-
/**
|
|
13
|
-
* The rendered value.
|
|
14
|
-
*/
|
|
15
|
-
get text(): string;
|
|
16
|
-
/**
|
|
17
|
-
* Whether this value says the same thing as another.
|
|
18
|
-
*/
|
|
19
|
-
matches(other: unknown): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* The value with every object's keys in a fixed order.
|
|
22
|
-
*
|
|
23
|
-
* A list keeps the order it arrived in, because the order of a list is part
|
|
24
|
-
* of what it says. An object's is not.
|
|
25
|
-
*/
|
|
26
|
-
private ordered;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=sim-cognito-canonical-value.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cognito-canonical-value.d.ts","sourceRoot":"","sources":["../../../../src/service/cognito/command/sim-cognito-canonical-value.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;IAEhC,YAAY,KAAK,EAAE,OAAO,EAEzB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE/B;IAED;;;;;OAKG;IACH,OAAO,CAAC,OAAO;CAehB"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A request value rendered in a form two of them can be compared by.
|
|
3
|
-
*
|
|
4
|
-
* A structured input arrives as plain JSON, from a template or from an SDK
|
|
5
|
-
* call, and the order its keys were written in carries no meaning. Rendering
|
|
6
|
-
* it with the keys in a fixed order makes two values that say the same thing
|
|
7
|
-
* render the same, and gives a refusal something readable to print back.
|
|
8
|
-
*/
|
|
9
|
-
export class SimCognitoCanonicalValue {
|
|
10
|
-
value;
|
|
11
|
-
constructor(value) {
|
|
12
|
-
this.value = value;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* The rendered value.
|
|
16
|
-
*/
|
|
17
|
-
get text() {
|
|
18
|
-
return JSON.stringify(this.ordered(this.value));
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Whether this value says the same thing as another.
|
|
22
|
-
*/
|
|
23
|
-
matches(other) {
|
|
24
|
-
return this.text === new SimCognitoCanonicalValue(other).text;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* The value with every object's keys in a fixed order.
|
|
28
|
-
*
|
|
29
|
-
* A list keeps the order it arrived in, because the order of a list is part
|
|
30
|
-
* of what it says. An object's is not.
|
|
31
|
-
*/
|
|
32
|
-
ordered(value) {
|
|
33
|
-
if (Array.isArray(value)) {
|
|
34
|
-
return value.map((item) => this.ordered(item));
|
|
35
|
-
}
|
|
36
|
-
if (typeof value !== "object" || value === null) {
|
|
37
|
-
return value;
|
|
38
|
-
}
|
|
39
|
-
return Object.fromEntries(Object.entries(value)
|
|
40
|
-
.toSorted(([left], [right]) => left.localeCompare(right))
|
|
41
|
-
.map(([key, nested]) => [key, this.ordered(nested)]));
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=sim-cognito-canonical-value.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cognito-canonical-value.js","sourceRoot":"","sources":["../../../../src/service/cognito/command/sim-cognito-canonical-value.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,OAAO,wBAAwB;IAClB,KAAK,CAAU;IAEhC,YAAY,KAAc;QACxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,KAAc;QACpB,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,wBAAwB,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;IAChE,CAAC;IAED;;;;;OAKG;IACK,OAAO,CAAC,KAAc;QAC5B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAa,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1D,CAAC;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YAChD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;aAClB,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;aACxD,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CACvD,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Refuses a structured request input set to anything but the one value this
|
|
3
|
-
* simulation models.
|
|
4
|
-
*
|
|
5
|
-
* This is what `SimCognitoUnsimulatedInput.refuseUnless` does for a string
|
|
6
|
-
* or a boolean. That one compares with `===`, which answers false for
|
|
7
|
-
* two objects saying the same thing, so a property arriving as an object
|
|
8
|
-
* needs comparing by its contents instead. The comparison is the whole of the
|
|
9
|
-
* difference, so it lives beside the existing refusals rather than inside
|
|
10
|
-
* them.
|
|
11
|
-
*/
|
|
12
|
-
export declare class SimCognitoUnsimulatedStructure {
|
|
13
|
-
private readonly operation;
|
|
14
|
-
constructor(operation: string);
|
|
15
|
-
/**
|
|
16
|
-
* Refuse a structured input that is not the one this simulation models.
|
|
17
|
-
*
|
|
18
|
-
* Every key is compared, so an object carrying an extra one is refused even
|
|
19
|
-
* where the keys it shares with the simulated value all match.
|
|
20
|
-
*/
|
|
21
|
-
refuseUnless(option: string, value: object | undefined, simulated: object, feature: string): void;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=sim-cognito-unsimulated-structure.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cognito-unsimulated-structure.d.ts","sourceRoot":"","sources":["../../../../src/service/cognito/command/sim-cognito-unsimulated-structure.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,qBAAa,8BAA8B;IACzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED;;;;;OAKG;IACH,YAAY,CACV,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,IAAI,CAgBN;CACF"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { SimCognitoInvalidParameterException } from "../error/sim-cognito.error.js";
|
|
2
|
-
import { SimCognitoCanonicalValue } from "./sim-cognito-canonical-value.js";
|
|
3
|
-
/**
|
|
4
|
-
* Refuses a structured request input set to anything but the one value this
|
|
5
|
-
* simulation models.
|
|
6
|
-
*
|
|
7
|
-
* This is what `SimCognitoUnsimulatedInput.refuseUnless` does for a string
|
|
8
|
-
* or a boolean. That one compares with `===`, which answers false for
|
|
9
|
-
* two objects saying the same thing, so a property arriving as an object
|
|
10
|
-
* needs comparing by its contents instead. The comparison is the whole of the
|
|
11
|
-
* difference, so it lives beside the existing refusals rather than inside
|
|
12
|
-
* them.
|
|
13
|
-
*/
|
|
14
|
-
export class SimCognitoUnsimulatedStructure {
|
|
15
|
-
operation;
|
|
16
|
-
constructor(operation) {
|
|
17
|
-
this.operation = operation;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Refuse a structured input that is not the one this simulation models.
|
|
21
|
-
*
|
|
22
|
-
* Every key is compared, so an object carrying an extra one is refused even
|
|
23
|
-
* where the keys it shares with the simulated value all match.
|
|
24
|
-
*/
|
|
25
|
-
refuseUnless(option, value, simulated, feature) {
|
|
26
|
-
if (value === undefined) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const simulatedValue = new SimCognitoCanonicalValue(simulated);
|
|
30
|
-
if (simulatedValue.matches(value)) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
throw new SimCognitoInvalidParameterException(`${this.operation} ${option} ${new SimCognitoCanonicalValue(value).text}` +
|
|
34
|
-
` is not simulated: ${feature} would be ignored here and applied on ` +
|
|
35
|
-
`real AWS. Only ${simulatedValue.text} is supported.`);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=sim-cognito-unsimulated-structure.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cognito-unsimulated-structure.js","sourceRoot":"","sources":["../../../../src/service/cognito/command/sim-cognito-unsimulated-structure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mCAAmC,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAE5E;;;;;;;;;;GAUG;AACH,MAAM,OAAO,8BAA8B;IACxB,SAAS,CAAS;IAEnC,YAAY,SAAiB;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED;;;;;OAKG;IACH,YAAY,CACV,MAAc,EACd,KAAyB,EACzB,SAAiB,EACjB,OAAe;QAEf,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO;QACT,CAAC;QAED,MAAM,cAAc,GAAG,IAAI,wBAAwB,CAAC,SAAS,CAAC,CAAC;QAE/D,IAAI,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAClC,OAAO;QACT,CAAC;QAED,MAAM,IAAI,mCAAmC,CAC3C,GAAG,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,IAAI,wBAAwB,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE;YACvE,sBAAsB,OAAO,wCAAwC;YACrE,kBAAkB,cAAc,CAAC,IAAI,gBAAgB,CACxD,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The pool settings a request may set that this simulation does not act on.
|
|
3
|
-
*
|
|
4
|
-
* These are the ones `CreateUserPool` accepts at one value each, in the shape
|
|
5
|
-
* a described pool reports them in.
|
|
6
|
-
*/
|
|
7
|
-
export interface SimCognitoUnsimulatedPoolSettingsType {
|
|
8
|
-
readonly AccountRecoverySetting?: object | undefined;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* The settings a pool was created with and this simulation does not act on.
|
|
12
|
-
*
|
|
13
|
-
* `AccountRecoverySetting` chooses how a forgotten password is recovered, and
|
|
14
|
-
* there is no `ForgotPassword` command here, so nothing reads it back out. It
|
|
15
|
-
* is kept so `DescribeUserPool` reports what the request set, which is how a
|
|
16
|
-
* test can see that a template's declaration reached the pool rather than
|
|
17
|
-
* being dropped on the way.
|
|
18
|
-
*
|
|
19
|
-
* Only what the request set is reported. A pool created without one of these
|
|
20
|
-
* describes without it, rather than describing it as the value the request
|
|
21
|
-
* would have needed to use.
|
|
22
|
-
*/
|
|
23
|
-
export declare class SimCognitoUnsimulatedPoolSettings {
|
|
24
|
-
private readonly settings;
|
|
25
|
-
constructor(settings: SimCognitoUnsimulatedPoolSettingsType);
|
|
26
|
-
/**
|
|
27
|
-
* These settings as a described pool reports them.
|
|
28
|
-
*/
|
|
29
|
-
toOutput(): SimCognitoUnsimulatedPoolSettingsType;
|
|
30
|
-
/**
|
|
31
|
-
* The settings this holds, copied out of the request rather than kept by
|
|
32
|
-
* reference.
|
|
33
|
-
*
|
|
34
|
-
* A caller passes its whole `CreateUserPool` input in, and may reuse or
|
|
35
|
-
* edit that object afterwards. This one is a nested object, so the copy goes
|
|
36
|
-
* all the way down. Copying means a described pool reports what the request
|
|
37
|
-
* said at the time it was made, as a real one does.
|
|
38
|
-
*
|
|
39
|
-
* The setting is kept only where the request set it, so a pool created
|
|
40
|
-
* without it describes without it rather than describing it as the value
|
|
41
|
-
* the request would have needed to use.
|
|
42
|
-
*/
|
|
43
|
-
private accepted;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=sim-cognito-unsimulated-pool-settings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cognito-unsimulated-pool-settings.d.ts","sourceRoot":"","sources":["../../../../src/service/cognito/user-pool/sim-cognito-unsimulated-pool-settings.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,qCAAqC;IACpD,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtD;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,iCAAiC;IAC5C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwC;IAEjE,YAAY,QAAQ,EAAE,qCAAqC,EAE1D;IAED;;OAEG;IACH,QAAQ,IAAI,qCAAqC,CAEhD;IAED;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,QAAQ;CASjB"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The settings a pool was created with and this simulation does not act on.
|
|
3
|
-
*
|
|
4
|
-
* `AccountRecoverySetting` chooses how a forgotten password is recovered, and
|
|
5
|
-
* there is no `ForgotPassword` command here, so nothing reads it back out. It
|
|
6
|
-
* is kept so `DescribeUserPool` reports what the request set, which is how a
|
|
7
|
-
* test can see that a template's declaration reached the pool rather than
|
|
8
|
-
* being dropped on the way.
|
|
9
|
-
*
|
|
10
|
-
* Only what the request set is reported. A pool created without one of these
|
|
11
|
-
* describes without it, rather than describing it as the value the request
|
|
12
|
-
* would have needed to use.
|
|
13
|
-
*/
|
|
14
|
-
export class SimCognitoUnsimulatedPoolSettings {
|
|
15
|
-
settings;
|
|
16
|
-
constructor(settings) {
|
|
17
|
-
this.settings = this.accepted(settings);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* These settings as a described pool reports them.
|
|
21
|
-
*/
|
|
22
|
-
toOutput() {
|
|
23
|
-
return structuredClone(this.settings);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* The settings this holds, copied out of the request rather than kept by
|
|
27
|
-
* reference.
|
|
28
|
-
*
|
|
29
|
-
* A caller passes its whole `CreateUserPool` input in, and may reuse or
|
|
30
|
-
* edit that object afterwards. This one is a nested object, so the copy goes
|
|
31
|
-
* all the way down. Copying means a described pool reports what the request
|
|
32
|
-
* said at the time it was made, as a real one does.
|
|
33
|
-
*
|
|
34
|
-
* The setting is kept only where the request set it, so a pool created
|
|
35
|
-
* without it describes without it rather than describing it as the value
|
|
36
|
-
* the request would have needed to use.
|
|
37
|
-
*/
|
|
38
|
-
accepted(settings) {
|
|
39
|
-
return structuredClone({
|
|
40
|
-
...(settings.AccountRecoverySetting !== undefined && {
|
|
41
|
-
AccountRecoverySetting: settings.AccountRecoverySetting,
|
|
42
|
-
}),
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=sim-cognito-unsimulated-pool-settings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cognito-unsimulated-pool-settings.js","sourceRoot":"","sources":["../../../../src/service/cognito/user-pool/sim-cognito-unsimulated-pool-settings.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,iCAAiC;IAC3B,QAAQ,CAAwC;IAEjE,YAAY,QAA+C;QACzD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED;;;;;;;;;;;;OAYG;IACK,QAAQ,CACd,QAA+C;QAE/C,OAAO,eAAe,CAAC;YACrB,GAAG,CAAC,QAAQ,CAAC,sBAAsB,KAAK,SAAS,IAAI;gBACnD,sBAAsB,EAAE,QAAQ,CAAC,sBAAsB;aACxD,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF"}
|