@smithy/core
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -7,1 +7,3 @@ "use strict"; | ||
tslib_1.__exportStar(require("./util-identity-and-auth"), exports); | ||
tslib_1.__exportStar(require("./getSmithyContext"), exports); | ||
tslib_1.__exportStar(require("./normalizeProvider"), exports); |
@@ -7,2 +7,6 @@ "use strict"; | ||
const util_middleware_1 = require("@smithy/util-middleware"); | ||
const defaultErrorHandler = (signingProperties) => (error) => { | ||
throw error; | ||
}; | ||
const defaultSuccessHandler = (httpResponse, signingProperties) => { }; | ||
const httpSigningMiddleware = (config) => (next, context) => async (args) => { | ||
@@ -17,8 +21,10 @@ if (!protocol_http_1.HttpRequest.isInstance(args.request)) { | ||
} | ||
const { httpAuthOption: { signingProperties }, identity, signer, } = scheme; | ||
return next({ | ||
const { httpAuthOption: { signingProperties = {} }, identity, signer, } = scheme; | ||
const output = await next({ | ||
...args, | ||
request: await signer.sign(args.request, identity, signingProperties || {}), | ||
}); | ||
request: await signer.sign(args.request, identity, signingProperties), | ||
}).catch((signer.errorHandler || defaultErrorHandler)(signingProperties)); | ||
(signer.successHandler || defaultSuccessHandler)(output.response, signingProperties); | ||
return output; | ||
}; | ||
exports.httpSigningMiddleware = httpSigningMiddleware; |
export * from "./middleware-http-auth-scheme"; | ||
export * from "./middleware-http-signing"; | ||
export * from "./util-identity-and-auth"; | ||
export * from "./getSmithyContext"; | ||
export * from "./normalizeProvider"; |
import { HttpRequest } from "@smithy/protocol-http"; | ||
import { SMITHY_CONTEXT_KEY, } from "@smithy/types"; | ||
import { getSmithyContext } from "@smithy/util-middleware"; | ||
const defaultErrorHandler = (signingProperties) => (error) => { | ||
throw error; | ||
}; | ||
const defaultSuccessHandler = (httpResponse, signingProperties) => { }; | ||
export const httpSigningMiddleware = (config) => (next, context) => async (args) => { | ||
@@ -13,7 +17,9 @@ if (!HttpRequest.isInstance(args.request)) { | ||
} | ||
const { httpAuthOption: { signingProperties }, identity, signer, } = scheme; | ||
return next({ | ||
const { httpAuthOption: { signingProperties = {} }, identity, signer, } = scheme; | ||
const output = await next({ | ||
...args, | ||
request: await signer.sign(args.request, identity, signingProperties || {}), | ||
}); | ||
request: await signer.sign(args.request, identity, signingProperties), | ||
}).catch((signer.errorHandler || defaultErrorHandler)(signingProperties)); | ||
(signer.successHandler || defaultSuccessHandler)(output.response, signingProperties); | ||
return output; | ||
}; |
export * from "./middleware-http-auth-scheme"; | ||
export * from "./middleware-http-signing"; | ||
export * from "./util-identity-and-auth"; | ||
export * from "./getSmithyContext"; | ||
export * from "./normalizeProvider"; |
export * from "./middleware-http-auth-scheme"; | ||
export * from "./middleware-http-signing"; | ||
export * from "./util-identity-and-auth"; | ||
export * from "./getSmithyContext"; | ||
export * from "./normalizeProvider"; |
{ | ||
"name": "@smithy/core", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"scripts": { | ||
@@ -14,3 +14,3 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'", | ||
"format": "prettier --config ../../prettier.config.js --ignore-path ../.prettierignore --write \"**/*.{ts,md,json}\"", | ||
"test": "yarn g:jest --passWithNoTests" | ||
"test": "yarn g:jest" | ||
}, | ||
@@ -27,7 +27,7 @@ "main": "./dist-cjs/index.js", | ||
"dependencies": { | ||
"@smithy/middleware-endpoint": "^2.2.0", | ||
"@smithy/middleware-retry": "^2.0.20", | ||
"@smithy/middleware-serde": "^2.0.13", | ||
"@smithy/protocol-http": "^3.0.9", | ||
"@smithy/types": "^2.5.0", | ||
"@smithy/middleware-endpoint": "^2.2.1", | ||
"@smithy/middleware-retry": "^2.0.21", | ||
"@smithy/middleware-serde": "^2.0.14", | ||
"@smithy/protocol-http": "^3.0.10", | ||
"@smithy/types": "^2.6.0", | ||
"tslib": "^2.5.0" | ||
@@ -34,0 +34,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56058
71
940