#!/bin/sh
# tests/mock_token.sh - stand-in for scorpiox-google-fetchtoken -local.
#
# Prints the real payload shape, including a fake bearer token, so the suite can
# prove the plugin never forwards that token to a browser or a proxy log.
#
# Set MOCK_TOKEN_FAIL=1 to exercise the refresh failure path.
if [ "$MOCK_TOKEN_FAIL" = "1" ]; then
  printf '{"ok":false,"error":"no refresh_token for account"}\n'
  exit 1
fi
printf 'fetching token (local)\n'
printf '{"ok":true,"email":"pico@example.com","access_token":"ya29.MOCK-ACCESS-TOKEN-MUST-NOT-LEAK",'
printf '"project_id":"proj-mock-42","expires_in":3599}\n'
