stormpathweb

package
v0.0.0-...-0d47c16 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const AccountKey = "account"

AccountKey is the key of the current account in the context and session

View Source
const ApplicationKey = "application"

ApplicationKey is the key of the current application in the context

Variables

This section is empty.

Functions

func GetApplication

func GetApplication(r *http.Request) *stormpath.Application

GetApplication returns the application from the context previouly set by the ApplicationMiddleware

func GetCurrentAccount

func GetCurrentAccount(r *http.Request) *stormpath.Account

GetCurrentAccount retrives the current account if any from the request context

func IsAuthenticated

func IsAuthenticated(r *http.Request) bool

IsAuthenticated checks if there is an authenticated user

Types

type AccountMiddleware

type AccountMiddleware struct {
	SessionStore sessions.Store
	SessionName  string
}

AccountMiddleware is an http.Handler that unmarshals the current account store in the session and stores it in the request context to be use by any other handler in the chain

func (AccountMiddleware) ServeHTTP

func (m AccountMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface for the AccountMiddleware type

type ApplicationMiddleware

type ApplicationMiddleware struct {
	ApplicationHref string
}

ApplicationMiddleware is an http.Handler that stores a given account in the request context to be use by any other handlers in the chain.

func (ApplicationMiddleware) ServeHTTP

ServeHTTP implements the http.Handler interface for the ApplicationMiddleware type

type AuthenticationMiddleware

type AuthenticationMiddleware struct {
	Next                http.Handler
	SessionStore        sessions.Store
	SessionName         string
	UnauthorizedHandler http.Handler
}

AuthenticationMiddleware handles authentication for a web application, it should only be apply to http.Handlers that require authentication it checks the session for current account if exists it calls handler else it applies the UnauthorizedHandler

func (AuthenticationMiddleware) ServeHTTP

ServeHTTP implements the http.Handler interface for the AuthenticationMiddleware type

type IDSiteAuthCallbackHandler

type IDSiteAuthCallbackHandler struct {
	SessionStore      sessions.Store
	SessionName       string
	LoginRedirectURI  string
	LogoutRedirectURI string
	ErrorHandler      http.Handler
}

IDSiteAuthCallbackHandler is an http.Handler for the ID Site callback

func (IDSiteAuthCallbackHandler) ServeHTTP

ServeHTTP implements the http.Handler interface for the IDSiteAuthCallbackHandler type

type IDSiteLoginHandler

type IDSiteLoginHandler struct {
	Options map[string]string
}

IDSiteLoginHandler is an http.Handler for Strompath's IDSite login

func (IDSiteLoginHandler) ServeHTTP

func (h IDSiteLoginHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface for IDSiteLoginHandler type

type IDSiteLogoutHandler

type IDSiteLogoutHandler struct {
	Options map[string]string
}

IDSiteLogoutHandler is an http.Handler for Strompath's IDSite logout

func (IDSiteLogoutHandler) ServeHTTP

func (h IDSiteLogoutHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface for IDSiteLogoutHandler type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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