iris/middleware
Gerasimos (Makis) Maropoulos b2fddc7d68 jwt: add more helpers (DefaultRSA and DefaultHMAC)
Former-commit-id: fe06c0e0f4d7e121c678ffda7ac702ae865abd00
2020-05-31 17:57:30 +03:00
..
basicauth more route info improvements 2020-04-28 22:34:36 +03:00
grpc add a full gRPC example as previously requested at: https://github.com/kataras/iris/issues/1449 2020-03-07 12:53:23 +02:00
hcaptcha more route info improvements 2020-04-28 22:34:36 +03:00
jwt jwt: add more helpers (DefaultRSA and DefaultHMAC) 2020-05-31 17:57:30 +03:00
logger more route info improvements 2020-04-28 22:34:36 +03:00
methodoverride version 12.1.5 2020-02-02 16:29:06 +02:00
pprof more route info improvements 2020-04-28 22:34:36 +03:00
rate fmt 2020-05-04 08:20:55 +03:00
recaptcha more route info improvements 2020-04-28 22:34:36 +03:00
recover more route info improvements 2020-04-28 22:34:36 +03:00
requestid add a new simple, builtin requestid middleware (makes use of the Context.SetID/GetID methods too) 2020-05-28 16:20:58 +03:00
README.md add a new simple, builtin requestid middleware (makes use of the Context.SetID/GetID methods too) 2020-05-28 16:20:58 +03:00

Builtin Handlers

Middleware Example
basic authentication iris/_examples/authentication/basicauth
request logger iris/_examples/http_request/request-logger
HTTP method override iris/middleware/methodoverride/methodoverride_test.go
profiling (pprof) iris/_examples/miscellaneous/pprof
Google reCAPTCHA iris/_examples/miscellaneous/recaptcha
hCaptcha iris/_examples/miscellaneous/recaptcha
recovery iris/_examples/miscellaneous/recover
rate iris/_examples/miscellaneous/ratelimit
jwt iris/_examples/miscellaneous/jwt
requestid iris/middleware/requestid/requestid_test.go

Community made

Most of the experimental handlers are ported to work with iris's handler form, from third-party sources.

Middleware Description Example
jwt Middleware checks for a JWT on the Authorization header on incoming requests and decodes it iris-contrib/middleware/jwt/_example
cors HTTP Access Control iris-contrib/middleware/cors/_example
secure Middleware that implements a few quick security wins iris-contrib/middleware/secure/_example
tollbooth Generic middleware to rate-limit HTTP requests iris-contrib/middleware/tollboothic/_examples/limit-handler
cloudwatch AWS cloudwatch metrics middleware iris-contrib/middleware/cloudwatch/_example
new relic Official New Relic Go Agent iris-contrib/middleware/newrelic/_example
prometheus Easily create metrics endpoint for the prometheus instrumentation tool iris-contrib/middleware/prometheus/_example
casbin An authorization library that supports access control models like ACL, RBAC, ABAC iris-contrib/middleware/casbin/_examples
raven Sentry client in Go iris-contrib/middleware/raven/_example
csrf Cross-Site Request Forgery Protection iris-contrib/middleware/csrf/_example
go-i18n i18n Iris Loader for nicksnyder/go-i18n iris-contrib/middleware/go-i18n/_example
throttler Rate limiting access to HTTP endpoints iris-contrib/middleware/throttler/_example NEW

Third-Party Handlers

Iris has its own middleware form of func(ctx context.Context) but it's also compatible with all net/http middleware forms. See here.

Here's a small list of useful third-party handlers:

Middleware Description
goth OAuth, OAuth2 authentication. Example
csp Content Security Policy (CSP) support
delay Add delays/latency to endpoints. Useful when testing effects of high latency
onthefly Generate TinySVG, HTML and CSS on the fly
permissions2 Cookies, users and permissions
RestGate Secure authentication for REST API endpoints
stats Store information about your web application (response time, etc.)
VanGoH Configurable AWS-Style HMAC authentication middleware
xrequestid Middleware that assigns a random X-Request-Id header to each request
digits Middleware that handles Twitter Digits authentication

Feel free to put up your own middleware in this list!