@graphql-hive/plugin-aws-sigv4 2.0.21 → 2.0.22-alpha-1d2d1089c944617a01e28c874a6d363b571d28f6
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 +6 -0
- package/dist/index.cjs +14 -14
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @graphql-hive/plugin-aws-sigv4
|
|
2
2
|
|
|
3
|
+
## 2.0.22-alpha-1d2d1089c944617a01e28c874a6d363b571d28f6
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- Updated dependencies [[`93aa767`](https://github.com/graphql-hive/gateway/commit/93aa76755afc93085280646fb7cb14e6d02b4a7f)]:
|
|
7
|
+
- @graphql-mesh/fusion-runtime@1.6.4-alpha-1d2d1089c944617a01e28c874a6d363b571d28f6
|
|
8
|
+
|
|
3
9
|
## 2.0.21
|
|
4
10
|
### Patch Changes
|
|
5
11
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var require$$2
|
|
3
|
+
var require$$2 = require('node:crypto');
|
|
4
4
|
var clientSts = require('@aws-sdk/client-sts');
|
|
5
|
-
var require$$
|
|
5
|
+
var require$$3 = require('@whatwg-node/promise-helpers');
|
|
6
6
|
var aws4 = require('aws4');
|
|
7
7
|
var graphql = require('graphql');
|
|
8
8
|
|
|
@@ -124,14 +124,14 @@ function useAWSSigv4(opts) {
|
|
|
124
124
|
if (secretFromEnv) {
|
|
125
125
|
return secretFromEnv;
|
|
126
126
|
}
|
|
127
|
-
return require$$
|
|
127
|
+
return require$$3.handleMaybePromise(
|
|
128
128
|
() => incomingOptions?.assumeRole?.(payload),
|
|
129
129
|
(assumeRolePayload) => {
|
|
130
130
|
if (!assumeRolePayload || !assumeRolePayload.roleArn || !assumeRolePayload.roleSessionName) {
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
133
|
const sts = new clientSts.STS({ region: assumeRolePayload.region });
|
|
134
|
-
return require$$
|
|
134
|
+
return require$$3.handleMaybePromise(
|
|
135
135
|
() => sts.assumeRole({
|
|
136
136
|
RoleArn: assumeRolePayload.roleArn,
|
|
137
137
|
RoleSessionName: assumeRolePayload.roleSessionName
|
|
@@ -149,18 +149,18 @@ function useAWSSigv4(opts) {
|
|
|
149
149
|
if (incomingOptions == null) {
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
|
-
return require$$
|
|
152
|
+
return require$$3.handleMaybePromise(
|
|
153
153
|
() => incomingOptions.enabled(request, serverContext),
|
|
154
154
|
(ifEnabled) => {
|
|
155
155
|
if (!ifEnabled) {
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
|
-
return require$$
|
|
158
|
+
return require$$3.handleMaybePromise(
|
|
159
159
|
() => {
|
|
160
160
|
if (!incomingOptions) {
|
|
161
161
|
throw new Error("Missing options setup");
|
|
162
162
|
}
|
|
163
|
-
return require$$
|
|
163
|
+
return require$$3.handleMaybePromise(
|
|
164
164
|
() => incomingOptions.onBeforeParse(request, serverContext),
|
|
165
165
|
(ifContinue) => {
|
|
166
166
|
if (!ifContinue) {
|
|
@@ -239,7 +239,7 @@ function useAWSSigv4(opts) {
|
|
|
239
239
|
request,
|
|
240
240
|
serverContext
|
|
241
241
|
};
|
|
242
|
-
return require$$
|
|
242
|
+
return require$$3.handleMaybePromise(
|
|
243
243
|
() => incomingOptions.secretAccessKey?.(payload),
|
|
244
244
|
(secretKey) => {
|
|
245
245
|
if (!secretKey) {
|
|
@@ -249,7 +249,7 @@ function useAWSSigv4(opts) {
|
|
|
249
249
|
);
|
|
250
250
|
}
|
|
251
251
|
payload.secretAccessKey = secretKey;
|
|
252
|
-
return require$$
|
|
252
|
+
return require$$3.handleMaybePromise(
|
|
253
253
|
() => incomingOptions.onAfterParse(payload),
|
|
254
254
|
(shouldContinue) => {
|
|
255
255
|
if (!shouldContinue) {
|
|
@@ -350,7 +350,7 @@ function useAWSSigv4(opts) {
|
|
|
350
350
|
if (!isBufferOrString(options.body)) {
|
|
351
351
|
return;
|
|
352
352
|
}
|
|
353
|
-
return require$$
|
|
353
|
+
return require$$3.handleMaybePromise(
|
|
354
354
|
() => outgoingOptionsFactory({ url, options, subgraphName }),
|
|
355
355
|
(factoryResult) => {
|
|
356
356
|
if (factoryResult === false) {
|
|
@@ -376,7 +376,7 @@ function useAWSSigv4(opts) {
|
|
|
376
376
|
service = factoryResult.serviceName;
|
|
377
377
|
region = factoryResult.region;
|
|
378
378
|
}
|
|
379
|
-
return require$$
|
|
379
|
+
return require$$3.handleMaybePromise(
|
|
380
380
|
() => roleArn && roleSessionName ? new clientSts.STS({ region }).assumeRole({
|
|
381
381
|
RoleArn: roleArn,
|
|
382
382
|
RoleSessionName: roleSessionName
|
|
@@ -423,9 +423,9 @@ const encodeRfc3986 = (urlEncodedString) => urlEncodedString.replace(
|
|
|
423
423
|
/[!'()*]/g,
|
|
424
424
|
(c) => "%" + c.charCodeAt(0).toString(16).toUpperCase()
|
|
425
425
|
);
|
|
426
|
-
const hmac = (secretKey, data) => require$$2
|
|
427
|
-
const hash = (data) => require$$2
|
|
428
|
-
const hmacHex = (secretKey, data) => require$$2
|
|
426
|
+
const hmac = (secretKey, data) => require$$2.createHmac("sha256", secretKey).update(data, "utf8").digest();
|
|
427
|
+
const hash = (data) => require$$2.createHash("sha256").update(data, "utf8").digest("hex");
|
|
428
|
+
const hmacHex = (secretKey, data) => require$$2.createHmac("sha256", secretKey).update(data, "utf8").digest("hex");
|
|
429
429
|
|
|
430
430
|
exports.AWSSignV4Headers = AWSSignV4Headers;
|
|
431
431
|
exports.useAWSSigv4 = useAWSSigv4;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-hive/plugin-aws-sigv4",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.22-alpha-1d2d1089c944617a01e28c874a6d363b571d28f6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -43,18 +43,18 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@aws-sdk/client-sts": "^3.931.0",
|
|
46
|
-
"@graphql-mesh/fusion-runtime": "
|
|
46
|
+
"@graphql-mesh/fusion-runtime": "1.6.4-alpha-1d2d1089c944617a01e28c874a6d363b571d28f6",
|
|
47
47
|
"@whatwg-node/promise-helpers": "^1.3.2",
|
|
48
48
|
"aws4": "1.13.2",
|
|
49
49
|
"tslib": "^2.8.1"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@apollo/subgraph": "^2.11.3",
|
|
53
|
-
"@graphql-hive/gateway-runtime": "2.5.
|
|
53
|
+
"@graphql-hive/gateway-runtime": "2.5.2-alpha-1d2d1089c944617a01e28c874a6d363b571d28f6",
|
|
54
54
|
"@types/aws4": "^1.11.6",
|
|
55
55
|
"graphql": "^16.12.0",
|
|
56
56
|
"graphql-yoga": "^5.16.2",
|
|
57
|
-
"pkgroll": "2.21.
|
|
57
|
+
"pkgroll": "2.21.5"
|
|
58
58
|
},
|
|
59
59
|
"sideEffects": false
|
|
60
60
|
}
|