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/middleware-apply-body-checksum
Advanced tools
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-apply-body-checksum/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-apply-body-checksum) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-apply-body-checksu
@aws-sdk/middleware-apply-body-checksum is a middleware package for the AWS SDK for JavaScript. It is used to automatically apply checksums to the body of requests, ensuring data integrity during transmission.
Apply Checksum to Request Body
This feature demonstrates how to apply a checksum to the body of a request using the @aws-sdk/middleware-apply-body-checksum package. The middleware is added to the S3 client's middleware stack, ensuring that the body of the PutObjectCommand request is checksummed before being sent.
const { S3Client, PutObjectCommand } = require('@aws-sdk/client-s3');
const { applyBodyChecksumMiddleware } = require('@aws-sdk/middleware-apply-body-checksum');
const client = new S3Client({ region: 'us-west-2' });
client.middlewareStack.add(applyBodyChecksumMiddleware(), {
step: 'build',
priority: 'high',
});
const command = new PutObjectCommand({
Bucket: 'example-bucket',
Key: 'example-object',
Body: 'Hello, world!',
});
client.send(command).then((response) => {
console.log('Success', response);
}).catch((error) => {
console.error('Error', error);
});
The 'aws-sdk' package is the official AWS SDK for JavaScript. It provides a comprehensive set of tools for interacting with AWS services, including S3. While it does not specifically focus on applying body checksums, it offers a wide range of functionalities for AWS service interactions.
The 'axios' package is a popular HTTP client for Node.js and the browser. It allows for intercepting requests and responses, which can be used to implement custom checksum logic. However, it does not provide built-in support for applying body checksums like @aws-sdk/middleware-apply-body-checksum.
The 'request' package is a simplified HTTP client for Node.js. Similar to axios, it allows for request and response interception, enabling custom checksum implementation. It does not offer built-in checksum functionality like @aws-sdk/middleware-apply-body-checksum.
This package provides AWS SDK for JavaScript middleware that applies a checksum of the request body as a header.
3.257.0 (2023-01-24)
FAQs
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-apply-body-checksum/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-apply-body-checksum) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-apply-body-checksu
The npm package @aws-sdk/middleware-apply-body-checksum receives a total of 221,561 weekly downloads. As such, @aws-sdk/middleware-apply-body-checksum popularity was classified as popular.
We found that @aws-sdk/middleware-apply-body-checksum demonstrated a not healthy version release cadence and project activity because the last version was released 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.