supportsession

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CookieName = "support_session_token"
	TokenType  = "support_session"
	TTL        = 1 * time.Hour
)

Variables

This section is empty.

Functions

func ClearCookie

func ClearCookie(w http.ResponseWriter, r *http.Request)

ClearCookie deletes the support session cookie.

func GenerateToken

func GenerateToken(signer *jwt.Signer, adminAccountID, targetAccountID string) (string, error)

GenerateToken creates a signed JWT for a support session.

func ReadCookie

func ReadCookie(r *http.Request) (string, error)

ReadCookie extracts the support session token from the request, if present.

func SetCookie

func SetCookie(w http.ResponseWriter, r *http.Request, token string)

SetCookie writes the support session cookie to the response.

Types

type Claims

type Claims struct {
	AdminAccountID  string
	TargetAccountID string
	IssuedAt        int64
}

func ValidateToken

func ValidateToken(signer *jwt.Signer, tokenString string) (*Claims, error)

ValidateToken parses and validates a support session token, returning its claims.

Jump to

Keyboard shortcuts

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