jwtextract

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package jwtextract pulls JWT-shaped tokens from HTTP flows (Bearer header, JSON fields, URL path/query, cookies) for cross-host replay and SSO testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract(in Input) (token, source string)

Extract returns the first JWT found and a source label (e.g. "bearer", "json:login_token").

func ReplayPath

func ReplayPath(refPath, jwt string) string

ReplayPath builds the path to replay on each host for path-mode JWT replay. If refPath already embeds the token, it is returned unchanged.

func SourceUsesPath

func SourceUsesPath(source string) bool

SourceUsesPath reports whether replay should preserve/inject the JWT in the URL path.

Types

type Input

type Input struct {
	ReqHeaders map[string][]string
	Path       string
	RawQuery   string
	ReqBody    []byte
	ResBody    []byte
}

Input is the request/response material to search.

Jump to

Keyboard shortcuts

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