cfaccesstest

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cfaccesstest makes Cloudflare Access tokens for tests: an RSA signing key set, its JWKS document and signed JWTs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keys

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

Keys is a set of signing keys by key ID.

func New

func New(t testing.TB) *Keys

New makes a key set with one key, "k1".

func (*Keys) JWKS

func (ks *Keys) JWKS() []byte

JWKS is the key set as https://TEAM/cdn-cgi/access/certs serves it.

func (*Keys) Rotate

func (ks *Keys) Rotate(t testing.TB, kid string)

Rotate adds a key with ID kid.

func (*Keys) Server

func (ks *Keys) Server(t testing.TB) string

Server serves the key set at /cdn-cgi/access/certs; it returns the URL of that document.

func (*Keys) Sign

func (ks *Keys) Sign(t testing.TB, kid string, claims any) string

Sign makes a token signed by the key kid; a kid not in the set is signed by the first key but names kid.

func (*Keys) SignWithStranger

func (ks *Keys) SignWithStranger(t testing.TB, kid string, claims any) string

SignWithStranger makes a token that names kid but is signed by a key outside the set.

func (*Keys) Unsigned

func (ks *Keys) Unsigned(t testing.TB, kid string, claims any) string

Unsigned makes a token with alg "none".

Jump to

Keyboard shortcuts

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