Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 677 Bytes

README.md

File metadata and controls

26 lines (18 loc) · 677 Bytes

Go RBAC Examples

This repository contains a number of Go applications, each demonstrates a different approach to implementing Resource-Based Authorization (RBAC) for a simple HTTP API.

Running the Examples

To run an example, cd to its directory and run go run ..

For example, to run the casbin example:

$ cd casbin
$ go run .
Staring server on 0.0.0.0:8080

You can now send requests using curl. For example:

$ curl -X POST -f -u [email protected]:x http://localhost:8080/api/megaSeeds
curl: (22) The requested URL returned error: 403

$ curl -X GET -f -u [email protected]:x http://localhost:8080/api/megaSeeds
"Got permission"