| 1 | #!/bin/sh |
| 2 | # Supply fake credentials for every built-in auth provider, without writing profiles. |
| 3 | # Usage: ./scripts/with-fake-profiles.sh vpr test --tags local |
| 4 | # Environment credentials override saved profiles. Endpoint overrides are preserved |
| 5 | # so the wrapped command can use local emulators. This does not redirect cloud APIs. |
| 6 | set -eu |
| 7 | |
| 8 | if [ "$#" -eq 0 ]; then |
| 9 | echo "Usage: $0 <command> [args...]" >&2 |
| 10 | exit 2 |
| 11 | fi |
| 12 | |
| 13 | export AWS_ACCESS_KEY_ID=AKIAFAKELOCALTESTONLY |
| 14 | export AWS_SECRET_ACCESS_KEY=alchemy-fake-local-secret-access-key |
| 15 | export AWS_SESSION_TOKEN=alchemy-fake-local-session-token |
| 16 | export AWS_ACCOUNT_ID=000000000000 |
| 17 | export AWS_REGION="${AWS_REGION:-${AWS_DEFAULT_REGION:-us-east-1}}" |
| 18 | export AWS_DEFAULT_REGION="$AWS_REGION" |
| 19 | |
| 20 | export AXIOM_TOKEN=alchemy-fake-local-axiom-token |
| 21 | export AXIOM_API_KEY="$AXIOM_TOKEN" |
| 22 | export AXIOM_ORG_ID=alchemy-local |
| 23 | |
| 24 | export CLOUDFLARE_ACCOUNT_ID=00000000000000000000000000000000 |
| 25 | export CLOUDFLARE_API_TOKEN=alchemy-fake-local-cloudflare-token |
| 26 | export CLOUDFLARE_API_KEY=alchemy-fake-local-cloudflare-key |
| 27 | export CLOUDFLARE_EMAIL=alchemy-local@example.invalid |
| 28 | export CLOUDFLARE_ACCOUNT_EMAIL="$CLOUDFLARE_EMAIL" |
| 29 | |
| 30 | export DOPPLER_TOKEN=alchemy-fake-local-doppler-token |
| 31 | export FLY_API_TOKEN=alchemy-fake-local-fly-token |
| 32 | |
| 33 | export GITHUB_ACCESS_TOKEN=alchemy-fake-local-github-token |
| 34 | export GITHUB_TOKEN="$GITHUB_ACCESS_TOKEN" |
| 35 | export GH_TOKEN="$GITHUB_ACCESS_TOKEN" |
| 36 | export GH_ENTERPRISE_TOKEN="$GITHUB_ACCESS_TOKEN" |
| 37 | export GITHUB_ENTERPRISE_TOKEN="$GITHUB_ACCESS_TOKEN" |
| 38 | |
| 39 | export HCLOUD_TOKEN=alchemy-fake-local-hetzner-token |
| 40 | export INFISICAL_TOKEN=alchemy-fake-local-infisical-token |
| 41 | export NEON_API_KEY=alchemy-fake-local-neon-key |
| 42 | |
| 43 | export PLANETSCALE_API_TOKEN_ID=alchemy-fake-local-planetscale-id |
| 44 | export PLANETSCALE_API_TOKEN=alchemy-fake-local-planetscale-token |
| 45 | export PLANETSCALE_ORGANIZATION=alchemy-local |
| 46 | |
| 47 | export PRISMA_SERVICE_TOKEN=alchemy-fake-local-prisma-token |
| 48 | export PRISMA_API_TOKEN="$PRISMA_SERVICE_TOKEN" |
| 49 | export RAILWAY_API_TOKEN=alchemy-fake-local-railway-token |
| 50 | export STRIPE_API_KEY=sk_test_alchemy_fake_local |
| 51 | |
| 52 | # exec preserves arguments, signals, and the wrapped command's exit status. |
| 53 | exec "$@" |