auth

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler handles authentication requests for the assertoor web UI.

func NewAuthHandler

func NewAuthHandler(tokenKey, userHeader string, disableLocalToken bool) *Handler

NewAuthHandler creates a new authentication handler.

func (*Handler) CheckAuthToken

func (h *Handler) CheckAuthToken(tokenStr string) *jwt.Token

func (*Handler) GetLogin

func (h *Handler) GetLogin(w http.ResponseWriter, r *http.Request)

GetLogin redirects to the index page.

func (*Handler) GetToken

func (h *Handler) GetToken(w http.ResponseWriter, r *http.Request)

GetToken handles the authentication request.

func (*Handler) GetTokenSubject added in v1.1.17

func (h *Handler) GetTokenSubject(authHeader string) string

GetTokenSubject extracts the subject claim from the authorization header's JWT token. Returns an empty string if the token is missing, invalid, or has no subject.

Jump to

Keyboard shortcuts

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