header

package
v0.15.7 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 4 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 TokenFromHeader

func TokenFromHeader(r *http.Request, authHeader, authType string) string

TokenFromHeader retrieves the value of the authorization header from a given request, header key, 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, headerType string) *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