Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-sdk/middleware-sdk-ec2

Package Overview
Dependencies
Maintainers
5
Versions
213
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/middleware-sdk-ec2 - npm Package Compare versions

Comparing version 3.310.0 to 3.310.1

18

dist-cjs/index.js

@@ -7,2 +7,3 @@ "use strict";

const signature_v4_1 = require("@aws-sdk/signature-v4");
const smithy_client_1 = require("@aws-sdk/smithy-client");
const util_format_url_1 = require("@aws-sdk/util-format-url");

@@ -12,2 +13,3 @@ const version = "2016-11-15";

return (next, context) => async (args) => {
var _a, _b;
const { input } = args;

@@ -30,3 +32,3 @@ if (!input.PresignedUrl) {

const resolvedEndpoint = typeof options.endpoint === "function" ? await options.endpoint() : (0, middleware_endpoint_1.toEndpointV1)(endpoint);
const request = new protocol_http_1.HttpRequest({
const requestToSign = new protocol_http_1.HttpRequest({
...resolvedEndpoint,

@@ -38,6 +40,5 @@ protocol: "https",

query: {
...input,
Action: "CopySnapshot",
Version: version,
SourceRegion: input.SourceRegion,
SourceSnapshotId: input.SourceSnapshotId,
DestinationRegion: destinationRegion,

@@ -53,3 +54,3 @@ },

});
const presignedRequest = await signer.presign(request, {
const presignedRequest = await signer.presign(requestToSign, {
expiresIn: 3600,

@@ -65,2 +66,11 @@ });

};
if (protocol_http_1.HttpRequest.isInstance(args.request)) {
const { request } = args;
if (!((_a = request.body) !== null && _a !== void 0 ? _a : "").includes("DestinationRegion=")) {
request.body += `&DestinationRegion=${destinationRegion}`;
}
if (!((_b = request.body) !== null && _b !== void 0 ? _b : "").includes("PresignedUrl=")) {
request.body += `&PresignedUrl=${(0, smithy_client_1.extendedEncodeURIComponent)(args.input.PresignedUrl)}`;
}
}
}

@@ -67,0 +77,0 @@ return next(args);

import { getEndpointFromInstructions, toEndpointV1 } from "@aws-sdk/middleware-endpoint";
import { HttpRequest } from "@aws-sdk/protocol-http";
import { SignatureV4 } from "@aws-sdk/signature-v4";
import { extendedEncodeURIComponent } from "@aws-sdk/smithy-client";
import { formatUrl } from "@aws-sdk/util-format-url";

@@ -25,3 +26,3 @@ const version = "2016-11-15";

const resolvedEndpoint = typeof options.endpoint === "function" ? await options.endpoint() : toEndpointV1(endpoint);
const request = new HttpRequest({
const requestToSign = new HttpRequest({
...resolvedEndpoint,

@@ -33,6 +34,5 @@ protocol: "https",

query: {
...input,
Action: "CopySnapshot",
Version: version,
SourceRegion: input.SourceRegion,
SourceSnapshotId: input.SourceSnapshotId,
DestinationRegion: destinationRegion,

@@ -48,3 +48,3 @@ },

});
const presignedRequest = await signer.presign(request, {
const presignedRequest = await signer.presign(requestToSign, {
expiresIn: 3600,

@@ -60,2 +60,11 @@ });

};
if (HttpRequest.isInstance(args.request)) {
const { request } = args;
if (!(request.body ?? "").includes("DestinationRegion=")) {
request.body += `&DestinationRegion=${destinationRegion}`;
}
if (!(request.body ?? "").includes("PresignedUrl=")) {
request.body += `&PresignedUrl=${extendedEncodeURIComponent(args.input.PresignedUrl)}`;
}
}
}

@@ -62,0 +71,0 @@ return next(args);

@@ -1,2 +0,2 @@

import { AwsCredentialIdentity, ChecksumConstructor, Endpoint, HashConstructor, InitializeMiddleware, MemoizedProvider, Pluggable, Provider, RegionInfoProvider, RelativeMiddlewareOptions, SerializeHandlerOptions } from "@aws-sdk/types";
import { AwsCredentialIdentity, ChecksumConstructor, Endpoint, HashConstructor, MemoizedProvider, Pluggable, Provider, RegionInfoProvider, RelativeMiddlewareOptions, SerializeHandlerOptions, SerializeMiddleware } from "@aws-sdk/types";
interface PreviouslyResolved {

@@ -10,5 +10,5 @@ credentials: MemoizedProvider<AwsCredentialIdentity>;

}
export declare function copySnapshotPresignedUrlMiddleware(options: PreviouslyResolved): InitializeMiddleware<any, any>;
export declare function copySnapshotPresignedUrlMiddleware(options: PreviouslyResolved): SerializeMiddleware<any, any>;
export declare const copySnapshotPresignedUrlMiddlewareOptions: SerializeHandlerOptions & RelativeMiddlewareOptions;
export declare const getCopySnapshotPresignedUrlPlugin: (config: PreviouslyResolved) => Pluggable<any, any>;
export {};
import { SourceData } from "@aws-sdk/types";
export declare class MockSha256 {
constructor(secret?: string | ArrayBuffer | ArrayBufferView);
update(data?: SourceData): void;
digest(): Promise<Uint8Array>;
constructor(secret?: string | ArrayBuffer | ArrayBufferView);
update(data?: SourceData): void;
digest(): Promise<Uint8Array>;
}
export declare const region: () => Promise<string>;
export declare const credentials: () => Promise<{
accessKeyId: string;
secretAccessKey: string;
sessionToken: string;
accessKeyId: string;
secretAccessKey: string;
sessionToken: string;
}>;

@@ -1,30 +0,13 @@

import {
AwsCredentialIdentity,
ChecksumConstructor,
Endpoint,
HashConstructor,
InitializeMiddleware,
MemoizedProvider,
Pluggable,
Provider,
RegionInfoProvider,
RelativeMiddlewareOptions,
SerializeHandlerOptions,
} from "@aws-sdk/types";
import { AwsCredentialIdentity, ChecksumConstructor, Endpoint, HashConstructor, MemoizedProvider, Pluggable, Provider, RegionInfoProvider, RelativeMiddlewareOptions, SerializeHandlerOptions, SerializeMiddleware } from "@aws-sdk/types";
interface PreviouslyResolved {
credentials: MemoizedProvider<AwsCredentialIdentity>;
endpoint?: Provider<Endpoint>;
region: Provider<string>;
sha256: ChecksumConstructor | HashConstructor;
signingEscapePath: boolean;
regionInfoProvider?: RegionInfoProvider;
credentials: MemoizedProvider<AwsCredentialIdentity>;
endpoint?: Provider<Endpoint>;
region: Provider<string>;
sha256: ChecksumConstructor | HashConstructor;
signingEscapePath: boolean;
regionInfoProvider?: RegionInfoProvider;
}
export declare function copySnapshotPresignedUrlMiddleware(
options: PreviouslyResolved
): InitializeMiddleware<any, any>;
export declare const copySnapshotPresignedUrlMiddlewareOptions: SerializeHandlerOptions &
RelativeMiddlewareOptions;
export declare const getCopySnapshotPresignedUrlPlugin: (
config: PreviouslyResolved
) => Pluggable<any, any>;
export declare function copySnapshotPresignedUrlMiddleware(options: PreviouslyResolved): SerializeMiddleware<any, any>;
export declare const copySnapshotPresignedUrlMiddlewareOptions: SerializeHandlerOptions & RelativeMiddlewareOptions;
export declare const getCopySnapshotPresignedUrlPlugin: (config: PreviouslyResolved) => Pluggable<any, any>;
export {};
{
"name": "@aws-sdk/middleware-sdk-ec2",
"version": "3.310.0",
"version": "3.310.1",
"scripts": {

@@ -26,2 +26,3 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",

"@aws-sdk/signature-v4": "3.310.0",
"@aws-sdk/smithy-client": "3.310.0",
"@aws-sdk/types": "3.310.0",

@@ -28,0 +29,0 @@ "@aws-sdk/util-format-url": "3.310.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc