Skip to content

chore: warn when admin/bootstrap mint API keys without TOKEN_PEPPER (#133)#150

Merged
ds1 merged 1 commit into
masterfrom
chore/pepper-mint-warning
Jun 3, 2026
Merged

chore: warn when admin/bootstrap mint API keys without TOKEN_PEPPER (#133)#150
ds1 merged 1 commit into
masterfrom
chore/pepper-mint-warning

Conversation

@ds1
Copy link
Copy Markdown
Owner

@ds1 ds1 commented May 31, 2026

What

Adds a loud warning at the two direct-DB API-key mint sites when TOKEN_PEPPER is absent — i.e. when they fall back to minting a legacy SHA-256 key instead of an HMAC key:

  • scripts/create-api-key.mts (admin key creation) — console.warn + a TOKEN_PEPPER note in the --help usage.
  • packages/onboarding/src/merchant.ts (mintApiKey, used by bootstrap-merchant) — console.warn to stderr.

Changeset: @pincerpay/onboarding patch.

Why

Part of #133 (the #124/#135 HMAC rollout). These paths silently fall back to SHA-256 when no pepper is set, so a misconfigured operator/CI environment would mint legacy keys with no signal. The warning surfaces it. No other behavior change — the key is still minted and works via the facilitator's fallback.

What this does NOT do

This is the safety-net half of #133. The operational half — exporting TOKEN_PEPPER (same value as the facilitator) wherever pnpm create-api-key / pnpm bootstrap-merchant actually run (operator shell .env, any CI secret) — is environment config, not code. #133 stays open until that's in place.

Test

@pincerpay/onboarding typecheck + 7 tests pass.

🤖 Generated with Claude Code

scripts/create-api-key.mts and packages/onboarding/src/merchant.ts (mintApiKey, used by bootstrap-merchant) mint directly against the DB via hashNewApiKey, which silently falls back to legacy SHA-256 when TOKEN_PEPPER is unset. Add a loud warning at both sites when minting without a pepper, plus a TOKEN_PEPPER note in the create-api-key usage. Part of #133.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pincerpay-agent-demo Ready Ready Preview, Comment May 31, 2026 6:22am
pincerpay-dashboard Ready Ready Preview, Comment May 31, 2026 6:22am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant