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 HandleTSWithSession(h TSHandlerFuncWithSession, ss *session.Store) turbostreams.HandlerFunc
- func RegisterGobTypes()
- func RegoModules() []opa.Module
- func SetCSRFBehavior(s *sessions.Session, inlineToken bool)
- func SetIdentity(s *sessions.Session, id ory.IdentityID)
- type Auth
- type AuthzChecker
- func (azc *AuthzChecker) Allow(ctx context.Context, a Auth, resourcePath, operationMethod string, ...) (bool, error)
- func (azc *AuthzChecker) NewHTTPMiddleware(ss *session.Store) echo.MiddlewareFunc
- func (azc *AuthzChecker) NewTSMiddleware(ss *session.Store) turbostreams.MiddlewareFunc
- func (azc *AuthzChecker) RequireAuthz(ctx context.Context, input map[string]interface{}) (authzErr error, evalErr error)
- func (azc *AuthzChecker) RequireHTTPAuthz(c echo.Context, a Auth) (authzErr error, evalErr error)
- func (azc *AuthzChecker) RequireTSAuthz(c *turbostreams.Context, a Auth) (authzErr error, evalErr error)
- 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 TSHandlerFuncWithSession
- 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.1.4
func HandleHTTP(h HTTPHandlerFunc, ss *session.Store) echo.HandlerFunc
func HandleHTTPWithSession ¶ added in v0.1.4
func HandleHTTPWithSession(h HTTPHandlerFuncWithSession, ss *session.Store) echo.HandlerFunc
func HandleTS ¶ added in v0.1.4
func HandleTS(h TSHandlerFunc, ss *session.Store) turbostreams.HandlerFunc
func HandleTSWithSession ¶ added in v0.1.5
func HandleTSWithSession(h TSHandlerFuncWithSession, ss *session.Store) turbostreams.HandlerFunc
func RegisterGobTypes ¶ added in v0.2.1
func RegisterGobTypes()
func RegoModules ¶ added in v0.1.15
func SetCSRFBehavior ¶
func SetIdentity ¶
func SetIdentity(s *sessions.Session, id ory.IdentityID)
Types ¶
type Auth ¶
func GetFromRequest ¶
type AuthzChecker ¶ added in v0.1.15
type AuthzChecker struct {
// contains filtered or unexported fields
}
func NewAuthzChecker ¶ added in v0.1.15
func NewAuthzChecker(db *database.DB, opc *opa.Client) *AuthzChecker
func (*AuthzChecker) NewHTTPMiddleware ¶ added in v0.1.15
func (azc *AuthzChecker) NewHTTPMiddleware(ss *session.Store) echo.MiddlewareFunc
func (*AuthzChecker) NewTSMiddleware ¶ added in v0.1.15
func (azc *AuthzChecker) NewTSMiddleware(ss *session.Store) turbostreams.MiddlewareFunc
func (*AuthzChecker) RequireAuthz ¶ added in v0.1.15
func (*AuthzChecker) RequireHTTPAuthz ¶ added in v0.1.15
func (azc *AuthzChecker) RequireHTTPAuthz(c echo.Context, a Auth) (authzErr error, evalErr error)
func (*AuthzChecker) RequireTSAuthz ¶ added in v0.1.15
func (azc *AuthzChecker) RequireTSAuthz( c *turbostreams.Context, a Auth, ) (authzErr error, evalErr error)
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.1.4
type HTTPHandlerFuncWithSession ¶ added in v0.1.4
type HTTPRouter ¶ added in v0.1.4
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.1.4
func NewHTTPRouter(er godest.EchoRouter, ss *session.Store) HTTPRouter
func (*HTTPRouter) CONNECT ¶ added in v0.1.4
func (r *HTTPRouter) CONNECT(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
func (*HTTPRouter) DELETE ¶ added in v0.1.4
func (r *HTTPRouter) DELETE(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
func (*HTTPRouter) GET ¶ added in v0.1.4
func (r *HTTPRouter) GET(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
func (*HTTPRouter) HEAD ¶ added in v0.1.4
func (r *HTTPRouter) HEAD(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
func (*HTTPRouter) OPTIONS ¶ added in v0.1.4
func (r *HTTPRouter) OPTIONS(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
func (*HTTPRouter) PATCH ¶ added in v0.1.4
func (r *HTTPRouter) PATCH(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
func (*HTTPRouter) POST ¶ added in v0.1.4
func (r *HTTPRouter) POST(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
func (*HTTPRouter) PUT ¶ added in v0.1.4
func (r *HTTPRouter) PUT(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
func (*HTTPRouter) TRACE ¶ added in v0.1.4
func (r *HTTPRouter) TRACE(path string, h HTTPHandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
type Identity ¶
type Identity struct { Authenticated bool User ory.IdentityID }
func (Identity) NewSubject ¶ added in v0.1.15
type TSHandlerFunc ¶ added in v0.1.4
type TSHandlerFunc func(c *turbostreams.Context, a Auth) error
type TSHandlerFuncWithSession ¶ added in v0.1.5
type TSRouter ¶ added in v0.1.4
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.1.4
func NewTSRouter(tsr turbostreams.Router, ss *session.Store) TSRouter
func (*TSRouter) MSG ¶ added in v0.1.4
func (r *TSRouter) MSG( topic string, h TSHandlerFunc, m ...turbostreams.MiddlewareFunc, ) *turbostreams.Route
func (*TSRouter) PUB ¶ added in v0.1.4
func (r *TSRouter) PUB( topic string, h TSHandlerFunc, m ...turbostreams.MiddlewareFunc, ) *turbostreams.Route
func (*TSRouter) SUB ¶ added in v0.1.4
func (r *TSRouter) SUB( topic string, h TSHandlerFunc, m ...turbostreams.MiddlewareFunc, ) *turbostreams.Route
Click to show internal directories.
Click to hide internal directories.