https://github.com/winebarrel/gap
Simple HTTP proxy with Google Oauth2 access token verification.
https://github.com/winebarrel/gap
golang google oauth2 proxy
Last synced: 5 months ago
JSON representation
Simple HTTP proxy with Google Oauth2 access token verification.
- Host: GitHub
- URL: https://github.com/winebarrel/gap
- Owner: winebarrel
- License: mit
- Created: 2025-08-31T07:57:19.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-11-14T05:47:23.000Z (7 months ago)
- Last Synced: 2025-11-14T07:23:37.669Z (7 months ago)
- Topics: golang, google, oauth2, proxy
- Language: Go
- Homepage:
- Size: 58.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gap
[](https://github.com/winebarrel/gap/actions/workflows/ci.yml)
Simple HTTP proxy with Google Oauth2 access token verification.
## Usage
```
Usage: gap --backend=BACKEND --port=UINT --header-name=STRING --allow-list=ALLOW-LIST,... [flags]
Flags:
-h, --help Show help.
-b, --backend=BACKEND Backend URL ($GAP_BACKEND).
-p, --port=UINT Listening port ($GAP_PORT).
-n, --header-name=STRING Header name to pass the access token
($GAP_HEADER).
-e, --allow-list=ALLOW-LIST,...
Allowed email list that may contain wildcards
($GAP_ALLOW_LIST).
--version
```
```sh
$ go run ./cmd/gap -b https://example.com -e '*@example.com' -p 8080 -n x-my-gap-token
# When using Docker:
# docker run --rm -p 8080:8080 ghcr.io/winebarrel/gap -b https://example.com -e '*@example.com' -p 8080 -n x-my-gap-token
```
```sh
# Get Oauth2 token from Apps Script and set it in an environment variable.
# e.g. https://developers.google.com/apps-script/reference/script/script-app#getOAuthToken()
$ export TOKEN='xxx'
$ curl -H "x-my-gap-token: ${NOT_CORRECT_TOKEN}" localhost:8080
forbidden
~% curl -H "x-my-gap-token: ${TOKEN}" localhost:8080
Example Domain
...
```