From 58481cfff2071b7c7b704ce21cae004a661abf8f Mon Sep 17 00:00:00 2001 From: UnicodingUnicorn <7555ic@gmail.com> Date: Sun, 24 Feb 2019 04:02:26 +0800 Subject: [PATCH] backend-auth integration --- README.md | 15 ++++++++++--- main.go | 65 ++++++++++++++++++++++++++++++++++--------------------- 2 files changed, 52 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 64bc2d4..3fca313 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Beep backend accepts PUT requests and publishes a protobuf-ed version to a [NATS](htts://nats.io) queue, like some sort of weird HTTP/NATS converter. Also handles authentication of said HTTP requests. Needless to say, relies on a NATS instance being up. +**To run this service securely means to run it behind traefik forwarding auth to `backend-auth`** + ## Quickstart ``` @@ -20,7 +22,14 @@ Supply environment variables by either exporting them or editing ```.env```. ## API -All requests require an ```Authorization: Bearer ``` header, with token being obtained from ```backend-login```. +All requests need to be passed through `traefik` calling `backend-auth` as Forward Authentication. Otherwise, populate `X-User-Claim` with: + +```json +{ + "userid": "", + "clientid": "