Socket
Socket
Sign inDemoInstall

@aws-sdk/signature-v4

Package Overview
Dependencies
7
Maintainers
5
Versions
142
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/signature-v4


Version published
Weekly downloads
4.3M
decreased by-6.8%
Maintainers
5
Created
Weekly downloads
 

Package description

What is @aws-sdk/signature-v4?

@aws-sdk/signature-v4 is a package from the AWS SDK for JavaScript that provides functionality to sign AWS requests using the Signature Version 4 signing process. This is essential for securely making authenticated requests to AWS services.

What are @aws-sdk/signature-v4's main functionalities?

Signing HTTP Requests

This feature allows you to sign HTTP requests to AWS services using the Signature Version 4 signing process. The code sample demonstrates how to sign a GET request to an S3 bucket.

const { SignatureV4 } = require('@aws-sdk/signature-v4');
const { Sha256 } = require('@aws-crypto/sha256-js');
const { HttpRequest } = require('@aws-sdk/protocol-http');

const signer = new SignatureV4({
  service: 's3',
  region: 'us-east-1',
  credentials: {
    accessKeyId: 'AKID',
    secretAccessKey: 'SECRET'
  },
  sha256: Sha256
});

const request = new HttpRequest({
  method: 'GET',
  hostname: 'examplebucket.s3.amazonaws.com',
  path: '/exampleobject'
});

signer.sign(request).then(signedRequest => {
  console.log(signedRequest);
});

Presigning URLs

This feature allows you to generate presigned URLs for AWS services, which can be used to grant temporary access to resources. The code sample demonstrates how to presign a URL for an S3 object.

const { S3RequestPresigner } = require('@aws-sdk/s3-request-presigner');
const { HttpRequest } = require('@aws-sdk/protocol-http');
const { Hash } = require('@aws-sdk/hash-node');
const { formatUrl } = require('@aws-sdk/util-format-url');

const presigner = new S3RequestPresigner({
  credentials: {
    accessKeyId: 'AKID',
    secretAccessKey: 'SECRET'
  },
  region: 'us-east-1',
  sha256: Hash.bind(null, 'sha256')
});

const request = new HttpRequest({
  method: 'GET',
  hostname: 'examplebucket.s3.amazonaws.com',
  path: '/exampleobject'
});

presigner.presign(request).then(presignedUrl => {
  console.log(formatUrl(presignedUrl));
});

Other packages similar to @aws-sdk/signature-v4

Changelog

Source

3.272.0 (2023-02-15)

Features

  • client-cloudtrail: This release adds an InsufficientEncryptionPolicyException type to the StartImport endpoint (4253089)
  • client-frauddetector: This release introduces Lists feature which allows customers to reference a set of values in Fraud Detector's rules. With Lists, customers can dynamically manage these attributes in real time. Lists can be created/deleted and its contents can be modified using the Fraud Detector API. (6186c03)
  • client-glue: Fix DirectJDBCSource not showing up in CLI code gen (bedba23)
  • client-privatenetworks: This release introduces a new StartNetworkResourceUpdate API, which enables return/replacement of hardware from a NetworkSite. (804b9bc)
  • client-wafv2: For protected CloudFront distributions, you can now use the AWS WAF Fraud Control account takeover prevention (ATP) managed rule group to block new login attempts from clients that have recently submitted too many failed login attempts. (dc28d4e)
  • clients: update client endpoints as of 2023-02-15 (2e05ae8)

Readme

Source

@aws-sdk/signature-v4

NPM version NPM downloads

FAQs

Last updated on 15 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc