open-policy-agent

command module
v0.0.0-...-d083d20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 9 Imported by: 0

README

OPA

Get Started

Run OPA server
$ opa run -s policy.rego data.json
Run API server
$ go run main.go
Call API
GET /articles
$ curl -i -XGET localhost:3000/articles
HTTP/1.1 200 OK
Date: Sun, 12 Sep 2021 22:26:47 GMT
Content-Length: 7
Content-Type: text/plain; charset=utf-8

listed
GET /articles/foo
$ curl -i -XGET localhost:3000/articles/foo
HTTP/1.1 200 OK
Date: Mon, 13 Sep 2021 02:31:12 GMT
Content-Length: 8
Content-Type: text/plain; charset=utf-8

got foo
DELETE /articles/foo
$ curl -i -XDELETE localhost:3000/articles/hoge
HTTP/1.1 403 Forbidden
Date: Mon, 13 Sep 2021 02:31:32 GMT
Content-Length: 0

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL