cerbos / demo-rest Goto Github PK
View Code? Open in Web Editor NEWDemo of using Cerbos to secure a Go REST API.
Home Page: https://cerbos.dev
License: Apache License 2.0
Demo of using Cerbos to secure a Go REST API.
Home Page: https://cerbos.dev
License: Apache License 2.0
While running the demo in macOS with zsh (default shell) version 5.8
You get this error
vestival@Victors-MacBook-Pro ~ % curl -i -u adam:adamsStrongPassword -XPUT http://localhost:9999/store/order -d {"items": {"eggs": 12, "milk": 1}}
zsh: parse error near `}'
However, if you run the same command with bash I get:
bash-3.2$ curl -i -u adam:adamsStrongPassword -XPUT http://localhost:9999/store/order -d {"items": {"eggs": 12}}
HTTP/1.1 400 Bad Request
Content-Type: application/json
Date: Wed, 04 Aug 2021 20:13:21 GMT
Content-Length: 31
{
"message": "Bad request"
}
curl: (3) unmatched brace in URL position 1:
{eggs:
^
curl: (3) unmatched close brace/bracket in URL position 3:
12}}
^
When I run test.sh I get
vestival@Victors-MacBook-Pro demo-rest % ./test.sh
=== Adam tries to create an order with a single item
curl -i -u adam:adamsStrongPassword -XPUT http://localhost:9999/store/order -d {"items": {"eggs": 12}}
{
"message": "Operation not allowed"
}
=== Adam has enough items in the order
curl -i -u adam:adamsStrongPassword -XPUT http://localhost:9999/store/order -d {"items": {"eggs": 12, "milk": 1}}
{
"orderID": 4
}
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.