Documentation
¶
Overview ¶
An example of how to use the Authz plugin.
$ go run examples/authzs/authzexample.go
At time of writing there is no web UI to exercise the endpoints, so you'll need to use CURL (or equivalent). Use the following commands to try things out:
Get an access token for a specific user using email/password:
curl 'http://localhost:8000/api/auth/login?provider=password&creds%5Bemail%5D=logan@xmen.net&creds%5Bpassword%5D=password&issue_token=true'
Save the token in an environment variable:
export AT='...'
List documents:
curl -H "Authorization: bearer $AT" http://localhost:8000/api/xmen/docs
View a document:
curl -H "Authorization: bearer $AT" http://localhost:8000/api/xmen/docs/3
Save a document:
curl -X PUT -d '{"title": "new title", "body": "new body"}' -H"Authorization: bearer $AT" -H"X-CSRF-Protection: 1" http://localhost:8000/api/xmen/docs/3
Click to show internal directories.
Click to hide internal directories.