graphql-authz is an authorization middleware for graphql-go

Clone this repo:
  1. f737d70 Improve README badges. by Yang Luo · 4 years, 9 months ago master
  2. eb1abed Merge pull request #1 from closetool/master by Yang Luo · 4 years, 9 months ago v1.0.0
  3. 51cffa0 feat: add main logic of authz by closetool · 4 years, 9 months ago
  4. d014ed8 Initial commit by Yang Luo · 4 years, 10 months ago

graphql-authz

Coverage Status Go Release Go Report Card

graphql-authz is a casbin binding of graphql, something like restful api. There're actions, like enforce, getPolicies, addPolicy, removePolicy, updatePolicy.

Install

go get -u github.com/casbin/graphql-authz

Usage

Enforce Example:

e, _ := casbin.NewEnforcer("./examples/model.conf", "./examples/policy.csv")
schema := authz.InitType(e)
result := authz.Execute(`{enforce(sub:"alice" obj:"data1" act:"read"){sub obj act ok}}`, schema)

More info, please refer to graphql and basic usage