header

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package header provides a request header based implementation of a session loader.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TokenFromHeaders added in v0.16.0

func TokenFromHeaders(r *http.Request) string

TokenFromHeaders retrieves the value of the authorization header(s) from a given request and authentication type.

Types

type Store

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

Store implements the load session store interface using http authorization headers.

func NewStore

func NewStore(enc encoding.Unmarshaler) *Store

NewStore returns a new header store for loading sessions from authorization header as defined in as defined in rfc2617

NOTA BENE: While most servers do not log Authorization headers by default, you should ensure no other services are logging or leaking your auth headers.

func (*Store) LoadSession

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

LoadSession tries to retrieve the token string from the Authorization header.

Jump to

Keyboard shortcuts

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