inspector

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package inspector provides functionality for introspecting json-web-tokens

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidClaims = errors.New("claims are invalid")
	ErrInvalidToken  = errors.New("invalid token")
)

Functions

This section is empty.

Types

type Header struct {
	Algorithm   string
	Type        string
	ContentType string
}

Headers represents the token header information

type Inspector

type Inspector interface {
	Inspect(token string) (ParsedToken, error)
}

type JwtNopInspector

type JwtNopInspector struct{}

func (*JwtNopInspector) Inspect

func (j *JwtNopInspector) Inspect(raw string) (ParsedToken, error)

Inspect will take a raw string (token) and export the token data with no verification

type ParsedToken

type ParsedToken struct {
	HeaderRaw    string
	ClaimRaw     string
	SignatureRaw string

	Header Header
	Claims map[string]interface{}
}

ParsedToken is the ouput of this package

Jump to

Keyboard shortcuts

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