serviceauth

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractBearerToken

func ExtractBearerToken(header string) string

Types

type ServiceClaims

type ServiceClaims struct {
	ServiceType string `json:"typ"`
	ServiceID   string `json:"id"`
	jwt.RegisteredClaims
}

type TokenManager

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

func NewTokenManager

func NewTokenManager(secret string) *TokenManager

func (*TokenManager) Parse

func (t *TokenManager) Parse(token string) (*ServiceClaims, error)

func (*TokenManager) Validate

func (t *TokenManager) Validate(expectedType, expectedID, token string) bool

Validate verifies the JWT signature and claims: typ must match, id must match when expectedID is non-empty. No expiration is enforced; tokens may omit exp based on current requirements.

Jump to

Keyboard shortcuts

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