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

@aws-sdk/signature-v4-crt

Package Overview
Dependencies
Maintainers
5
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/signature-v4-crt

A revision of AWS Signature V4 request signer based on AWS Common Runtime https://github.com/awslabs/aws-crt-nodejs

  • 3.667.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
267K
increased by5.05%
Maintainers
5
Weekly downloads
 
Created

What is @aws-sdk/signature-v4-crt?

@aws-sdk/signature-v4-crt is a package that provides AWS Signature Version 4 signing for requests made to AWS services. It is part of the AWS SDK for JavaScript and leverages the AWS Common Runtime (CRT) for enhanced performance and security.

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

Sign HTTP Requests

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

const { SignatureV4Crt } = require('@aws-sdk/signature-v4-crt');
const { HttpRequest } = require('@aws-sdk/protocol-http');
const { defaultProvider } = require('@aws-sdk/credential-provider-node');

const signRequest = async () => {
  const signer = new SignatureV4Crt({
    service: 's3',
    region: 'us-east-1',
    credentials: defaultProvider(),
  });

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

  const signedRequest = await signer.sign(request);
  console.log(signedRequest);
};

signRequest();

Sign WebSocket Requests

This feature allows you to sign WebSocket requests to AWS services using AWS Signature Version 4. The code sample demonstrates how to sign a WebSocket request to an AWS IoT endpoint using the SignatureV4Crt class.

const { SignatureV4Crt } = require('@aws-sdk/signature-v4-crt');
const { WebSocketRequest } = require('@aws-sdk/protocol-websocket');
const { defaultProvider } = require('@aws-sdk/credential-provider-node');

const signWebSocketRequest = async () => {
  const signer = new SignatureV4Crt({
    service: 'iot',
    region: 'us-east-1',
    credentials: defaultProvider(),
  });

  const request = new WebSocketRequest({
    hostname: 'example.iot.us-east-1.amazonaws.com',
    path: '/mqtt',
  });

  const signedRequest = await signer.sign(request);
  console.log(signedRequest);
};

signWebSocketRequest();

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

FAQs

Package last updated on 08 Oct 2024

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc