@graphql-hive/plugin-aws-sigv4 2.0.18-alpha-614119b31d14c12b1d3d1c1ccfc98e671191d329 → 2.0.18-alpha-69c4d19643f57268271203fbf82c3b8687f13723
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 +3 -3
- package/dist/index.cjs +17 -25
- package/dist/index.js +3 -11
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @graphql-hive/plugin-aws-sigv4
|
|
2
2
|
|
|
3
|
-
## 2.0.18-alpha-
|
|
3
|
+
## 2.0.18-alpha-69c4d19643f57268271203fbf82c3b8687f13723
|
|
4
4
|
### Patch Changes
|
|
5
5
|
|
|
6
|
-
- Updated dependencies [[`
|
|
7
|
-
- @graphql-mesh/fusion-runtime@1.6.0-alpha-
|
|
6
|
+
- Updated dependencies [[`bc6cddd`](https://github.com/graphql-hive/gateway/commit/bc6cddd1c53a012dd02a1d8a7217a28e65cc6ae9)]:
|
|
7
|
+
- @graphql-mesh/fusion-runtime@1.6.0-alpha-69c4d19643f57268271203fbf82c3b8687f13723
|
|
8
8
|
|
|
9
9
|
## 2.0.17
|
|
10
10
|
### Patch Changes
|
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$$4 = require('@whatwg-node/promise-helpers');
|
|
6
6
|
var aws4 = require('aws4');
|
|
7
7
|
var graphql = require('graphql');
|
|
8
8
|
|
|
@@ -35,7 +35,6 @@ const possibleGraphQLErrorProperties = [
|
|
|
35
35
|
'name',
|
|
36
36
|
'stack',
|
|
37
37
|
'extensions',
|
|
38
|
-
'coordinate',
|
|
39
38
|
];
|
|
40
39
|
function isGraphQLErrorLike(error) {
|
|
41
40
|
return (error != null &&
|
|
@@ -48,17 +47,10 @@ function createGraphQLError(message, options) {
|
|
|
48
47
|
isGraphQLErrorLike(options.originalError)) {
|
|
49
48
|
options.originalError = createGraphQLError(options.originalError.message, options.originalError);
|
|
50
49
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const error = graphql.versionInfo.major >= 16
|
|
54
|
-
? new Constructor(message, options)
|
|
55
|
-
: new Constructor(message, options?.nodes, options?.source, options?.positions, options?.path, options?.originalError, options?.extensions);
|
|
56
|
-
if (options?.coordinate && error.coordinate == null) {
|
|
57
|
-
Object.defineProperties(error, {
|
|
58
|
-
coordinate: { value: options.coordinate, enumerable: true, configurable: true },
|
|
59
|
-
});
|
|
50
|
+
if (graphql.versionInfo.major >= 17) {
|
|
51
|
+
return new graphql.GraphQLError(message, options);
|
|
60
52
|
}
|
|
61
|
-
return
|
|
53
|
+
return new graphql.GraphQLError(message, options?.nodes, options?.source, options?.positions, options?.path, options?.originalError, options?.extensions);
|
|
62
54
|
}
|
|
63
55
|
|
|
64
56
|
var AWSSignV4Headers = /* @__PURE__ */ ((AWSSignV4Headers2) => {
|
|
@@ -124,14 +116,14 @@ function useAWSSigv4(opts) {
|
|
|
124
116
|
if (secretFromEnv) {
|
|
125
117
|
return secretFromEnv;
|
|
126
118
|
}
|
|
127
|
-
return require$$
|
|
119
|
+
return require$$4.handleMaybePromise(
|
|
128
120
|
() => incomingOptions?.assumeRole?.(payload),
|
|
129
121
|
(assumeRolePayload) => {
|
|
130
122
|
if (!assumeRolePayload || !assumeRolePayload.roleArn || !assumeRolePayload.roleSessionName) {
|
|
131
123
|
return;
|
|
132
124
|
}
|
|
133
125
|
const sts = new clientSts.STS({ region: assumeRolePayload.region });
|
|
134
|
-
return require$$
|
|
126
|
+
return require$$4.handleMaybePromise(
|
|
135
127
|
() => sts.assumeRole({
|
|
136
128
|
RoleArn: assumeRolePayload.roleArn,
|
|
137
129
|
RoleSessionName: assumeRolePayload.roleSessionName
|
|
@@ -149,18 +141,18 @@ function useAWSSigv4(opts) {
|
|
|
149
141
|
if (incomingOptions == null) {
|
|
150
142
|
return;
|
|
151
143
|
}
|
|
152
|
-
return require$$
|
|
144
|
+
return require$$4.handleMaybePromise(
|
|
153
145
|
() => incomingOptions.enabled(request, serverContext),
|
|
154
146
|
(ifEnabled) => {
|
|
155
147
|
if (!ifEnabled) {
|
|
156
148
|
return;
|
|
157
149
|
}
|
|
158
|
-
return require$$
|
|
150
|
+
return require$$4.handleMaybePromise(
|
|
159
151
|
() => {
|
|
160
152
|
if (!incomingOptions) {
|
|
161
153
|
throw new Error("Missing options setup");
|
|
162
154
|
}
|
|
163
|
-
return require$$
|
|
155
|
+
return require$$4.handleMaybePromise(
|
|
164
156
|
() => incomingOptions.onBeforeParse(request, serverContext),
|
|
165
157
|
(ifContinue) => {
|
|
166
158
|
if (!ifContinue) {
|
|
@@ -239,7 +231,7 @@ function useAWSSigv4(opts) {
|
|
|
239
231
|
request,
|
|
240
232
|
serverContext
|
|
241
233
|
};
|
|
242
|
-
return require$$
|
|
234
|
+
return require$$4.handleMaybePromise(
|
|
243
235
|
() => incomingOptions.secretAccessKey?.(payload),
|
|
244
236
|
(secretKey) => {
|
|
245
237
|
if (!secretKey) {
|
|
@@ -249,7 +241,7 @@ function useAWSSigv4(opts) {
|
|
|
249
241
|
);
|
|
250
242
|
}
|
|
251
243
|
payload.secretAccessKey = secretKey;
|
|
252
|
-
return require$$
|
|
244
|
+
return require$$4.handleMaybePromise(
|
|
253
245
|
() => incomingOptions.onAfterParse(payload),
|
|
254
246
|
(shouldContinue) => {
|
|
255
247
|
if (!shouldContinue) {
|
|
@@ -350,7 +342,7 @@ function useAWSSigv4(opts) {
|
|
|
350
342
|
if (!isBufferOrString(options.body)) {
|
|
351
343
|
return;
|
|
352
344
|
}
|
|
353
|
-
return require$$
|
|
345
|
+
return require$$4.handleMaybePromise(
|
|
354
346
|
() => outgoingOptionsFactory({ url, options, subgraphName }),
|
|
355
347
|
(factoryResult) => {
|
|
356
348
|
if (factoryResult === false) {
|
|
@@ -376,7 +368,7 @@ function useAWSSigv4(opts) {
|
|
|
376
368
|
service = factoryResult.serviceName;
|
|
377
369
|
region = factoryResult.region;
|
|
378
370
|
}
|
|
379
|
-
return require$$
|
|
371
|
+
return require$$4.handleMaybePromise(
|
|
380
372
|
() => roleArn && roleSessionName ? new clientSts.STS({ region }).assumeRole({
|
|
381
373
|
RoleArn: roleArn,
|
|
382
374
|
RoleSessionName: roleSessionName
|
|
@@ -423,9 +415,9 @@ const encodeRfc3986 = (urlEncodedString) => urlEncodedString.replace(
|
|
|
423
415
|
/[!'()*]/g,
|
|
424
416
|
(c) => "%" + c.charCodeAt(0).toString(16).toUpperCase()
|
|
425
417
|
);
|
|
426
|
-
const hmac = (secretKey, data) => require$$2
|
|
427
|
-
const hash = (data) => require$$2
|
|
428
|
-
const hmacHex = (secretKey, data) => require$$2
|
|
418
|
+
const hmac = (secretKey, data) => require$$2.createHmac("sha256", secretKey).update(data, "utf8").digest();
|
|
419
|
+
const hash = (data) => require$$2.createHash("sha256").update(data, "utf8").digest("hex");
|
|
420
|
+
const hmacHex = (secretKey, data) => require$$2.createHmac("sha256", secretKey).update(data, "utf8").digest("hex");
|
|
429
421
|
|
|
430
422
|
exports.AWSSignV4Headers = AWSSignV4Headers;
|
|
431
423
|
exports.useAWSSigv4 = useAWSSigv4;
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,6 @@ const possibleGraphQLErrorProperties = [
|
|
|
29
29
|
'name',
|
|
30
30
|
'stack',
|
|
31
31
|
'extensions',
|
|
32
|
-
'coordinate',
|
|
33
32
|
];
|
|
34
33
|
function isGraphQLErrorLike(error) {
|
|
35
34
|
return (error != null &&
|
|
@@ -42,17 +41,10 @@ function createGraphQLError(message, options) {
|
|
|
42
41
|
isGraphQLErrorLike(options.originalError)) {
|
|
43
42
|
options.originalError = createGraphQLError(options.originalError.message, options.originalError);
|
|
44
43
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const error = versionInfo.major >= 16
|
|
48
|
-
? new Constructor(message, options)
|
|
49
|
-
: new Constructor(message, options?.nodes, options?.source, options?.positions, options?.path, options?.originalError, options?.extensions);
|
|
50
|
-
if (options?.coordinate && error.coordinate == null) {
|
|
51
|
-
Object.defineProperties(error, {
|
|
52
|
-
coordinate: { value: options.coordinate, enumerable: true, configurable: true },
|
|
53
|
-
});
|
|
44
|
+
if (versionInfo.major >= 17) {
|
|
45
|
+
return new GraphQLError(message, options);
|
|
54
46
|
}
|
|
55
|
-
return
|
|
47
|
+
return new GraphQLError(message, options?.nodes, options?.source, options?.positions, options?.path, options?.originalError, options?.extensions);
|
|
56
48
|
}
|
|
57
49
|
|
|
58
50
|
var AWSSignV4Headers = /* @__PURE__ */ ((AWSSignV4Headers2) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-hive/plugin-aws-sigv4",
|
|
3
|
-
"version": "2.0.18-alpha-
|
|
3
|
+
"version": "2.0.18-alpha-69c4d19643f57268271203fbf82c3b8687f13723",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -43,17 +43,17 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@aws-sdk/client-sts": "^3.931.0",
|
|
46
|
-
"@graphql-mesh/fusion-runtime": "1.6.0-alpha-
|
|
46
|
+
"@graphql-mesh/fusion-runtime": "1.6.0-alpha-69c4d19643f57268271203fbf82c3b8687f13723",
|
|
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.4.0-alpha-
|
|
53
|
+
"@graphql-hive/gateway-runtime": "2.4.0-alpha-69c4d19643f57268271203fbf82c3b8687f13723",
|
|
54
54
|
"@types/aws4": "^1.11.6",
|
|
55
55
|
"graphql": "^16.12.0",
|
|
56
|
-
"graphql-yoga": "^5.
|
|
56
|
+
"graphql-yoga": "^5.16.2",
|
|
57
57
|
"pkgroll": "2.21.3"
|
|
58
58
|
},
|
|
59
59
|
"sideEffects": false
|