state_handler

package
v6.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package osecure/state_handler provides state generator and verifier in OAuth flow.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorCannotGenerateCompleteState = errors.New("cannot generate complete state")
	ErrorCannotRetrieveCookie        = errors.New("cannot retrieve cookie")
	ErrorInvalidState                = errors.New("invalid state")
)

Functions

This section is empty.

Types

type DefaultStateHandler

type DefaultStateHandler struct {
	ContinueURI string
	CookieName  string
}

func (DefaultStateHandler) Generate

func (sh DefaultStateHandler) Generate(cookieStore *sessions.CookieStore, w http.ResponseWriter, r *http.Request) (string, error)

func (DefaultStateHandler) Verify

func (sh DefaultStateHandler) Verify(cookieStore *sessions.CookieStore, w http.ResponseWriter, r *http.Request, state string) (string, error)

type JSONStateHandler

type JSONStateHandler struct {
	ContinueURI string
	CookieName  string
}

func (JSONStateHandler) Generate

func (sh JSONStateHandler) Generate(cookieStore *sessions.CookieStore, w http.ResponseWriter, r *http.Request) (string, error)

func (JSONStateHandler) Verify

func (sh JSONStateHandler) Verify(cookieStore *sessions.CookieStore, w http.ResponseWriter, r *http.Request, state string) (string, error)

type SimpleStateHandler

type SimpleStateHandler struct {
	ContinueURI string
}

func (SimpleStateHandler) Generate

func (sh SimpleStateHandler) Generate(cookieStore *sessions.CookieStore, w http.ResponseWriter, r *http.Request) (string, error)

func (SimpleStateHandler) Verify

func (_ SimpleStateHandler) Verify(cookieStore *sessions.CookieStore, w http.ResponseWriter, r *http.Request, state string) (string, error)

Jump to

Keyboard shortcuts

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