{"id":31787263,"url":"https://github.com/iris-contrib/middleware","last_synced_at":"2025-10-10T13:57:45.559Z","repository":{"id":38751839,"uuid":"61786881","full_name":"iris-contrib/middleware","owner":"iris-contrib","description":"Community Middleware List for the Iris Web Framework.","archived":false,"fork":false,"pushed_at":"2025-02-07T23:45:15.000Z","size":1071,"stargazers_count":239,"open_issues_count":32,"forks_count":91,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-09-14T15:28:55.290Z","etag":null,"topics":["community-driven","go","golang","handler","iris","iris-golang","middleware"],"latest_commit_sha":null,"homepage":"https://github.com/kataras/iris","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iris-contrib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-23T08:06:47.000Z","updated_at":"2025-09-11T17:48:00.000Z","dependencies_parsed_at":"2022-08-09T05:31:28.036Z","dependency_job_id":"997ceb17-d0c8-42d1-9f08-410805156e7c","html_url":"https://github.com/iris-contrib/middleware","commit_stats":{"total_commits":249,"total_committers":26,"mean_commits":9.576923076923077,"dds":0.4417670682730924,"last_synced_commit":"34f27409ce72aa8360fe9498f053918c537665d0"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/iris-contrib/middleware","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iris-contrib%2Fmiddleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iris-contrib%2Fmiddleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iris-contrib%2Fmiddleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iris-contrib%2Fmiddleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iris-contrib","download_url":"https://codeload.github.com/iris-contrib/middleware/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iris-contrib%2Fmiddleware/sbom","scorecard":{"id":494363,"data":{"date":"2025-08-11","repo":{"name":"github.com/iris-contrib/middleware","commit":"372f6828ef8ca7eb97f33cb29eb4c36aeacd36f3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/23 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: GO-2022-0635","Warn: Project is vulnerable to: GO-2022-0646","Warn: Project is vulnerable to: GO-2025-3553 / GHSA-mh63-6h87-95cp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T20:04:34.985Z","repository_id":38751839,"created_at":"2025-08-19T20:04:34.985Z","updated_at":"2025-08-19T20:04:34.985Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004067,"owners_count":26083668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["community-driven","go","golang","handler","iris","iris-golang","middleware"],"created_at":"2025-10-10T13:57:44.567Z","updated_at":"2025-10-10T13:57:45.540Z","avatar_url":"https://github.com/iris-contrib.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Iris Community Middleware List\r\n\r\n\u003c!-- [![Build status](https://api.travis-ci.org/iris-contrib/middleware.svg?branch=master\u0026style=flat-square)](https://travis-ci.org/iris-contrib/middleware) --\u003e\r\n\r\nThis repository provides a way to share community-based middlewares for [Iris Web Framework](https://github.com/kataras/iris). Among with those, you can also navigate through the [builtin Iris handlers](https://github.com/kataras/iris/tree/main/middleware).\r\n\r\n## Installation\r\n\r\nInstall a middleware, take for example the [jwt](jwt) one.\r\n\r\n```sh\r\n$ go env -w GOPROXY=goproxy.cn,gocenter.io,goproxy.io,direct\r\n$ go mod init myapp\r\n$ go get github.com/kataras/iris/v12@main\r\n$ go get github.com/iris-contrib/middleware/jwt@master\r\n```\r\n\r\n**import as**\r\n\r\n```go\r\nimport \"github.com/iris-contrib/middleware/jwt\"\r\n\r\n// [...Code]\r\n```\r\n\r\n**build**\r\n```sh\r\n$ go build\r\n```\r\n\r\nMiddleware is just a chain handlers which can be executed before or after the main handler, can transfer data between handlers and communicate with third-party libraries, they are just functions.\r\n\r\n\u003c!-- https://github.com/kataras/iris/blob/main/_examples/permissions/main.go --\u003e\r\n\r\n| Middleware      | Description | Example     |\r\n| ----------------|-------------|-------------|\r\n| [pg](pg) | PostgreSQL Database | [pg/_examples](pg/_examples/) |\r\n| [jwt](jwt) | JSON Web Tokens | [jwt/_example](jwt/_example/) |\r\n| [cors](cors) | HTTP Access Control. | [cors/_example](cors/_example) |\r\n| [secure](secure) | Middleware that implements a few quick security wins | [secure/_example](secure/_example/main.go) |\r\n| [tollbooth](tollboothic) | Generic middleware to rate-limit HTTP requests | [tollboothic/_examples/limit-handler](tollboothic/_examples/limit-handler) |\r\n| [cloudwatch](cloudwatch) |  AWS cloudwatch metrics middleware |[cloudwatch/_example](cloudwatch/_example) |\r\n| [newrelic/v3](newrelic) | Official [New Relic Go Agent](https://github.com/newrelic/go-agent/tree/master/v3) | [newrelic/_example](newrelic/_example) |\r\n| [prometheus](prometheus)| Easily create metrics endpoint for the [prometheus](http://prometheus.io) instrumentation tool | [prometheus/_example](prometheus/_example) |\r\n| [casbin](casbin)| An authorization library that supports access control models like ACL, RBAC, ABAC | [casbin/_examples](casbin/_examples) |\r\n| [sentry-go (ex. raven)](https://github.com/getsentry/sentry-go/tree/master/iris)| Sentry client in Go | [sentry-go/example/iris](https://github.com/getsentry/sentry-go/blob/master/example/iris/main.go) | \u003c!-- raven was deprecated by its company, the successor is sentry-go, they contain an Iris middleware. --\u003e\r\n| [csrf](csrf)| Cross-Site Request Forgery Protection | [csrf/_example](csrf/_example/main.go) |\r\n| [throttler](throttler)| Rate limiting access to HTTP endpoints | [throttler/_example](throttler/_example/main.go) |\r\n| [expmetric](expmetric)| Expvar for counting requests etc. | [expmetric/_example](expmetric/_example/main.go) |\r\n| [zap](zap)| Provides log handling using zap package | [zap/_examples](zap/_examples/example_1/main.go) |\r\n\r\n### Register a middleware\r\n\r\n**To a single route**\r\n\r\n```go\r\napp := iris.New()\r\napp.Get(\"/mypath\",\r\n  onBegin,\r\n  mySecondMiddleware,\r\n  mainHandler,\r\n)\r\n\r\nfunc onBegin(ctx iris.Context) { /* ... */ ctx.Next() }\r\nfunc mySecondMiddleware(ctx iris.Context) { /* ... */ ctx.Next() }\r\nfunc mainHandler(ctx iris.Context) { /* ... */ }\r\n```\r\n\r\n**To a party of routes or subdomain**\r\n\r\n```go\r\n\r\np := app.Party(\"/sellers\", authMiddleware, logMiddleware)\r\n\r\n```\r\n\r\nOR\r\n\r\n```go\r\np := app.Party(\"/customers\")\r\np.Use(logMiddleware)\r\n```\r\n\r\n**To all routes**\r\n\r\n```go\r\napp.Use(func(ctx iris.Context) { }, myMiddleware2)\r\n```\r\n\r\n**To global, all registered routes (including the http errors)**\r\n\r\n```go\r\napp.UseGlobal(func(ctx iris.Context) { }, myMiddleware2)\r\n```\r\n\r\n**To Party and its children, even on unmatched routes and errors**\r\n\r\n```go\r\napp.UseRouter(func(ctx iris.Context) { }, myMiddleware2))\r\n```\r\n\r\n## Can I use standard net/http handler with iris?\r\n\r\n**Yes** you can, just pass the Handler inside the `iris.FromStd` in order to be converted into iris.Handler and register it as you saw before.\r\n\r\n### Convert handler which has the form of `http.Handler/HandlerFunc`\r\n\r\n```go\r\npackage main\r\n\r\nimport (\r\n    \"github.com/kataras/iris/v12\"\r\n)\r\n\r\nfunc main() {\r\n    app := iris.New()\r\n\r\n    sillyHTTPHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request){\r\n            println(r.RequestURI)\r\n    })\r\n\r\n    sillyConvertedToIon := iris.FromStd(sillyHTTPHandler)\r\n    // FromStd can take (http.ResponseWriter, *http.Request, next http.Handler) too!\r\n    app.Use(sillyConvertedToIon)\r\n\r\n    app.Listen(\":8080\")\r\n}\r\n\r\n```\r\n\r\n## Contributing\r\n\r\nIf you are interested in contributing to this project, please push a PR.\r\n\r\n## People\r\n\r\n[List of all contributors](https://github.com/iris-contrib/middleware/graphs/contributors)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firis-contrib%2Fmiddleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firis-contrib%2Fmiddleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firis-contrib%2Fmiddleware/lists"}