xk6modules

package module
v0.0.0-...-acc22c6 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

README

Zitadel xk6 modules

Provides helper functions for the Zitadel load tests.

Provided functions

signJWTProfileAssertion

Signs a JWT token request using OIDC and returns it as string.

The function can be used as follows:

// @ts-ignore Import module
import zitadel from 'k6/x/zitadel';

const assertion = zitadel.signJWTProfileAssertion(
  this.keyPayload.userId,
  this.keyPayload.keyId,
  {
    audience: [Config.host],
    expiration: this.keyPayload.expiration,
    key: privateKey
});

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWTProfileRequest

type JWTProfileRequest struct {
	Audience   oidc.Audience
	Expiration time.Duration
	Key        []byte
}

type Mod

type Mod struct{}

func (*Mod) JwtFromKey

func (*Mod) JwtFromKey(key []byte, audience string) (string, error)

JwtFromKey creates a jwt token from the provided key and audience The function name in k6 is jwtFromKey

func (*Mod) SignJWTProfileAssertion

func (*Mod) SignJWTProfileAssertion(userID string, keyID string, request JWTProfileRequest) (string, error)

Jump to

Keyboard shortcuts

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