Minimal OAuth2 authentication service for Deploys.app. Acts as an OAuth2 authorization server backed by Google as the identity provider.
$ go build -o auth .Required environment variables:
| Variable | Description |
|---|---|
SQL_URL |
PostgreSQL connection string |
OAUTH2_CLIENT_ID |
Google OAuth app client ID |
OAUTH2_CLIENT_SECRET |
Google OAuth app client secret |
PORT |
Listen port (default: 8080) |
$ ./authThe schema in schema.sql must be applied to the database before the service starts.
| Method | Path | Purpose |
|---|---|---|
GET |
/ |
Validate the OAuth2 client and redirect to Google |
GET |
/callback |
Receive Google's code and issue an internal auth code |
POST |
/token |
Exchange client credentials + code for a user token |
POST |
/revoke |
Revoke a user token |
The provided Dockerfile builds a gcr.io/distroless/static
image. CI pushes to registry.moonrhythm.io/deploys-app/auth:<git-sha>.