Awesome Open Source
Awesome Open Source

Chi-authz Build Status Coverage Status GoDoc

Chi-authz is an authorization middleware for Chi, it's based on


go get

Simple Example

package main

import (


func main() {
	router := chi.NewRouter()

	// load the casbin model and policy from files, database is also supported.
	e := casbin.NewEnforcer("authz_model.conf", "authz_policy.csv")

	// define your handler, this is just an example to return HTTP 200 for any requests.
	// the access that is denied by authz will return HTTP 403 error.
	router.HandleFunc("/*", func(w http.ResponseWriter, r *http.Request) {

Getting Help


This project is under MIT License. See the LICENSE file for the full license text.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
go (14,962
authorization (214
rbac (97
acl (77
access-control (65
casbin (41
abac (22