Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FiberInputCreationMethod ¶
FiberInputCreationMethod is the method that is used to create the input for the policy.
type FiberMiddleware ¶
type FiberMiddleware struct { // Config is the configuration for the middleware. Config *config.Config // InputCreationMethod is a function that returns the value to be sent to the OPA server. InputCreationMethod FiberInputCreationMethod `json:"binding_method,omitempty"` }
func NewFiberMiddleware ¶
func NewFiberMiddleware(cfg *config.Config, input FiberInputCreationMethod) (*FiberMiddleware, error)
NewFiberMiddleware is the constructor for the opa fiber middleware.
func (*FiberMiddleware) Use ¶
func (g *FiberMiddleware) Use() func(c *fiber.Ctx) error
Use returns the handler for the middleware that is used by fiber to evaluate the request against the policy.
type GinInputCreationMethod ¶
type GinMiddleware ¶
type GinMiddleware struct { Config *config.Config // InputCreationMethod is a function that returns the value to be sent to the OPA server. InputCreationMethod GinInputCreationMethod `json:"binding_method,omitempty"` }
func NewGinMiddleware ¶
func NewGinMiddleware(cfg *config.Config, input GinInputCreationMethod) (*GinMiddleware, error)
NewGinMiddleware is the constructor for the opa gin middleware.
func (*GinMiddleware) Use ¶
func (g *GinMiddleware) Use() func(c *gin.Context)
Use returns the handler for the middleware that is used by gin to evaluate the request against the policy.
type HTTPMiddleware ¶
type HTTPMiddleware struct { Config *config.Config // Next is the next handler in the request chain. Next http.Handler }
HTTPMiddleware is the middleware for http requests
func NewHTTPMiddleware ¶
NewHTTPMiddleware returns a new HTTPMiddleware
func (*HTTPMiddleware) ServeHTTP ¶
func (h *HTTPMiddleware) ServeHTTP(rw http.ResponseWriter, req *http.Request)
ServeHTTP serves the http request. Act as Use acts in other frameworks.
Click to show internal directories.
Click to hide internal directories.