cookiejar

package
v0.2.56 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRequestOriginAllowed

func IsRequestOriginAllowed(reqURL string, originKey string) bool

IsRequestOriginAllowed checks if the request URL belongs to the same origin key. The caller can use this to ensure a client with a shared jar is used for the right origin.

func OriginKeyFromAuthority

func OriginKeyFromAuthority(a authority.AuthAuthority) string

OriginKeyFromAuthority derives a normalized origin key from the authority.

Types

type Manager

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

Manager provides shared cookie jars keyed by authorization authority. Each authority gets its own net/http CookieJar to avoid cross-authority leakage.

func NewManager

func NewManager() *Manager

NewManager creates a Manager with an empty set of jars.

func (*Manager) Clear

func (m *Manager) Clear(key string)

Clear removes and zeroes a jar for the given authority origin key. Useful on logout to discard cookies.

func (*Manager) Get

Get returns a shared CookieJar for the provided authority. It lazily creates a new jar per unique origin key.

Jump to

Keyboard shortcuts

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