cookie

package
v0.0.0-...-7ff5ae3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterCookies

func FilterCookies(req *http.Request, filter []string) error

filterCookies is responsible for censoring any cookies we don't want sent

func FindCookie

func FindCookie(name string, cookies []*http.Cookie) *http.Cookie

findCookie looks for a cookie in a list of cookies

Types

type Manager

type Manager struct {
	CookieDomain         string
	BaseURI              string
	SameSiteCookie       string
	CookieAccessName     string
	CookieRefreshName    string
	CookieIDTokenName    string
	CookiePKCEName       string
	CookieUMAName        string
	CookieRequestURIName string
	CookieOAuthStateName string
	HTTPOnlyCookie       bool
	SecureCookie         bool
	EnableSessionCookies bool
	NoProxy              bool
	NoRedirects          bool
}

func (*Manager) ClearAccessTokenCookie

func (cm *Manager) ClearAccessTokenCookie(req *http.Request, wrt http.ResponseWriter)

ClearAccessTokenCookie clears the session cookie

func (*Manager) ClearAllCookies

func (cm *Manager) ClearAllCookies(req *http.Request, w http.ResponseWriter)

ClearAllCookies is just a helper function for the below

func (*Manager) ClearCookie

func (cm *Manager) ClearCookie(req *http.Request, wrt http.ResponseWriter, name string)

func (*Manager) ClearIDTokenCookie

func (cm *Manager) ClearIDTokenCookie(req *http.Request, wrt http.ResponseWriter)

ClearIDTokenCookie clears the session cookie

func (*Manager) ClearPKCECookie

func (cm *Manager) ClearPKCECookie(req *http.Request, wrt http.ResponseWriter)

ClearPKCECookie clears the session cookie

func (*Manager) ClearRefreshTokenCookie

func (cm *Manager) ClearRefreshTokenCookie(req *http.Request, wrt http.ResponseWriter)

clearRefreshSessionCookie clears the session cookie

func (*Manager) ClearStateParameterCookie

func (cm *Manager) ClearStateParameterCookie(req *http.Request, wrt http.ResponseWriter)

ClearStateParameterCookie clears the session cookie

func (*Manager) ClearUMATokenCookie

func (cm *Manager) ClearUMATokenCookie(req *http.Request, wrt http.ResponseWriter)

ClearUMATokenCookie clears the session cookie

func (*Manager) DropAccessTokenCookie

func (cm *Manager) DropAccessTokenCookie(req *http.Request, w http.ResponseWriter, value string, duration time.Duration)

dropAccessTokenCookie drops a access token cookie

func (*Manager) DropCookie

func (cm *Manager) DropCookie(
	wrt http.ResponseWriter,
	name,
	value string,
	duration time.Duration,
)

DropCookie drops a cookie into the response

func (*Manager) DropIDTokenCookie

func (cm *Manager) DropIDTokenCookie(req *http.Request, w http.ResponseWriter, value string, duration time.Duration)

dropIdTokenCookie drops a id token cookie

func (*Manager) DropPKCECookie

func (cm *Manager) DropPKCECookie(wrt http.ResponseWriter, codeVerifier string)

DropPKCECookie sets a code verifier cookie into the response

func (*Manager) DropRefreshTokenCookie

func (cm *Manager) DropRefreshTokenCookie(req *http.Request, w http.ResponseWriter, value string, duration time.Duration)

DropRefreshTokenCookie drops a refresh token cookie

func (*Manager) DropStateParameterCookie

func (cm *Manager) DropStateParameterCookie(req *http.Request, wrt http.ResponseWriter) string

DropStateParameterCookie sets a state parameter cookie into the response

func (*Manager) DropUMATokenCookie

func (cm *Manager) DropUMATokenCookie(req *http.Request, w http.ResponseWriter, value string, duration time.Duration)

dropUMATokenCookie drops a uma token cookie

func (*Manager) GetMaxCookieChunkLength

func (cm *Manager) GetMaxCookieChunkLength(
	req *http.Request,
	cookieName string,
) int

maxCookieChunkSize calculates max cookie chunk size, which can be used for cookie value this seems to be not useful as many browsers have limits of all cookies per domain = 4096 bytes

Jump to

Keyboard shortcuts

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