queryparam

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package queryparam provides a query param based implementation of a both as session store and loader.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store implements the load session store interface using http query strings / query parameters.

func NewStore

func NewStore(enc encoding.MarshalUnmarshaler, qp string) *Store

NewStore returns a new query param store for loading sessions from query strings / query parameters.

NOTA BENE: By default, most servers _DO_ log query params, the leaking or accidental logging of which should be considered a security issue.

func (*Store) ClearSession

func (qp *Store) ClearSession(w http.ResponseWriter, r *http.Request)

ClearSession clears the session cookie from a request's query param key `pomerium_session`.

func (*Store) LoadSession

func (qp *Store) LoadSession(r *http.Request) (string, error)

LoadSession tries to retrieve the token string from URL query parameters.

func (*Store) SaveSession

func (qp *Store) SaveSession(w http.ResponseWriter, r *http.Request, x interface{}) error

SaveSession sets a session to a request's query param key `pomerium_session`

Jump to

Keyboard shortcuts

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