From 30326042c292549b6ccbdab39e48bde0ff9bb889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= <47888471+joao-pereira5@users.noreply.github.com> Date: Mon, 15 Jun 2020 20:34:23 +0100 Subject: [PATCH 1/2] Adds a readme guide for access token use. --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 0018d22a..10540c7b 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ Table of Contents - [Overview](#overview) - [Build](#build) - [Running](#running) +- [Access management](#access-management) Overview ======== @@ -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 access token, used for creation of the client's access 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 convinience 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" +``` From 984adace0ba0f8f59cb979314a513b0ae0aef973 Mon Sep 17 00:00:00 2001 From: Alex <47825610+Alex-Pena-Ok@users.noreply.github.com> Date: Mon, 15 Jun 2020 20:51:34 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 10540c7b..3f2a2ebc 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Access management ================= All requests will be locked under an access control mechanism. -The following task creates the Issue access token, used for creation of the client's access tokens. +The following task creates the Issue token, used for creation of the client's read and write tokens. ```sh $ # Clean cached DB config objects @@ -79,7 +79,7 @@ $ $ # Get issue token $ ./gradlew pgInsertIssueToken $ -$ # This task will insert a short lived read token, for convinience at test time +$ # This task will insert a short lived read token, for convenience at test time $ ./gradlew pgInsertReadToken $ ```