Skip to content

AWSome mock data for JavaScript/TypeScript based AWS services.

License

Notifications You must be signed in to change notification settings

ShellXploit/aws-mock-data

Repository files navigation

AWS Mock Data

AWSome mock data for JavaScript/TypeScript based AWS services.

NPM Version License Release codecov

Description

AWS Mock Data is a package that provides mock data for testing AWS-related applications. It aims to simplify the process of generating realistic test data for various AWS services.

Installation

You can install AWS Mock Data using npm:

npm install --save-dev aws-mock-data

OR yarn:

yarn add --dev aws-mock-data

How to use

Cognito

To create mock cognito tokens, you can use the cognito module in awsServices.

import { awsServices, utils } from "aws-mock-data";

const keyPair = utils.getAsymmetricKeys();

const tokens = awsServices.cognito.getCognitoTokens({
	asymmetricKeys: keyPair,
	user: {
		emailId: "<email-id>"
	}
});

Cognito User Pool

To create Jwks for a cognito user pool, you can use the userPool module in awsServices.

import { awsServices, utils } from "aws-mock-data";

const keyPair = utils.getAsymmetricKeys();

const jwks = awsServices.userPool.getUserPoolJwks({
	asymmetricKeys: keyPair
});