@adobe/helix-deploy 13.0.8 → 13.1.0
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [13.1.0](https://github.com/adobe/helix-deploy/compare/v13.0.9...v13.1.0) (2025-07-01)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* add script to install `helix-deploy-proxy` in new environment ([#827](https://github.com/adobe/helix-deploy/issues/827)) ([f5ef2d3](https://github.com/adobe/helix-deploy/commit/f5ef2d3c82f37e8ce7882fa7a060cada65c943df))
|
|
7
|
+
|
|
8
|
+
## [13.0.9](https://github.com/adobe/helix-deploy/compare/v13.0.8...v13.0.9) (2025-06-25)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** update external fixes ([#822](https://github.com/adobe/helix-deploy/issues/822)) ([88c0589](https://github.com/adobe/helix-deploy/commit/88c0589d85c5f3c179a71c66a2e29f245fc2c1b0))
|
|
14
|
+
|
|
1
15
|
## [13.0.8](https://github.com/adobe/helix-deploy/compare/v13.0.7...v13.0.8) (2025-06-17)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-deploy",
|
|
3
|
-
"version": "13.0
|
|
3
|
+
"version": "13.1.0",
|
|
4
4
|
"description": "Library and Commandline Tools to build and deploy OpenWhisk Actions",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/adobe/helix-deploy#readme",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@adobe/fetch": "4.2.2",
|
|
41
41
|
"@adobe/helix-shared-process-queue": "3.1.3",
|
|
42
|
-
"@aws-sdk/client-apigatewayv2": "3.
|
|
43
|
-
"@aws-sdk/client-lambda": "3.
|
|
44
|
-
"@aws-sdk/client-s3": "3.
|
|
45
|
-
"@aws-sdk/client-secrets-manager": "3.
|
|
46
|
-
"@aws-sdk/client-ssm": "3.
|
|
47
|
-
"@aws-sdk/client-sts": "3.
|
|
42
|
+
"@aws-sdk/client-apigatewayv2": "3.835.0",
|
|
43
|
+
"@aws-sdk/client-lambda": "3.835.0",
|
|
44
|
+
"@aws-sdk/client-s3": "3.835.0",
|
|
45
|
+
"@aws-sdk/client-secrets-manager": "3.835.0",
|
|
46
|
+
"@aws-sdk/client-ssm": "3.835.0",
|
|
47
|
+
"@aws-sdk/client-sts": "3.835.0",
|
|
48
48
|
"@google-cloud/functions": "4.1.0",
|
|
49
49
|
"@google-cloud/secret-manager": "6.0.1",
|
|
50
50
|
"@google-cloud/storage": "7.16.0",
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
"esbuild": "0.25.5",
|
|
55
55
|
"escalade": "3.2.0",
|
|
56
56
|
"fs-extra": "11.3.0",
|
|
57
|
-
"isomorphic-git": "1.
|
|
57
|
+
"isomorphic-git": "1.31.1",
|
|
58
58
|
"openwhisk": "3.21.8",
|
|
59
59
|
"semver": "7.7.2",
|
|
60
60
|
"yargs": "18.0.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@adobe/eslint-config-helix": "3.0.
|
|
63
|
+
"@adobe/eslint-config-helix": "3.0.6",
|
|
64
64
|
"@adobe/helix-shared-wrap": "2.0.2",
|
|
65
65
|
"@adobe/helix-status": "10.1.5",
|
|
66
66
|
"@eslint/config-helpers": "0.2.3",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"eslint": "9.4.0",
|
|
71
71
|
"husky": "9.1.7",
|
|
72
72
|
"lint-staged": "16.1.2",
|
|
73
|
-
"mocha": "11.
|
|
73
|
+
"mocha": "11.7.1",
|
|
74
74
|
"mocha-junit-reporter": "2.2.1",
|
|
75
75
|
"mocha-multi-reporters": "1.5.1",
|
|
76
76
|
"nock": "13.5.6",
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -eo pipefail
|
|
3
|
+
|
|
4
|
+
if [ -z "${HLX_AWS_ACCOUNT_ID}" ]; then
|
|
5
|
+
echo "HLX_AWS_ACCOUNT_ID required"
|
|
6
|
+
exit 1
|
|
7
|
+
fi
|
|
8
|
+
if [ -z "${HLX_AWS_API_ID}" ]; then
|
|
9
|
+
echo "HLX_AWS_API_ID required"
|
|
10
|
+
exit 1
|
|
11
|
+
fi
|
|
12
|
+
if [ -z "${HLX_AWS_REGION}" ]; then
|
|
13
|
+
echo "HLX_AWS_REGION required"
|
|
14
|
+
exit 1
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
function_name="helix-deploy-proxy"
|
|
18
|
+
runtime="nodejs22.x"
|
|
19
|
+
role="arn:aws:iam::${HLX_AWS_ACCOUNT_ID}:role/helix-lambda-role"
|
|
20
|
+
|
|
21
|
+
createZip() {
|
|
22
|
+
temp_dir=$(mktemp -d)
|
|
23
|
+
cp $(dirname $0)/../template/aws-proxy-code.js ${temp_dir}/index.mjs
|
|
24
|
+
cd $temp_dir
|
|
25
|
+
zip -q code.zip index.mjs
|
|
26
|
+
cd - > /dev/null
|
|
27
|
+
echo $temp_dir
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
createFunction() {
|
|
31
|
+
aws lambda create-function \
|
|
32
|
+
--function-name "arn:aws:lambda:${HLX_AWS_REGION}:${HLX_AWS_ACCOUNT_ID}:function:${function_name}" \
|
|
33
|
+
--runtime "${runtime}" \
|
|
34
|
+
--handler "index.handler" \
|
|
35
|
+
--role "${role}" \
|
|
36
|
+
--description "Helix Deploy Proxy" \
|
|
37
|
+
--timeout 60 \
|
|
38
|
+
--package-type Zip \
|
|
39
|
+
--zip-file "fileb://$1/code.zip"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
createIntegration() {
|
|
43
|
+
json=$(aws apigatewayv2 create-integration \
|
|
44
|
+
--api-id ${HLX_AWS_API_ID} \
|
|
45
|
+
--integration-type "AWS_PROXY" \
|
|
46
|
+
--integration-uri "arn:aws:lambda:${HLX_AWS_REGION}:${HLX_AWS_ACCOUNT_ID}:function:${function_name}" \
|
|
47
|
+
--payload-format-version "2.0")
|
|
48
|
+
echo $(echo $json | jq -r '.IntegrationId')
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
createInvokePermissions() {
|
|
52
|
+
route=$1
|
|
53
|
+
|
|
54
|
+
aws lambda add-permission \
|
|
55
|
+
--statement-id run-${route}-1 \
|
|
56
|
+
--action lambda:InvokeFunction \
|
|
57
|
+
--function-name "arn:aws:lambda:${HLX_AWS_REGION}:${HLX_AWS_ACCOUNT_ID}:function:${function_name}" \
|
|
58
|
+
--principal apigateway.amazonaws.com \
|
|
59
|
+
--source-arn "arn:aws:execute-api:${HLX_AWS_REGION}:${HLX_AWS_ACCOUNT_ID}:${HLX_AWS_API_ID}/*/*/${route}/{action}/{version}"
|
|
60
|
+
|
|
61
|
+
aws lambda add-permission \
|
|
62
|
+
--statement-id run-${route}-2 \
|
|
63
|
+
--action lambda:InvokeFunction \
|
|
64
|
+
--function-name "arn:aws:lambda:${HLX_AWS_REGION}:${HLX_AWS_ACCOUNT_ID}:function:${function_name}" \
|
|
65
|
+
--principal apigateway.amazonaws.com \
|
|
66
|
+
--source-arn "arn:aws:execute-api:${HLX_AWS_REGION}:${HLX_AWS_ACCOUNT_ID}:${HLX_AWS_API_ID}/*/*/${route}/{action}/{version}/{path+}"
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
createRoutes() {
|
|
70
|
+
route=$1
|
|
71
|
+
integration=$2
|
|
72
|
+
authorizer=$3
|
|
73
|
+
|
|
74
|
+
if [ -z "${authorizer}" ]; then
|
|
75
|
+
aws apigatewayv2 create-route \
|
|
76
|
+
--api-id ${HLX_AWS_API_ID} \
|
|
77
|
+
--no-api-key-required \
|
|
78
|
+
--route-key "ANY /${route}/{action}/{version}" \
|
|
79
|
+
--target "integrations/${integration}"
|
|
80
|
+
aws apigatewayv2 create-route \
|
|
81
|
+
--api-id ${HLX_AWS_API_ID} \
|
|
82
|
+
--no-api-key-required \
|
|
83
|
+
--route-key "ANY /${route}/{action}/{version}/{path+}" \
|
|
84
|
+
--target "integrations/${integration}"
|
|
85
|
+
else
|
|
86
|
+
aws apigatewayv2 create-route \
|
|
87
|
+
--api-id ${HLX_AWS_API_ID} \
|
|
88
|
+
--no-api-key-required \
|
|
89
|
+
--route-key "ANY /${route}/{action}/{version}" \
|
|
90
|
+
--target "integrations/${integration}" \
|
|
91
|
+
--authorization-type "CUSTOM" \
|
|
92
|
+
--authorizer-id "${authorizer}"
|
|
93
|
+
aws apigatewayv2 create-route \
|
|
94
|
+
--api-id ${HLX_AWS_API_ID} \
|
|
95
|
+
--no-api-key-required \
|
|
96
|
+
--route-key "ANY /${route}/{action}/{version}/{path+}" \
|
|
97
|
+
--target "integrations/${integration}" \
|
|
98
|
+
--authorization-type "CUSTOM" \
|
|
99
|
+
--authorizer-id "${authorizer}"
|
|
100
|
+
fi
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
getAuthorizerId() {
|
|
104
|
+
authorizer=$(aws apigatewayv2 get-authorizers \
|
|
105
|
+
--api-id "${HLX_AWS_API_ID}" | jq -r '.Items[] | select(.Name=="helix-token-authorizer_v2") | .AuthorizerId')
|
|
106
|
+
echo $authorizer
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
#
|
|
110
|
+
# Main
|
|
111
|
+
#
|
|
112
|
+
|
|
113
|
+
temp_dir=$(createZip)
|
|
114
|
+
trap "rm -rf $temp_dir" 0 2 3 15
|
|
115
|
+
createFunction $temp_dir
|
|
116
|
+
|
|
117
|
+
integration=$(createIntegration)
|
|
118
|
+
authorizer=$(getAuthorizerId)
|
|
119
|
+
|
|
120
|
+
createRoutes helix-services $integration
|
|
121
|
+
if [ ! -z "${authorizer}" ]; then
|
|
122
|
+
createRoutes helix3 $integration $authorizer
|
|
123
|
+
fi
|
|
124
|
+
|
|
125
|
+
createInvokePermissions helix-services
|
|
126
|
+
if [ ! -z "${authorizer}" ]; then
|
|
127
|
+
createInvokePermissions helix3
|
|
128
|
+
fi
|
|
@@ -49,8 +49,9 @@ export const handler = async (event) => {
|
|
|
49
49
|
} catch (err) {
|
|
50
50
|
console.error(err);
|
|
51
51
|
return {
|
|
52
|
-
statusCode: err.statusCode,
|
|
53
|
-
|
|
52
|
+
statusCode: err.$metadata?.httpStatusCode ?? err.statusCode,
|
|
53
|
+
headers: { 'content-type': 'application/json' },
|
|
54
|
+
body: JSON.stringify({ message: err.message }),
|
|
54
55
|
};
|
|
55
56
|
}
|
|
56
57
|
};
|