Skip to content

Commit

Permalink
Merge pull request #160 from i-on-project/docs/gh-152-readme-am
Browse files Browse the repository at this point in the history
Docs: Adds a readme guide for access token use.
  • Loading branch information
jmchamica authored Jun 15, 2020
2 parents 68f6955 + 984adac commit ff6d16d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Table of Contents
- [Overview](#overview)
- [Build](#build)
- [Running](#running)
- [Access management](#access-management)

Overview
========
Expand Down Expand Up @@ -63,4 +64,30 @@ $ java -server -jar ./build/libs/core-0.1.jar
If you previously ran the `build` task, you may skip `assemble`.
The server will open on port `8080` which you may change by specifying an option (e.g `java -server -Dserver.port=10022 -jar ./build/libs/core-0.1.jar`)

Access management
=================

All requests will be locked under an access control mechanism.
The following task creates the Issue token, used for creation of the client's read and write tokens.

```sh
$ # Clean cached DB config objects
$ ./gradlew clean -p buildSrc
$
$ export JDBC_DATABASE_URL="jdbc:postgresql://10.0.2.15:10020/myrealdb?user=unpriv&password=realdbsafepw"
$
$ # Get issue token
$ ./gradlew pgInsertIssueToken
$
$ # This task will insert a short lived read token, for convenience at test time
$ ./gradlew pgInsertReadToken
$
```

These tasks will output the string value of the token, which you may include in further requests.

```sh
$ # authenticated HTTP request
$ curl -X GET localhost:8080 -H "Authorization: Bearer previouslyinsertedtoken"
```

0 comments on commit ff6d16d

Please sign in to comment.