pkce

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

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

Go to latest
Published: Jun 16, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

README

xk6-oauth-pkce

xk6-oauth-pkce is a k6 extension provides the capability to generate OAuth PKCE code verifier and code challenge.

Build

To build a k6 binary with this extension, install xk6 and build your custom k6 binary with the this extension:

  1. Install xk6:
$ go install go.k6.io/xk6/cmd/xk6@latest
  1. Build the binary:
$ xk6 build --with github.com/AlexF4Dev/xk6-oauth-pkce@latest

example

import pkce from 'k6/x/oauth-pkce'

export default function () {
    const verifier = pkce.create("S256")
    console.log(verifier)
    console.log(verifier.verifier)
    console.log(verifier.challenge)
}

Documentation

Index

Constants

View Source
const (
	CodeChallengePlain CodeChallengeMethod = "PLAIN"
	CodeChallengeS256                      = "S256"
	CodeChallengeS512                      = "S512"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeChallengeMethod

type CodeChallengeMethod string

type CodeVerifier

type CodeVerifier struct {
	Verifier        string
	ChallengeMethod CodeChallengeMethod
	Challenge       string
}

type ModuleInstance

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

ModuleInstance represents an instance of the OAuth PKCE module.

func (*ModuleInstance) Exports

func (mi *ModuleInstance) Exports() k6modules.Exports

Exports returns the exports of the OAuth PKCE module so that it can be used in test scripts.

type OAuthPkceModule

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

OAuthPkceModule is the entrypoint into the OAuth PKCE module.

func (*OAuthPkceModule) Create

type RootModule

type RootModule struct{}

RootModule is the global module instance that will create module instances for each VU.

func New

func New() *RootModule

New returns a pointer to a new RootModule instance.

func (*RootModule) NewModuleInstance

func (*RootModule) NewModuleInstance(vu k6modules.VU) k6modules.Instance

NewModuleInstance implements the k6modules.Module interface to return a new instance for each VU.

Jump to

Keyboard shortcuts

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