From 71c12aba1814598d2df68cbf9ed11d1bda94d72d Mon Sep 17 00:00:00 2001 From: Daniel Rocha <68558152+danroc@users.noreply.github.com> Date: Thu, 31 Oct 2024 22:15:17 +0100 Subject: [PATCH] docs: add manual testing steps to README --- README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/README.md b/README.md index 5323aff..41d412d 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,50 @@ The following environment variables can be used to configure Geoblock: - `GEOBLOCK_CONFIG`: Path to the configuration file (default: `config.yaml`). - `GEOBLOCK_PORT`: Port to listen on (default: `8080`). +## Manual testing + +Start geoblock with the provided example configuration: + +```bash +GEOBLOCK_CONFIG=examples/config.yaml GEOBLOCK_PORT=8080 make run +``` + +### Missing X-Forwarded-For and X-Forwarded-Host headers + +```http +GET http://localhost:8080/v1/forward-auth +``` + +### Missing X-Forwarded-Host header + +```http +GET http://localhost:8080/v1/forward-auth +X-Forwarded-For: 127.0.0.1 +``` + +### Missing X-Forwarded-For header + +```http +GET http://localhost:8080/v1/forward-auth +X-Forwarded-Host: example.com +``` + +### Blocked country + +```http +GET http://localhost:8080/v1/forward-auth +X-Forwarded-For: 8.8.8.8 +X-Forwarded-Host: example.com +``` + +### Request authorized + +```http +GET http://localhost:8080/v1/forward-auth +X-Forwarded-For: 127.0.0.1 +X-Forwarded-Host: example.com +``` + ## Roadmap - [x] Support environment variables