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.
You can install AWS Mock Data using npm:
npm install --save-dev aws-mock-data
OR yarn:
yarn add --dev aws-mock-data
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>"
}
});
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
});