From a2927a3f6b635049526377f4a80bac1963250929 Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Mon, 9 Feb 2026 20:56:45 -0500 Subject: [PATCH] fix: Update validate-examples to recognize HMAC credentials The script was checking for legacy UNSANDBOX_API_KEY but CI has UNSANDBOX_PUBLIC_KEY and UNSANDBOX_SECRET_KEY set. Updated the credential detection to recognize both HMAC and legacy auth. This fixes the misleading warning 'UNSANDBOX_API_KEY not set' when examples ARE actually running with valid HMAC credentials. --- scripts/validate-examples.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/validate-examples.sh b/scripts/validate-examples.sh index 9eb8f26..0379e81 100755 --- a/scripts/validate-examples.sh +++ b/scripts/validate-examples.sh @@ -14,7 +14,9 @@ # bash scripts/validate-examples.sh # # Environment: -# UNSANDBOX_API_KEY - API key for authentication (required) +# UNSANDBOX_PUBLIC_KEY - Public key for HMAC authentication +# UNSANDBOX_SECRET_KEY - Secret key for HMAC authentication +# (Legacy: UNSANDBOX_API_KEY - still supported for API mode) # UNSANDBOX_API_URL - API endpoint (default: https://api.unsandbox.com) # PARALLEL_JOBS - Number of parallel executions (default: 4) @@ -668,9 +670,13 @@ main() { log "Results directory: $RESULTS_DIR" log "Parallel jobs: $PARALLEL_JOBS" - # Check for API key - if [[ -z "$UNSANDBOX_API_KEY" ]]; then - log_warn "UNSANDBOX_API_KEY not set - will scan for examples but skip execution" + # Check for credentials (HMAC or legacy API key) + if [[ -n "$UNSANDBOX_PUBLIC_KEY" && -n "$UNSANDBOX_SECRET_KEY" ]]; then + log "HMAC credentials detected - examples will execute with API access" + elif [[ -n "$UNSANDBOX_API_KEY" ]]; then + log "Legacy API key detected - examples will execute with API access" + else + log_warn "No credentials set - examples will run locally (may exit early)" fi # Find all examples