gin-contrib / Authz
Licence: mit
gin-authz is an authorization middleware for Gin
Stars: ✭ 508
Programming Languages
go
31211 projects - #10 most used programming language
Projects that are alternatives of or similar to Authz
Gin Web
由gin + gorm + jwt + casbin组合实现的RBAC权限管理脚手架Golang版, 搭建完成即可快速、高效投入业务开发
Stars: ✭ 107 (-78.94%)
Mutual labels: gin, casbin
ginadmin
基于Gin开发的后台管理系统,集成了、数据库操作、日志管理、权限分配管理、多模板页面、自动分页器、数据库迁移和填充、Docker集成部署等功能、静态资源打包
Stars: ✭ 149 (-70.67%)
Mutual labels: gin, casbin
Go Admin
基于Gin + Vue + Element UI的前后端分离权限管理系统脚手架(包含了:多租户的支持,基础用户管理功能,jwt鉴权,代码生成器,RBAC资源控制,表单构建,定时任务等)3分钟构建自己的中后台项目;文档:https://doc.go-admin.dev Demo: https://www.go-admin.dev Antd beta版本:https://preview.go-admin.dev
Stars: ✭ 5,439 (+970.67%)
Mutual labels: gin, casbin
golang-gin-restfulAPI-example-app
An example Golang Restful API with [Gin, MongoDB, gin-jwt, gin-sessions, gin-authz, gin-swagger, validate.v9, casbin, go-ini]
Stars: ✭ 104 (-79.53%)
Mutual labels: gin, casbin
Ginpprof
A wrapper for golang web framework gin to use net/http/pprof easily.
Stars: ✭ 278 (-45.28%)
Mutual labels: gin
Go Project Sample
Introduce the best practice experience of Go project with a complete project example.通过一个完整的项目示例介绍Go语言项目的最佳实践经验.
Stars: ✭ 344 (-32.28%)
Mutual labels: gin
Ironinfoweapp
铜陵回归物资有限公司支持, 钢材信息小程序(基于uni-app), 后台账密: tour, tour520
Stars: ✭ 257 (-49.41%)
Mutual labels: casbin
Go Simple Api Gateway
[deprecated] simple api gateway written by golang
Stars: ✭ 290 (-42.91%)
Mutual labels: casbin
Casbin Forum
Next-generation forum software based on React + Golang, QQ group: 555019739
Stars: ✭ 348 (-31.5%)
Mutual labels: casbin
Casbin Rs
An authorization library that supports access control models like ACL, RBAC, ABAC in Rust.
Stars: ✭ 375 (-26.18%)
Mutual labels: casbin
fiber-boilerplate
This is the go boilerplate on the top of fiber web framework. With simple setup you can use many features out of the box
Stars: ✭ 184 (-63.78%)
Mutual labels: casbin
Go Gin Boilerplate
A starter project with Golang, Gin and DynamoDB
Stars: ✭ 330 (-35.04%)
Mutual labels: gin
Authz
Authz is an authorization middleware for Gin, it's based on https://github.com/casbin/casbin.
Installation
go get github.com/gin-contrib/authz
Simple Example
package main
import (
"net/http"
"github.com/casbin/casbin"
"github.com/gin-contrib/authz"
"github.com/gin-gonic/gin"
)
func main() {
// load the casbin model and policy from files, database is also supported.
e := casbin.NewEnforcer("authz_model.conf", "authz_policy.csv")
// define your router, and use the Casbin authz middleware.
// the access that is denied by authz will return HTTP 403 error.
router := gin.New()
router.Use(authz.NewAuthorizer(e))
}
Documentation
The authorization determines a request based on {subject, object, action}
, which means what subject
can perform what action
on what object
. In this plugin, the meanings are:
-
subject
: the logged-on user name -
object
: the URL path for the web resource like "dataset1/item1" -
action
: HTTP method like GET, POST, PUT, DELETE, or the high-level actions you defined like "read-file", "write-blog"
For how to write authorization policy and other details, please refer to the Casbin's documentation.
Getting Help
License
This project is under MIT License. See the LICENSE file for the full license text.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].