middlewares

package
v0.21.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2022 License: AGPL-3.0 Imports: 27 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockLockedTenants added in v0.18.0

func BlockLockedTenants() web.MiddlewareFunc

BlockLockedTenants blocks requests on locked tenants as they are in read-only mode

func BlockPendingTenants added in v0.17.0

func BlockPendingTenants() web.MiddlewareFunc

BlockPendingTenants blocks requests for pending tenants

func CORS added in v0.14.0

func CORS() web.MiddlewareFunc

CORS adds Cross-Origin Resource Sharing response headers

func CatchPanic added in v0.18.1

func CatchPanic() web.MiddlewareFunc

func Chain added in v0.19.0

func Chain(mws ...web.MiddlewareFunc) web.MiddlewareFunc

Chain combines multiple middlewares into one

func CheckTenantPrivacy added in v0.12.0

func CheckTenantPrivacy() web.MiddlewareFunc

CheckTenantPrivacy blocks requests of unauthenticated users for private tenants

func ClientCache added in v0.9.0

func ClientCache(d time.Duration) web.MiddlewareFunc

ClientCache adds Cache-Control header for X seconds

func Compress added in v0.7.0

func Compress() web.MiddlewareFunc

Compress returns a middleware which compresses HTTP response using gzip compression

func Instrumentation added in v0.19.0

func Instrumentation() web.MiddlewareFunc

Instrumentation adds Prometheus HTTP Middlewares

func IsAuthenticated

func IsAuthenticated() web.MiddlewareFunc

IsAuthenticated blocks non-authenticated requests

func IsAuthorized

func IsAuthorized(roles ...enum.Role) web.MiddlewareFunc

IsAuthorized blocks non-authorized requests

func Maintenance added in v0.18.0

func Maintenance() web.MiddlewareFunc

Maintenance returns a maintenance page when system is under maintenance

func MultiTenant

func MultiTenant() web.MiddlewareFunc

MultiTenant extract tenant information from hostname and inject it into current context

func RequireTenant added in v0.15.0

func RequireTenant() web.MiddlewareFunc

RequireTenant returns 404 if tenant is not available

func Secure added in v0.12.0

func Secure() web.MiddlewareFunc

Secure middleware is responsible for 1. Setting the HTTP Security Headers 2. Protecting from Host attacks

func Session added in v0.17.0

func Session() web.MiddlewareFunc

Session starts a new Session if an Session ID is not yet set

func SetLocale added in v0.19.0

func SetLocale(locale string) web.MiddlewareFunc

SetLocale defines given locale in context for all subsequent operations

func SingleTenant

func SingleTenant() web.MiddlewareFunc

SingleTenant inject default tenant into current context

func Tenant

func Tenant() web.MiddlewareFunc

Tenant adds either SingleTenant or MultiTenant to the pipeline

func User added in v0.15.0

func User() web.MiddlewareFunc

User gets JWT Auth token from cookie and insert into context

func WebSetup added in v0.10.0

func WebSetup() web.MiddlewareFunc

WebSetup current context with some services

func WorkerSetup added in v0.10.0

func WorkerSetup() worker.MiddlewareFunc

WorkerSetup current context with some services

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL