Documentation
¶
Index ¶
- Variables
- func BuildClearOidcStateCookieString(secure bool) string
- func BuildClearTokenCookieString() string
- func BuildClearTokenCookieStringFor(secure bool) string
- func BuildOidcStateCookieString(value string, maxAgeInSeconds int, secure bool) string
- func BuildTokenCookieString(maxAgeInSeconds int, token string) string
- func ClearTokenCookie(w http.ResponseWriter, r *http.Request)
- func GetTokenCookie(r *http.Request) (string, error)
Constants ¶
This section is empty.
Variables ¶
var ( TokenCookieName = "__Host-token" // #nosec G101: cookie name label, not a credential InsecureTokenCookieName = "token" // #nosec G101: cookie name label, not a credential OidcStateCookieName = "oidc_state" )
Functions ¶
func BuildClearOidcStateCookieString ¶
BuildClearOidcStateCookieString builds a Set-Cookie header string to clear the OIDC state cookie.
func BuildClearTokenCookieString ¶
func BuildClearTokenCookieString() string
BuildClearTokenCookieString builds a Set-Cookie header string to clear the token cookie.
func BuildClearTokenCookieStringFor ¶ added in v1.19.1
BuildClearTokenCookieStringFor builds a Set-Cookie header string to clear the token cookie variant matching the connection's TLS state — `__Host-token` for TLS, `token` otherwise — mirroring ClearTokenCookie for callers that have no http.ResponseWriter (e.g. Huma middleware).
func BuildOidcStateCookieString ¶
BuildOidcStateCookieString builds a Set-Cookie header string for the OIDC state cookie.
func BuildTokenCookieString ¶
BuildTokenCookieString builds a Set-Cookie header string for Huma handlers. Uses the insecure cookie name since we can't detect TLS from context. For secure contexts, the middleware should handle the __Host- prefix.
func ClearTokenCookie ¶
func ClearTokenCookie(w http.ResponseWriter, r *http.Request)
Types ¶
This section is empty.