{"id":19298217,"url":"https://github.com/casbin/chi-authz","last_synced_at":"2025-09-11T21:38:03.394Z","repository":{"id":195886420,"uuid":"692840286","full_name":"casbin/chi-authz","owner":"casbin","description":"Chi Authorization Middleware based on Casbin","archived":false,"fork":false,"pushed_at":"2024-01-29T15:58:59.000Z","size":10,"stargazers_count":3,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-19T16:41:08.106Z","etag":null,"topics":["abac","acl","auth","authorization","casbin","chi","http","middleware","rbac"],"latest_commit_sha":null,"homepage":"https://github.com/casbin/casbin","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/casbin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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},"funding":{"github":"casbin"}},"created_at":"2023-09-17T18:35:21.000Z","updated_at":"2024-09-09T05:33:21.000Z","dependencies_parsed_at":"2024-03-25T09:21:09.060Z","dependency_job_id":"9de7349d-6fbe-48fa-adca-3f39d6d24820","html_url":"https://github.com/casbin/chi-authz","commit_stats":{"total_commits":10,"total_committers":3,"mean_commits":"3.3333333333333335","dds":"0.19999999999999996","last_synced_commit":"24af74905f10c1e3c73143932963e2da622fd63f"},"previous_names":["casbin/chi-authz"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fchi-authz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fchi-authz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fchi-authz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fchi-authz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casbin","download_url":"https://codeload.github.com/casbin/chi-authz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250137125,"owners_count":21380963,"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","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":["abac","acl","auth","authorization","casbin","chi","http","middleware","rbac"],"created_at":"2024-11-09T23:07:16.701Z","updated_at":"2025-04-22T09:32:12.789Z","avatar_url":"https://github.com/casbin.png","language":"Go","funding_links":["https://github.com/sponsors/casbin"],"categories":[],"sub_categories":[],"readme":"Chi-authz [![Coverage Status](https://coveralls.io/repos/github/casbin/chi-authz/badge.svg?branch=master)](https://coveralls.io/github/casbin/chi-authz?branch=master) [![GoDoc](https://godoc.org/github.com/casbin/chi-authz?status.svg)](https://godoc.org/github.com/casbin/chi-authz)\n======\n\nChi-authz is an authorization middleware for [Chi](https://github.com/go-chi/chi), it's based on [https://github.com/casbin/casbin](https://github.com/casbin/casbin).\n\n## Installation\n\n    go get github.com/casbin/chi-authz\n\n## Simple Example\n\n```Go\npackage main\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/casbin/chi-authz\"\n\t\"github.com/casbin/casbin\"\n\t\"github.com/go-chi/chi\"\n)\n\nfunc main() {\n\trouter := chi.NewRouter()\n\n\t// load the casbin model and policy from files, database is also supported.\n\te := casbin.NewEnforcer(\"authz_model.conf\", \"authz_policy.csv\")\n\trouter.Use(authz.Authorizer(e))\n\n\t// define your handler, this is just an example to return HTTP 200 for any requests.\n\t// the access that is denied by authz will return HTTP 403 error.\n\trouter.HandleFunc(\"/*\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.WriteHeader(200)\n\t})\n}\n```\n\n## Getting Help\n\n- [casbin](https://github.com/casbin/casbin)\n\n## License\n\nThis project is under MIT License. See the [LICENSE](LICENSE) file for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasbin%2Fchi-authz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasbin%2Fchi-authz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasbin%2Fchi-authz/lists"}