Documentation ¶
Overview ¶
Package auth provides application-level standardization for authentication
Index ¶
- func HandleHTTP(h HTTPHandlerFunc, ss *session.Store) echo.HandlerFunc
- func HandleHTTPWithSession(h HTTPHandlerFuncWithSession, ss *session.Store) echo.HandlerFunc
- func HandleTS(h TSHandlerFunc, ss *session.Store) turbostreams.HandlerFunc
- func RegisterGobTypes()
- func RequireHTTPAuthz(ss *session.Store) echo.MiddlewareFunc
- func RequireTSAuthz(ss *session.Store) turbostreams.MiddlewareFunc
- func SetCSRFBehavior(s *sessions.Session, inlineToken bool)
- func SetIdentity(s *sessions.Session, username string)
- type Auth
- type CSRF
- type CSRFBehavior
- type HTTPHandlerFunc
- type HTTPHandlerFuncWithSession
- type HTTPRouter
- func (r *HTTPRouter) CONNECT(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (r *HTTPRouter) DELETE(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (r *HTTPRouter) GET(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (r *HTTPRouter) HEAD(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (r *HTTPRouter) OPTIONS(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (r *HTTPRouter) PATCH(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (r *HTTPRouter) POST(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (r *HTTPRouter) PUT(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- func (r *HTTPRouter) TRACE(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
- type Identity
- type TSHandlerFunc
- type TSRouter
- func (r *TSRouter) MSG(topic string, h TSHandlerFunc, m ...turbostreams.MiddlewareFunc) *turbostreams.Route
- func (r *TSRouter) PUB(topic string, h TSHandlerFunc, m ...turbostreams.MiddlewareFunc) *turbostreams.Route
- func (r *TSRouter) SUB(topic string, h TSHandlerFunc, m ...turbostreams.MiddlewareFunc) *turbostreams.Route
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleHTTP ¶ added in v0.5.0
func HandleHTTP(h HTTPHandlerFunc, ss *session.Store) echo.HandlerFunc
func HandleHTTPWithSession ¶ added in v0.5.0
func HandleHTTPWithSession(h HTTPHandlerFuncWithSession, ss *session.Store) echo.HandlerFunc
func HandleTS ¶ added in v0.5.0
func HandleTS(h TSHandlerFunc, ss *session.Store) turbostreams.HandlerFunc
func RegisterGobTypes ¶ added in v0.6.2
func RegisterGobTypes()
func RequireHTTPAuthz ¶ added in v0.5.0
func RequireTSAuthz ¶ added in v0.5.0
func RequireTSAuthz(ss *session.Store) turbostreams.MiddlewareFunc
func SetCSRFBehavior ¶
func SetIdentity ¶
Types ¶
type Auth ¶
func GetFromRequest ¶
func GetWithSession ¶
func GetWithoutRequest ¶ added in v0.5.0
func (Auth) Authorized ¶
func (Auth) RequireHTTPAuthz ¶ added in v0.5.0
func (Auth) RequireTSAuthz ¶ added in v0.5.0
type CSRF ¶
type CSRF struct { Config session.CSRFOptions Behavior CSRFBehavior Token string }
type CSRFBehavior ¶
type CSRFBehavior struct {
InlineToken bool
}
func GetCSRFBehavior ¶
func GetCSRFBehavior(s sessions.Session) (behavior CSRFBehavior, err error)
type HTTPHandlerFunc ¶ added in v0.5.0
type HTTPHandlerFuncWithSession ¶ added in v0.5.0
type HTTPRouter ¶ added in v0.5.0
type HTTPRouter struct {
// contains filtered or unexported fields
}
HTTPRouter is a routing adapter between echo.HandlerFunc and this package's HTTPHandlerFunc, by automatically extracting auth data from the session of the request.
func NewHTTPRouter ¶ added in v0.5.0
func NewHTTPRouter(er godest.EchoRouter, ss *session.Store) HTTPRouter
func (*HTTPRouter) CONNECT ¶ added in v0.5.0
func (r *HTTPRouter) CONNECT(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
func (*HTTPRouter) DELETE ¶ added in v0.5.0
func (r *HTTPRouter) DELETE(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
func (*HTTPRouter) GET ¶ added in v0.5.0
func (r *HTTPRouter) GET(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
func (*HTTPRouter) HEAD ¶ added in v0.5.0
func (r *HTTPRouter) HEAD(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
func (*HTTPRouter) OPTIONS ¶ added in v0.5.0
func (r *HTTPRouter) OPTIONS(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
func (*HTTPRouter) PATCH ¶ added in v0.5.0
func (r *HTTPRouter) PATCH(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
func (*HTTPRouter) POST ¶ added in v0.5.0
func (r *HTTPRouter) POST(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
func (*HTTPRouter) PUT ¶ added in v0.5.0
func (r *HTTPRouter) PUT(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
func (*HTTPRouter) TRACE ¶ added in v0.5.0
func (r *HTTPRouter) TRACE(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
type TSHandlerFunc ¶ added in v0.5.0
type TSHandlerFunc func(c *turbostreams.Context, a Auth) error
type TSRouter ¶ added in v0.5.0
type TSRouter struct {
// contains filtered or unexported fields
}
TSRouter is a routing adapter between turbostreams.HandlerFunc and this package's TSHandlerFunc, by automatically extracting auth data from the session associated with the Action Cable connection underlying the Turbo Stream.
func NewTSRouter ¶ added in v0.5.0
func NewTSRouter(tsr turbostreams.Router, ss *session.Store) TSRouter
func (*TSRouter) MSG ¶ added in v0.5.0
func (r *TSRouter) MSG( topic string, h TSHandlerFunc, m ...turbostreams.MiddlewareFunc, ) *turbostreams.Route
func (*TSRouter) PUB ¶ added in v0.5.0
func (r *TSRouter) PUB( topic string, h TSHandlerFunc, m ...turbostreams.MiddlewareFunc, ) *turbostreams.Route
func (*TSRouter) SUB ¶ added in v0.5.0
func (r *TSRouter) SUB( topic string, h TSHandlerFunc, m ...turbostreams.MiddlewareFunc, ) *turbostreams.Route
Click to show internal directories.
Click to hide internal directories.