summaryrefslogtreecommitdiff
path: root/internal/config/config.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-06-29 00:35:17 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-06-29 00:35:17 +0000
commit6c2df12903bb9e4688866e30a446c69e91283c84 (patch)
tree031732aa231c459b3240ae0b06a66d5c90488f73 /internal/config/config.go
parent9e1b838a67c868cba3b1e148bf4211c23b3dbc00 (diff)
feat: add WidgetToken config + WidgetItem model for Android widget API
- Add WidgetToken field to Config struct to store bearer token for /api/widget endpoint - Load WidgetToken from WIDGET_TOKEN environment variable (optional) - Create WidgetItem and WidgetResponse models for widget API responses - Widget token authentication is optional; endpoint won't authenticate if token is empty Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/config/config.go')
-rw-r--r--internal/config/config.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 1738e54..67658b4 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -40,12 +40,16 @@ type Config struct {
WebAuthnRPID string // Relying Party ID (domain, e.g., "doot.terst.org")
WebAuthnOrigin string // Expected origin (e.g., "https://doot.terst.org")
+ // Widget API
+ WidgetToken string // Static bearer token for /api/widget (WIDGET_TOKEN env var)
+
// Claudomator
ClaudomatorURL string // URL of Claudomator service
// Service gateway — additional upstream services proxied through doot's auth layer
PlaygroundURL string // URL of playground demo service (optional)
ScoutURL string // URL of scout listing feed service (optional)
+ HawaiiURL string // URL of Hawaii county data dashboard (optional)
}
// Load reads configuration from environment variables
@@ -83,12 +87,16 @@ func Load() (*Config, error) {
WebAuthnRPID: os.Getenv("WEBAUTHN_RP_ID"),
WebAuthnOrigin: os.Getenv("WEBAUTHN_ORIGIN"),
+ // Widget API
+ WidgetToken: os.Getenv("WIDGET_TOKEN"),
+
// Claudomator
ClaudomatorURL: getEnvWithDefault("CLAUDOMATOR_URL", "http://127.0.0.1:8484"),
// Service gateway
PlaygroundURL: os.Getenv("PLAYGROUND_URL"),
ScoutURL: os.Getenv("SCOUT_URL"),
+ HawaiiURL: os.Getenv("HAWAII_URL"),
}
// Validate required fields