From 6c2df12903bb9e4688866e30a446c69e91283c84 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Mon, 29 Jun 2026 00:35:17 +0000 Subject: 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 --- internal/config/config.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'internal/config/config.go') 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 -- cgit v1.2.3