@ttoss/cloud-auth 0.8.1 → 0.8.3
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/.turbo/turbo-build.log +7 -6
- package/.turbo/turbo-test.log +8 -8
- package/CHANGELOG.md +12 -0
- package/coverage/clover.xml +2 -2
- package/coverage/lcov-report/config.ts.html +1 -1
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/index.ts.html +1 -1
- package/coverage/lcov-report/template.ts.html +1 -1
- package/dist/esm/index.js +61 -69
- package/dist/index.js +73 -72
- package/package.json +6 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -2,16 +2,17 @@ warning package.json: No license field
|
|
|
2
2
|
$ tsup
|
|
3
3
|
[34mCLI[39m Building entry: src/index.ts
|
|
4
4
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
5
|
-
[34mCLI[39m tsup v6.
|
|
5
|
+
[34mCLI[39m tsup v6.7.0
|
|
6
6
|
[34mCLI[39m Using tsup config: /home/runner/work/ttoss/ttoss/packages/cloud-auth/tsup.config.ts
|
|
7
7
|
[34mCLI[39m Target: es2021
|
|
8
8
|
[34mCLI[39m Cleaning output folder
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[32mCJS[39m [1mdist/index.js [22m[32m8.74 KB[39m
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in 59ms
|
|
13
|
-
[32mESM[39m [1mdist/esm/index.js [22m[32m7.68 KB[39m
|
|
14
|
-
[32mESM[39m ⚡️ Build success in 54ms
|
|
15
11
|
[34mDTS[39m Build start
|
|
16
|
-
|
|
12
|
+
Dynamic import can only be supported when transforming ES modules to AMD, CommonJS or SystemJS. Only the parser plugin will be enabled.
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m8.61 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 6371ms
|
|
15
|
+
[32mESM[39m [1mdist/esm/index.js [22m[32m7.53 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 6372ms
|
|
17
|
+
[32mDTS[39m ⚡️ Build success in 16609ms
|
|
17
18
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m1.56 KB[39m
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
warning package.json: No license field
|
|
2
2
|
$ jest
|
|
3
|
-
PASS tests/unit/template.test.ts
|
|
3
|
+
PASS tests/unit/template.test.ts (5.491 s)
|
|
4
4
|
user pool
|
|
5
|
-
✓ do not add schema if not provided (
|
|
6
|
-
✓ add schema if provided (
|
|
7
|
-
✓ should have autoVerifiedAttributes equal email by default (
|
|
5
|
+
✓ do not add schema if not provided (18 ms)
|
|
6
|
+
✓ add schema if provided (1 ms)
|
|
7
|
+
✓ should have autoVerifiedAttributes equal email by default (17 ms)
|
|
8
8
|
✓ default usernameAttributes should be email
|
|
9
9
|
✓ should have autoVerifiedAttributes undefined: [] (1 ms)
|
|
10
10
|
✓ should have autoVerifiedAttributes undefined: null
|
|
11
11
|
✓ should have autoVerifiedAttributes undefined: false
|
|
12
|
-
✓ should retain user pool
|
|
12
|
+
✓ should retain user pool
|
|
13
13
|
identity pool
|
|
14
14
|
✓ should not have identity pool by default or false: false
|
|
15
|
-
✓ should not have identity pool by default or false: undefined
|
|
15
|
+
✓ should not have identity pool by default or false: undefined
|
|
16
16
|
✓ should have identity pool if false
|
|
17
|
-
✓ should have identity pool role attachment
|
|
17
|
+
✓ should have identity pool role attachment
|
|
18
18
|
|
|
19
19
|
-------------|---------|----------|---------|---------|-------------------
|
|
20
20
|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
@@ -27,5 +27,5 @@ All files | 97.75 | 70.58 | 100 | 97.75 |
|
|
|
27
27
|
Test Suites: 1 passed, 1 total
|
|
28
28
|
Tests: 12 passed, 12 total
|
|
29
29
|
Snapshots: 0 total
|
|
30
|
-
Time: 5.
|
|
30
|
+
Time: 5.937 s
|
|
31
31
|
Ran all test suites.
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.8.3](https://github.com/ttoss/ttoss/compare/@ttoss/cloud-auth@0.8.2...@ttoss/cloud-auth@0.8.3) (2023-03-26)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- add i18n id to builds ([#253](https://github.com/ttoss/ttoss/issues/253)) ([a50d288](https://github.com/ttoss/ttoss/commit/a50d288250a5a8d71aee4027f6d41f6e1f0f374d))
|
|
11
|
+
|
|
12
|
+
## [0.8.2](https://github.com/ttoss/ttoss/compare/@ttoss/cloud-auth@0.8.1...@ttoss/cloud-auth@0.8.2) (2023-03-22)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- add type button as default ([#252](https://github.com/ttoss/ttoss/issues/252)) ([6429e7c](https://github.com/ttoss/ttoss/commit/6429e7c30e286a98316de9b109129c1b094f6680))
|
|
17
|
+
|
|
6
18
|
## [0.8.1](https://github.com/ttoss/ttoss/compare/@ttoss/cloud-auth@0.8.0...@ttoss/cloud-auth@0.8.1) (2023-03-20)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @ttoss/cloud-auth
|
package/coverage/clover.xml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="
|
|
3
|
-
<project timestamp="
|
|
2
|
+
<coverage generated="1679801282403" clover="3.2.0">
|
|
3
|
+
<project timestamp="1679801282404" name="All files">
|
|
4
4
|
<metrics statements="312" coveredstatements="305" conditionals="17" coveredconditionals="12" methods="1" coveredmethods="1" elements="330" coveredelements="318" complexity="0" loc="312" ncloc="312" packages="1" files="3" classes="3"/>
|
|
5
5
|
<file name="config.ts" path="/home/runner/work/ttoss/ttoss/packages/cloud-auth/src/config.ts">
|
|
6
6
|
<metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
74
74
|
Code coverage generated by
|
|
75
75
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
76
|
-
at 2023-03-
|
|
76
|
+
at 2023-03-26T03:28:02.342Z
|
|
77
77
|
</div>
|
|
78
78
|
<script src="prettify.js"></script>
|
|
79
79
|
<script>
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
132
132
|
Code coverage generated by
|
|
133
133
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
134
|
-
at 2023-03-
|
|
134
|
+
at 2023-03-26T03:28:02.342Z
|
|
135
135
|
</div>
|
|
136
136
|
<script src="prettify.js"></script>
|
|
137
137
|
<script>
|
|
@@ -76,7 +76,7 @@ export { createAuthTemplate } from './template';
|
|
|
76
76
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
77
77
|
Code coverage generated by
|
|
78
78
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
79
|
-
at 2023-03-
|
|
79
|
+
at 2023-03-26T03:28:02.342Z
|
|
80
80
|
</div>
|
|
81
81
|
<script src="prettify.js"></script>
|
|
82
82
|
<script>
|
|
@@ -997,7 +997,7 @@ createAuthTemplate.CognitoIdentityPoolLogicalId = CognitoIdentityPoolLogicalId;
|
|
|
997
997
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
998
998
|
Code coverage generated by
|
|
999
999
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1000
|
-
at 2023-03-
|
|
1000
|
+
at 2023-03-26T03:28:02.342Z
|
|
1001
1001
|
</div>
|
|
1002
1002
|
<script src="prettify.js"></script>
|
|
1003
1003
|
<script>
|
package/dist/esm/index.js
CHANGED
|
@@ -66,7 +66,9 @@ var createAuthTemplate = ({
|
|
|
66
66
|
},
|
|
67
67
|
Export: {
|
|
68
68
|
Name: {
|
|
69
|
-
"Fn::Join": [":", [{
|
|
69
|
+
"Fn::Join": [":", [{
|
|
70
|
+
Ref: "AWS::StackName"
|
|
71
|
+
}, "Region"]]
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
74
|
},
|
|
@@ -77,7 +79,9 @@ var createAuthTemplate = ({
|
|
|
77
79
|
},
|
|
78
80
|
Export: {
|
|
79
81
|
Name: {
|
|
80
|
-
"Fn::Join": [":", [{
|
|
82
|
+
"Fn::Join": [":", [{
|
|
83
|
+
Ref: "AWS::StackName"
|
|
84
|
+
}, "UserPoolId"]]
|
|
81
85
|
}
|
|
82
86
|
}
|
|
83
87
|
},
|
|
@@ -88,14 +92,16 @@ var createAuthTemplate = ({
|
|
|
88
92
|
},
|
|
89
93
|
Export: {
|
|
90
94
|
Name: {
|
|
91
|
-
"Fn::Join": [":", [{
|
|
95
|
+
"Fn::Join": [":", [{
|
|
96
|
+
Ref: "AWS::StackName"
|
|
97
|
+
}, "AppClientId"]]
|
|
92
98
|
}
|
|
93
99
|
}
|
|
94
100
|
}
|
|
95
101
|
}
|
|
96
102
|
};
|
|
97
103
|
if (schema) {
|
|
98
|
-
const Schema = schema.map(
|
|
104
|
+
const Schema = schema.map(attribute => {
|
|
99
105
|
let NumberAttributeConstraints = void 0;
|
|
100
106
|
if (attribute.numberAttributeConstraints) {
|
|
101
107
|
NumberAttributeConstraints = {
|
|
@@ -127,16 +133,14 @@ var createAuthTemplate = ({
|
|
|
127
133
|
Type: "AWS::Cognito::IdentityPool",
|
|
128
134
|
Properties: {
|
|
129
135
|
AllowUnauthenticatedIdentities: true,
|
|
130
|
-
CognitoIdentityProviders: [
|
|
131
|
-
{
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
"Fn::GetAtt": [CognitoUserPoolLogicalId, "ProviderName"]
|
|
137
|
-
}
|
|
136
|
+
CognitoIdentityProviders: [{
|
|
137
|
+
ClientId: {
|
|
138
|
+
Ref: CognitoUserPoolClientLogicalId
|
|
139
|
+
},
|
|
140
|
+
ProviderName: {
|
|
141
|
+
"Fn::GetAtt": [CognitoUserPoolLogicalId, "ProviderName"]
|
|
138
142
|
}
|
|
139
|
-
]
|
|
143
|
+
}]
|
|
140
144
|
}
|
|
141
145
|
};
|
|
142
146
|
template.Resources[IdentityPoolAuthenticatedIAMRoleLogicalId] = {
|
|
@@ -144,35 +148,31 @@ var createAuthTemplate = ({
|
|
|
144
148
|
Properties: {
|
|
145
149
|
AssumeRolePolicyDocument: {
|
|
146
150
|
Version: "2012-10-17",
|
|
147
|
-
Statement: [
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
Ref: CognitoIdentityPoolLogicalId
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
"ForAnyValue:StringLike": {
|
|
161
|
-
"cognito-identity.amazonaws.com:amr": "authenticated"
|
|
151
|
+
Statement: [{
|
|
152
|
+
Effect: "Allow",
|
|
153
|
+
Principal: {
|
|
154
|
+
Federated: "cognito-identity.amazonaws.com"
|
|
155
|
+
},
|
|
156
|
+
Action: ["sts:AssumeRoleWithWebIdentity", "sts:TagSession"],
|
|
157
|
+
Condition: {
|
|
158
|
+
StringEquals: {
|
|
159
|
+
"cognito-identity.amazonaws.com:aud": {
|
|
160
|
+
Ref: CognitoIdentityPoolLogicalId
|
|
162
161
|
}
|
|
162
|
+
},
|
|
163
|
+
"ForAnyValue:StringLike": {
|
|
164
|
+
"cognito-identity.amazonaws.com:amr": "authenticated"
|
|
163
165
|
}
|
|
164
166
|
}
|
|
165
|
-
]
|
|
167
|
+
}]
|
|
166
168
|
},
|
|
167
|
-
Policies: identityPool.authenticatedPolicies || [
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
Statement: [DenyStatement]
|
|
173
|
-
}
|
|
169
|
+
Policies: identityPool.authenticatedPolicies || [{
|
|
170
|
+
PolicyName: "IdentityPoolAuthenticatedIAMRolePolicyName",
|
|
171
|
+
PolicyDocument: {
|
|
172
|
+
Version: "2012-10-17",
|
|
173
|
+
Statement: [DenyStatement]
|
|
174
174
|
}
|
|
175
|
-
]
|
|
175
|
+
}]
|
|
176
176
|
}
|
|
177
177
|
};
|
|
178
178
|
template.Resources[IdentityPoolUnauthenticatedIAMRoleLogicalId] = {
|
|
@@ -180,35 +180,31 @@ var createAuthTemplate = ({
|
|
|
180
180
|
Properties: {
|
|
181
181
|
AssumeRolePolicyDocument: {
|
|
182
182
|
Version: "2012-10-17",
|
|
183
|
-
Statement: [
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
Ref: CognitoIdentityPoolLogicalId
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
"ForAnyValue:StringLike": {
|
|
197
|
-
"cognito-identity.amazonaws.com:amr": "unauthenticated"
|
|
183
|
+
Statement: [{
|
|
184
|
+
Effect: "Allow",
|
|
185
|
+
Principal: {
|
|
186
|
+
Federated: "cognito-identity.amazonaws.com"
|
|
187
|
+
},
|
|
188
|
+
Action: "sts:AssumeRoleWithWebIdentity",
|
|
189
|
+
Condition: {
|
|
190
|
+
StringEquals: {
|
|
191
|
+
"cognito-identity.amazonaws.com:aud": {
|
|
192
|
+
Ref: CognitoIdentityPoolLogicalId
|
|
198
193
|
}
|
|
194
|
+
},
|
|
195
|
+
"ForAnyValue:StringLike": {
|
|
196
|
+
"cognito-identity.amazonaws.com:amr": "unauthenticated"
|
|
199
197
|
}
|
|
200
198
|
}
|
|
201
|
-
]
|
|
199
|
+
}]
|
|
202
200
|
},
|
|
203
|
-
Policies: identityPool.authenticatedPolicies || [
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
Statement: [DenyStatement]
|
|
209
|
-
}
|
|
201
|
+
Policies: identityPool.authenticatedPolicies || [{
|
|
202
|
+
PolicyName: "IdentityPoolUnauthenticatedIAMRolePolicyName",
|
|
203
|
+
PolicyDocument: {
|
|
204
|
+
Version: "2012-10-17",
|
|
205
|
+
Statement: [DenyStatement]
|
|
210
206
|
}
|
|
211
|
-
]
|
|
207
|
+
}]
|
|
212
208
|
}
|
|
213
209
|
};
|
|
214
210
|
template.Resources.CognitoIdentityPoolRoleAttachment = {
|
|
@@ -237,10 +233,9 @@ var createAuthTemplate = ({
|
|
|
237
233
|
},
|
|
238
234
|
Export: {
|
|
239
235
|
Name: {
|
|
240
|
-
"Fn::Join": [
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
]
|
|
236
|
+
"Fn::Join": [":", [{
|
|
237
|
+
Ref: "AWS::StackName"
|
|
238
|
+
}, "CognitoIdentityPoolId"]]
|
|
244
239
|
}
|
|
245
240
|
}
|
|
246
241
|
};
|
|
@@ -250,7 +245,4 @@ var createAuthTemplate = ({
|
|
|
250
245
|
createAuthTemplate.CognitoUserPoolLogicalId = CognitoUserPoolLogicalId;
|
|
251
246
|
createAuthTemplate.CognitoUserPoolClientLogicalId = CognitoUserPoolClientLogicalId;
|
|
252
247
|
createAuthTemplate.CognitoIdentityPoolLogicalId = CognitoIdentityPoolLogicalId;
|
|
253
|
-
export {
|
|
254
|
-
PASSWORD_MINIMUM_LENGTH,
|
|
255
|
-
createAuthTemplate
|
|
256
|
-
};
|
|
248
|
+
export { PASSWORD_MINIMUM_LENGTH, createAuthTemplate };
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
2
|
"use strict";
|
|
3
|
+
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
8
|
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
10
13
|
};
|
|
11
14
|
var __copyProps = (to, from, except, desc) => {
|
|
12
15
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
16
20
|
}
|
|
17
21
|
return to;
|
|
18
22
|
};
|
|
19
|
-
var __toCommonJS =
|
|
23
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
24
|
+
value: true
|
|
25
|
+
}), mod);
|
|
20
26
|
|
|
21
27
|
// src/index.ts
|
|
22
28
|
var src_exports = {};
|
|
@@ -92,7 +98,9 @@ var createAuthTemplate = ({
|
|
|
92
98
|
},
|
|
93
99
|
Export: {
|
|
94
100
|
Name: {
|
|
95
|
-
"Fn::Join": [":", [{
|
|
101
|
+
"Fn::Join": [":", [{
|
|
102
|
+
Ref: "AWS::StackName"
|
|
103
|
+
}, "Region"]]
|
|
96
104
|
}
|
|
97
105
|
}
|
|
98
106
|
},
|
|
@@ -103,7 +111,9 @@ var createAuthTemplate = ({
|
|
|
103
111
|
},
|
|
104
112
|
Export: {
|
|
105
113
|
Name: {
|
|
106
|
-
"Fn::Join": [":", [{
|
|
114
|
+
"Fn::Join": [":", [{
|
|
115
|
+
Ref: "AWS::StackName"
|
|
116
|
+
}, "UserPoolId"]]
|
|
107
117
|
}
|
|
108
118
|
}
|
|
109
119
|
},
|
|
@@ -114,14 +124,16 @@ var createAuthTemplate = ({
|
|
|
114
124
|
},
|
|
115
125
|
Export: {
|
|
116
126
|
Name: {
|
|
117
|
-
"Fn::Join": [":", [{
|
|
127
|
+
"Fn::Join": [":", [{
|
|
128
|
+
Ref: "AWS::StackName"
|
|
129
|
+
}, "AppClientId"]]
|
|
118
130
|
}
|
|
119
131
|
}
|
|
120
132
|
}
|
|
121
133
|
}
|
|
122
134
|
};
|
|
123
135
|
if (schema) {
|
|
124
|
-
const Schema = schema.map(
|
|
136
|
+
const Schema = schema.map(attribute => {
|
|
125
137
|
let NumberAttributeConstraints = void 0;
|
|
126
138
|
if (attribute.numberAttributeConstraints) {
|
|
127
139
|
NumberAttributeConstraints = {
|
|
@@ -153,16 +165,14 @@ var createAuthTemplate = ({
|
|
|
153
165
|
Type: "AWS::Cognito::IdentityPool",
|
|
154
166
|
Properties: {
|
|
155
167
|
AllowUnauthenticatedIdentities: true,
|
|
156
|
-
CognitoIdentityProviders: [
|
|
157
|
-
{
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
"Fn::GetAtt": [CognitoUserPoolLogicalId, "ProviderName"]
|
|
163
|
-
}
|
|
168
|
+
CognitoIdentityProviders: [{
|
|
169
|
+
ClientId: {
|
|
170
|
+
Ref: CognitoUserPoolClientLogicalId
|
|
171
|
+
},
|
|
172
|
+
ProviderName: {
|
|
173
|
+
"Fn::GetAtt": [CognitoUserPoolLogicalId, "ProviderName"]
|
|
164
174
|
}
|
|
165
|
-
]
|
|
175
|
+
}]
|
|
166
176
|
}
|
|
167
177
|
};
|
|
168
178
|
template.Resources[IdentityPoolAuthenticatedIAMRoleLogicalId] = {
|
|
@@ -170,35 +180,31 @@ var createAuthTemplate = ({
|
|
|
170
180
|
Properties: {
|
|
171
181
|
AssumeRolePolicyDocument: {
|
|
172
182
|
Version: "2012-10-17",
|
|
173
|
-
Statement: [
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
Ref: CognitoIdentityPoolLogicalId
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
"ForAnyValue:StringLike": {
|
|
187
|
-
"cognito-identity.amazonaws.com:amr": "authenticated"
|
|
183
|
+
Statement: [{
|
|
184
|
+
Effect: "Allow",
|
|
185
|
+
Principal: {
|
|
186
|
+
Federated: "cognito-identity.amazonaws.com"
|
|
187
|
+
},
|
|
188
|
+
Action: ["sts:AssumeRoleWithWebIdentity", "sts:TagSession"],
|
|
189
|
+
Condition: {
|
|
190
|
+
StringEquals: {
|
|
191
|
+
"cognito-identity.amazonaws.com:aud": {
|
|
192
|
+
Ref: CognitoIdentityPoolLogicalId
|
|
188
193
|
}
|
|
194
|
+
},
|
|
195
|
+
"ForAnyValue:StringLike": {
|
|
196
|
+
"cognito-identity.amazonaws.com:amr": "authenticated"
|
|
189
197
|
}
|
|
190
198
|
}
|
|
191
|
-
]
|
|
199
|
+
}]
|
|
192
200
|
},
|
|
193
|
-
Policies: identityPool.authenticatedPolicies || [
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
Statement: [DenyStatement]
|
|
199
|
-
}
|
|
201
|
+
Policies: identityPool.authenticatedPolicies || [{
|
|
202
|
+
PolicyName: "IdentityPoolAuthenticatedIAMRolePolicyName",
|
|
203
|
+
PolicyDocument: {
|
|
204
|
+
Version: "2012-10-17",
|
|
205
|
+
Statement: [DenyStatement]
|
|
200
206
|
}
|
|
201
|
-
]
|
|
207
|
+
}]
|
|
202
208
|
}
|
|
203
209
|
};
|
|
204
210
|
template.Resources[IdentityPoolUnauthenticatedIAMRoleLogicalId] = {
|
|
@@ -206,35 +212,31 @@ var createAuthTemplate = ({
|
|
|
206
212
|
Properties: {
|
|
207
213
|
AssumeRolePolicyDocument: {
|
|
208
214
|
Version: "2012-10-17",
|
|
209
|
-
Statement: [
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
Ref: CognitoIdentityPoolLogicalId
|
|
220
|
-
}
|
|
221
|
-
},
|
|
222
|
-
"ForAnyValue:StringLike": {
|
|
223
|
-
"cognito-identity.amazonaws.com:amr": "unauthenticated"
|
|
215
|
+
Statement: [{
|
|
216
|
+
Effect: "Allow",
|
|
217
|
+
Principal: {
|
|
218
|
+
Federated: "cognito-identity.amazonaws.com"
|
|
219
|
+
},
|
|
220
|
+
Action: "sts:AssumeRoleWithWebIdentity",
|
|
221
|
+
Condition: {
|
|
222
|
+
StringEquals: {
|
|
223
|
+
"cognito-identity.amazonaws.com:aud": {
|
|
224
|
+
Ref: CognitoIdentityPoolLogicalId
|
|
224
225
|
}
|
|
226
|
+
},
|
|
227
|
+
"ForAnyValue:StringLike": {
|
|
228
|
+
"cognito-identity.amazonaws.com:amr": "unauthenticated"
|
|
225
229
|
}
|
|
226
230
|
}
|
|
227
|
-
]
|
|
231
|
+
}]
|
|
228
232
|
},
|
|
229
|
-
Policies: identityPool.authenticatedPolicies || [
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
Statement: [DenyStatement]
|
|
235
|
-
}
|
|
233
|
+
Policies: identityPool.authenticatedPolicies || [{
|
|
234
|
+
PolicyName: "IdentityPoolUnauthenticatedIAMRolePolicyName",
|
|
235
|
+
PolicyDocument: {
|
|
236
|
+
Version: "2012-10-17",
|
|
237
|
+
Statement: [DenyStatement]
|
|
236
238
|
}
|
|
237
|
-
]
|
|
239
|
+
}]
|
|
238
240
|
}
|
|
239
241
|
};
|
|
240
242
|
template.Resources.CognitoIdentityPoolRoleAttachment = {
|
|
@@ -263,10 +265,9 @@ var createAuthTemplate = ({
|
|
|
263
265
|
},
|
|
264
266
|
Export: {
|
|
265
267
|
Name: {
|
|
266
|
-
"Fn::Join": [
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
]
|
|
268
|
+
"Fn::Join": [":", [{
|
|
269
|
+
Ref: "AWS::StackName"
|
|
270
|
+
}, "CognitoIdentityPoolId"]]
|
|
270
271
|
}
|
|
271
272
|
}
|
|
272
273
|
};
|
|
@@ -280,4 +281,4 @@ createAuthTemplate.CognitoIdentityPoolLogicalId = CognitoIdentityPoolLogicalId;
|
|
|
280
281
|
0 && (module.exports = {
|
|
281
282
|
PASSWORD_MINIMUM_LENGTH,
|
|
282
283
|
createAuthTemplate
|
|
283
|
-
});
|
|
284
|
+
});
|
package/package.json
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/cloud-auth",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsup",
|
|
8
8
|
"test": "jest"
|
|
9
9
|
},
|
|
10
|
+
"sideEffects": false,
|
|
10
11
|
"typings": "./dist/index.d.ts",
|
|
11
12
|
"dependencies": {
|
|
12
|
-
"@ttoss/cloudformation": "^0.6.
|
|
13
|
+
"@ttoss/cloudformation": "^0.6.5"
|
|
13
14
|
},
|
|
14
15
|
"devDependencies": {
|
|
15
|
-
"@ttoss/config": "^1.29.
|
|
16
|
-
"@types/jest": "^29.
|
|
16
|
+
"@ttoss/config": "^1.29.2",
|
|
17
|
+
"@types/jest": "^29.5.0",
|
|
17
18
|
"jest": "^29.5.0",
|
|
18
19
|
"typescript": "^5.0.2"
|
|
19
20
|
},
|
|
20
21
|
"publishConfig": {
|
|
21
22
|
"access": "public"
|
|
22
23
|
},
|
|
23
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "0609bb0f6e6a1c0999c29e7a5c8f8ebb1c6d3d7a"
|
|
24
25
|
}
|