CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-aws-sdk--client-sts

AWS SDK for JavaScript STS Client for Node.js, Browser and React Native, providing temporary security credentials and role assumption capabilities

92

1.05x

Evaluation92%

1.05x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-5/

S3 File Encryptor

A utility for securely uploading and downloading files from S3 using customer-provided encryption keys.

Capabilities

Upload encrypted file

Upload a file to S3 with server-side encryption using a customer-provided encryption key.

  • Given a bucket name "test-bucket", object key "document.txt", file content "Confidential Data", and a 32-byte encryption key, the file is uploaded successfully @test

Download encrypted file

Download a file from S3 that was encrypted with a customer-provided key.

  • Given a bucket name "test-bucket", object key "document.txt" that was uploaded with a specific encryption key, downloading with that same key returns the original content "Confidential Data" @test
  • Attempting to download the encrypted object without providing the encryption key throws an error @test

Verify encryption requirement

Ensure encryption keys are properly required for encrypted objects.

  • After uploading an object with customer-provided encryption, attempting to download it with an incorrect encryption key throws an error @test

Implementation

@generates

API

/**
 * Uploads a file to S3 with server-side encryption using a customer-provided key.
 *
 * @param bucket - The S3 bucket name
 * @param key - The object key (path) in S3
 * @param content - The file content to upload
 * @param encryptionKey - A 32-byte encryption key as a Buffer
 * @returns Promise that resolves when upload completes
 */
export async function uploadEncrypted(
  bucket: string,
  key: string,
  content: string,
  encryptionKey: Buffer
): Promise<void>;

/**
 * Downloads a file from S3 that was encrypted with a customer-provided key.
 *
 * @param bucket - The S3 bucket name
 * @param key - The object key (path) in S3
 * @param encryptionKey - The 32-byte encryption key used during upload
 * @returns Promise that resolves to the decrypted file content as a string
 */
export async function downloadEncrypted(
  bucket: string,
  key: string,
  encryptionKey: Buffer
): Promise<string>;

Dependencies { .dependencies }

AWS SDK S3 Client { .dependency }

Provides S3 operations with customer-provided encryption key support.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-aws-sdk--client-sts

tile.json