Documentation
¶
Overview ¶
Package client implements a client for the turtleauth protocol
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthorizedHandler ¶
func AuthorizedHandler(perm *AuthServer, handler http.Handler, permission turtleauth.PermissionClass, errorHandler http.Handler) http.Handler
AuthorizedHandler creates an http.Handler that checks for a permission before granting access
Types ¶
type AuthServer ¶
type AuthServer struct {
// contains filtered or unexported fields
}
AuthServer is an authentication server
func NewAuthServer ¶
func NewAuthServer(addr *url.URL) *AuthServer
NewAuthServer returns an AuthServer at the specified address
func (*AuthServer) AuthReq ¶
func (a *AuthServer) AuthReq(p turtleauth.PermissionClass, r *http.Request) bool
AuthReq checks authorization of a request
func (*AuthServer) AuthUser ¶
func (a *AuthServer) AuthUser(p turtleauth.PermissionClass, c http.Cookie) (bool, error)
AuthUser checks user authorization
Click to show internal directories.
Click to hide internal directories.