@aws-sdk/core
Advanced tools
Comparing version 3.622.0 to 3.623.0
@@ -25,2 +25,3 @@ "use strict"; | ||
AWSSDKSigV4Signer: () => AWSSDKSigV4Signer, | ||
AwsSdkSigV4ASigner: () => AwsSdkSigV4ASigner, | ||
AwsSdkSigV4Signer: () => AwsSdkSigV4Signer, | ||
@@ -78,2 +79,3 @@ resolveAWSSDKSigV4Config: () => resolveAWSSDKSigV4Config, | ||
const signingRegion = signingProperties == null ? void 0 : signingProperties.signingRegion; | ||
const signingRegionSet = signingProperties == null ? void 0 : signingProperties.signingRegionSet; | ||
const signingName = signingProperties == null ? void 0 : signingProperties.signingName; | ||
@@ -84,2 +86,3 @@ return { | ||
signingRegion, | ||
signingRegionSet, | ||
signingName | ||
@@ -128,2 +131,25 @@ }; | ||
// src/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.ts | ||
var import_protocol_http3 = require("@smithy/protocol-http"); | ||
var _AwsSdkSigV4ASigner = class _AwsSdkSigV4ASigner extends AwsSdkSigV4Signer { | ||
async sign(httpRequest, identity, signingProperties) { | ||
var _a; | ||
if (!import_protocol_http3.HttpRequest.isInstance(httpRequest)) { | ||
throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); | ||
} | ||
const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties( | ||
signingProperties | ||
); | ||
const multiRegionOverride = ((_a = signingRegionSet == null ? void 0 : signingRegionSet.join) == null ? void 0 : _a.call(signingRegionSet, ",")) ?? signingRegion; | ||
const signedRequest = await signer.sign(httpRequest, { | ||
signingDate: getSkewCorrectedDate(config.systemClockOffset), | ||
signingRegion: multiRegionOverride, | ||
signingService: signingName | ||
}); | ||
return signedRequest; | ||
} | ||
}; | ||
__name(_AwsSdkSigV4ASigner, "AwsSdkSigV4ASigner"); | ||
var AwsSdkSigV4ASigner = _AwsSdkSigV4ASigner; | ||
// src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts | ||
@@ -227,2 +253,3 @@ var import_core = require("@smithy/core"); | ||
AWSSDKSigV4Signer, | ||
AwsSdkSigV4ASigner, | ||
AwsSdkSigV4Signer, | ||
@@ -229,0 +256,0 @@ resolveAWSSDKSigV4Config, |
@@ -9,3 +9,3 @@ import { HttpRequest } from "@smithy/protocol-http"; | ||
}; | ||
const validateSigningProperties = async (signingProperties) => { | ||
export const validateSigningProperties = async (signingProperties) => { | ||
const context = throwSigningPropertyError("context", signingProperties.context); | ||
@@ -17,2 +17,3 @@ const config = throwSigningPropertyError("config", signingProperties.config); | ||
const signingRegion = signingProperties?.signingRegion; | ||
const signingRegionSet = signingProperties?.signingRegionSet; | ||
const signingName = signingProperties?.signingName; | ||
@@ -23,2 +24,3 @@ return { | ||
signingRegion, | ||
signingRegionSet, | ||
signingName, | ||
@@ -25,0 +27,0 @@ }; |
@@ -1,2 +0,3 @@ | ||
export * from "./AwsSdkSigV4Signer"; | ||
export { AwsSdkSigV4Signer, AWSSDKSigV4Signer } from "./AwsSdkSigV4Signer"; | ||
export { AwsSdkSigV4ASigner } from "./AwsSdkSigV4ASigner"; | ||
export * from "./resolveAwsSdkSigV4Config"; |
@@ -1,5 +0,28 @@ | ||
import { AwsCredentialIdentity, HttpRequest as IHttpRequest, HttpResponse, HttpSigner } from "@smithy/types"; | ||
import { AuthScheme, AwsCredentialIdentity, HttpRequest as IHttpRequest, HttpResponse, HttpSigner, RequestSigner } from "@smithy/types"; | ||
/** | ||
* @internal | ||
*/ | ||
interface AwsSdkSigV4Config { | ||
systemClockOffset: number; | ||
signer: (authScheme?: AuthScheme) => Promise<RequestSigner>; | ||
} | ||
/** | ||
* @internal | ||
*/ | ||
interface AwsSdkSigV4AuthSigningProperties { | ||
config: AwsSdkSigV4Config; | ||
signer: RequestSigner; | ||
signingRegion?: string; | ||
signingRegionSet?: string[]; | ||
signingName?: string; | ||
} | ||
/** | ||
* @internal | ||
*/ | ||
export declare const validateSigningProperties: (signingProperties: Record<string, unknown>) => Promise<AwsSdkSigV4AuthSigningProperties>; | ||
/** | ||
* @internal | ||
* Note: this is not a signing algorithm implementation. The sign method | ||
* accepts the real signer as an input parameter. | ||
*/ | ||
export declare class AwsSdkSigV4Signer implements HttpSigner { | ||
@@ -18,1 +41,2 @@ sign(httpRequest: IHttpRequest, | ||
export declare const AWSSDKSigV4Signer: typeof AwsSdkSigV4Signer; | ||
export {}; |
@@ -1,2 +0,3 @@ | ||
export * from "./AwsSdkSigV4Signer"; | ||
export { AwsSdkSigV4Signer, AWSSDKSigV4Signer } from "./AwsSdkSigV4Signer"; | ||
export { AwsSdkSigV4ASigner } from "./AwsSdkSigV4ASigner"; | ||
export * from "./resolveAwsSdkSigV4Config"; |
import { | ||
AuthScheme, | ||
AwsCredentialIdentity, | ||
@@ -6,3 +7,18 @@ HttpRequest as IHttpRequest, | ||
HttpSigner, | ||
RequestSigner, | ||
} from "@smithy/types"; | ||
interface AwsSdkSigV4Config { | ||
systemClockOffset: number; | ||
signer: (authScheme?: AuthScheme) => Promise<RequestSigner>; | ||
} | ||
interface AwsSdkSigV4AuthSigningProperties { | ||
config: AwsSdkSigV4Config; | ||
signer: RequestSigner; | ||
signingRegion?: string; | ||
signingRegionSet?: string[]; | ||
signingName?: string; | ||
} | ||
export declare const validateSigningProperties: ( | ||
signingProperties: Record<string, unknown> | ||
) => Promise<AwsSdkSigV4AuthSigningProperties>; | ||
export declare class AwsSdkSigV4Signer implements HttpSigner { | ||
@@ -23,1 +39,2 @@ sign( | ||
export declare const AWSSDKSigV4Signer: typeof AwsSdkSigV4Signer; | ||
export {}; |
@@ -1,2 +0,3 @@ | ||
export * from "./AwsSdkSigV4Signer"; | ||
export { AwsSdkSigV4Signer, AWSSDKSigV4Signer } from "./AwsSdkSigV4Signer"; | ||
export { AwsSdkSigV4ASigner } from "./AwsSdkSigV4ASigner"; | ||
export * from "./resolveAwsSdkSigV4Config"; |
{ | ||
"name": "@aws-sdk/core", | ||
"version": "3.622.0", | ||
"version": "3.623.0", | ||
"description": "Core functions & classes shared by multiple AWS SDK clients", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
67148
80
1556