gin-contrib / authz Goto Github PK
View Code? Open in Web Editor NEWgin-authz is an authorization middleware for Gin
License: MIT License
gin-authz is an authorization middleware for Gin
License: MIT License
Hi, I'm trying to use this with casbin but I'm getting error
cannot use e (variable of type *"github.com/casbin/casbin".Enforcer) as *"github.com/casbin/casbin/v2".Enforcer value in argument to authz.NewAuthorizer
Hi ,
I have installed gin and installed gin-contrib/authz. but how i can run it or test it.
could you provide the full command please ?
Many thanks
Ibrahim
When I added the middleware:
r.Use(authz.NewAuthorizer(enforcer))
I get do get a 403 response but the request is not ended:
[GIN-debug] [WARNING] Headers were already written. Wanted to override status code 403 with 200[GIN] 2018/09/20 - 23:56:55 | 200 | 7.113914ms | ::1 | POST /auth/
I have solved it.
Thanks
Line 17 in 1fb3afa
Most probably you wanted to refer to this?
https://github.com/ugorji/go-codec
I think BasicAuthorizer
should be created outside of the closure. Since the closure is called for every request.
Lines 15 to 17 in 13cec14
I want to install this package with:
"go get github.com/gin-contrib/authz"
but it returns:
# github.com/gin-contrib/authz
authz/authz.go:43:2: too many arguments to return
have (bool, error)
want (bool)
$ go version
go version go1.12.7 linux/amd64
Hi there,
Looks great, though I am not too sure how to implement it, is there a chance you could add a full example how to implement in a gin app?
Thanks in advance,
Julio
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.