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