@awsless/awsless 0.0.145 → 0.0.146
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/bin.js +16 -11
- package/dist/features/cognito-client-secret/bundle.zip +0 -0
- package/dist/features/delete-bucket/bundle.zip +0 -0
- package/dist/features/delete-hosted-zone/bundle.zip +0 -0
- package/dist/features/global-exports/bundle.zip +0 -0
- package/dist/features/invalidate-cache/bundle.zip +0 -0
- package/dist/features/upload-bucket-asset/bundle.zip +0 -0
- package/package.json +2 -2
package/dist/bin.js
CHANGED
|
@@ -1727,17 +1727,19 @@ var authPlugin = definePlugin({
|
|
|
1727
1727
|
gen.addInterface("AuthResources", resources);
|
|
1728
1728
|
await write("auth.d.ts", gen, true);
|
|
1729
1729
|
},
|
|
1730
|
-
onStack({ bootstrap: bootstrap2, stackConfig, bind }) {
|
|
1730
|
+
onStack({ config: config2, bootstrap: bootstrap2, stackConfig, bind }) {
|
|
1731
1731
|
for (const [id, props] of Object.entries(stackConfig.auth ?? {})) {
|
|
1732
1732
|
if (props.access) {
|
|
1733
1733
|
const userPoolId = bootstrap2.import(`auth-${id}-user-pool-id`);
|
|
1734
1734
|
const clientId = bootstrap2.import(`auth-${id}-client-id`);
|
|
1735
|
-
const clientSecret = bootstrap2.import(`auth-${id}-client-secret`);
|
|
1736
1735
|
const name = constantCase5(id);
|
|
1737
1736
|
bind((lambda) => {
|
|
1738
1737
|
lambda.addEnvironment(`AUTH_${name}_USER_POOL_ID`, userPoolId);
|
|
1739
1738
|
lambda.addEnvironment(`AUTH_${name}_CLIENT_ID`, clientId);
|
|
1740
|
-
|
|
1739
|
+
if (config2.app.defaults.auth?.[id]?.secret) {
|
|
1740
|
+
const clientSecret = bootstrap2.import(`auth-${id}-client-secret`);
|
|
1741
|
+
lambda.addEnvironment(`AUTH_${name}_CLIENT_SECRET`, clientSecret);
|
|
1742
|
+
}
|
|
1741
1743
|
lambda.addPermissions({
|
|
1742
1744
|
actions: ["cognito:*"],
|
|
1743
1745
|
resources: ["*"]
|
|
@@ -1813,14 +1815,17 @@ var authPlugin = definePlugin({
|
|
|
1813
1815
|
const domain = userPool.addDomain({
|
|
1814
1816
|
domain: `${config2.app.name}-${id}`
|
|
1815
1817
|
});
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1818
|
+
if (props.secret) {
|
|
1819
|
+
const clientSecret = new CustomResource(`${id}-client-secret`, {
|
|
1820
|
+
serviceToken: clientSecretLambda.arn,
|
|
1821
|
+
properties: {
|
|
1822
|
+
userPoolId: userPool.id,
|
|
1823
|
+
clientId: client.id
|
|
1824
|
+
}
|
|
1825
|
+
}).dependsOn(client, userPool);
|
|
1826
|
+
bootstrap2.add(clientSecret).export(`auth-${id}-client-secret`, clientSecret.getAtt("secret"));
|
|
1827
|
+
}
|
|
1828
|
+
bootstrap2.add(userPool).export(`auth-${id}-user-pool-arn`, userPool.arn).export(`auth-${id}-user-pool-id`, userPool.id).export(`auth-${id}-client-id`, client.id).export(`auth-${id}-domain`, domain.domain);
|
|
1824
1829
|
for (const [event, lambda] of functions) {
|
|
1825
1830
|
const permission = new Permission(`auth-${id}-${event}`, {
|
|
1826
1831
|
action: "lambda:InvokeFunction",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.146",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@awsless/lambda": "^0.0.15",
|
|
32
|
-
"@awsless/redis": "^0.0.10",
|
|
33
32
|
"@awsless/sns": "^0.0.7",
|
|
33
|
+
"@awsless/redis": "^0.0.10",
|
|
34
34
|
"@awsless/sqs": "^0.0.7",
|
|
35
35
|
"@awsless/ssm": "^0.0.7",
|
|
36
36
|
"@awsless/validate": "^0.0.10",
|