Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@aws-sdk/signature-v4-crt
Advanced tools
A revision of AWS Signature V4 request signer based on AWS Common Runtime https://github.com/awslabs/aws-crt-nodejs
@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.
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();
@aws-sdk/signature-v4 is another package from the AWS SDK for JavaScript that provides AWS Signature Version 4 signing. Unlike @aws-sdk/signature-v4-crt, it does not leverage the AWS Common Runtime (CRT) and may have different performance characteristics.
aws4 is a lightweight library for signing AWS requests with Signature Version 4. It is not part of the AWS SDK for JavaScript and is often used in environments where a smaller dependency footprint is desired.
FAQs
A revision of AWS Signature V4 request signer based on AWS Common Runtime https://github.com/awslabs/aws-crt-nodejs
We found that @aws-sdk/signature-v4-crt demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
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.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.