cognito

package module
v0.0.0-...-14bb45f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

xk6-cognito

An example module for https://k6.io/ to get a cognito access token using USER_SRP_AUTH flow.

See:

Install

Pre-built binaries
go install go.k6.io/xk6/cmd/xk6@latest
xk6 build master --with github.com/AjayvirS/xk6-cognito

./k6 run --vus 1 --duration 2s /scripts/examples/loadTest.js

Build from source
git clone https://github.com/AjayvirS/xk6-cognito.git && cd xk6-cognito
docker run --rm -v $(pwd):/scripts -it --entrypoint sh golang:1.17-alpine

cd /scripts/
go install go.k6.io/xk6/cmd/xk6@latest
xk6 build v0.32.0  --with github.com/tmieulet/xk6-cognito="/scripts"


Example

In examples, change all values with exToChange then run mkdir -p /scripts/target && xk6 run --vus 1 --duration 2s /scripts/examples/loadTest.js

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthOptionalParams

type AuthOptionalParams struct {
	// contains filtered or unexported fields
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the Cognito client wrapper.

func (*Client) Auth

func (c *Client) Auth(username string, password string, poolId string, clientId string, params AuthOptionalParams) (keyValue, error)

type Cognito

type Cognito struct{}

Cognito is the k6 extension for a Cognito client.

func (*Cognito) Connect

func (r *Cognito) Connect(region string) (*Client, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL