Documentation ¶
Index ¶
- Constants
- func Authenticate(next http.Handler) http.Handler
- func Authorize(next http.Handler) http.Handler
- func DemoteSession(w http.ResponseWriter, r *http.Request) error
- func ETag(h http.Handler) http.Handler
- func FindOrCreateAuthenticatedUser(w http.ResponseWriter, r *http.Request) (*repository.User, error)
- func IsAdmin(w http.ResponseWriter, r *http.Request) (bool, error)
- func PromoteSession(w http.ResponseWriter, r *http.Request) error
- func PublishedAppOnly(appIDParam string) func(http.Handler) http.Handler
- func UnexpectedRedirect(host string, useTLS bool) func(http.Handler) http.Handler
Constants ¶
const ( SessionKeyUserID = "uid" SessionKeyAdmin = "admin" )
Variables ¶
This section is empty.
Functions ¶
func Authenticate ¶
Authenticate checks that a user is associated with the request session. If no user can be found, a new one will be created
func DemoteSession ¶
func DemoteSession(w http.ResponseWriter, r *http.Request) error
DemoteSession demotes the current request session to base user authorization level
func FindOrCreateAuthenticatedUser ¶
func FindOrCreateAuthenticatedUser(w http.ResponseWriter, r *http.Request) (*repository.User, error)
FindOrCreateAuthenticatedUser retrieves the user associated with the request session. If no user can be found, a new one will be created and returned
func IsAdmin ¶
IsAdmin checks if the session associated with the given request has the admin authorization level
func PromoteSession ¶
func PromoteSession(w http.ResponseWriter, r *http.Request) error
PromoteSession promotes the current request session to the admin authorization level
func PublishedAppOnly ¶
PublishedAppOnly intercepts apps requests and returns a 404 HTTP error if the app is not published AND the user is not an admin.
Types ¶
This section is empty.