Skip to content

Commit

Permalink
docs: add manual testing steps to README
Browse files Browse the repository at this point in the history
  • Loading branch information
danroc committed Oct 31, 2024
1 parent d047392 commit 71c12ab
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 71c12ab

Please sign in to comment.