Skip to content

fix(api-keys): reject invalid JSON bodies - #121

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
rissrice2105-agent:fix/api-key-invalid-json
Aug 1, 2026
Merged

fix(api-keys): reject invalid JSON bodies#121
ralyodio merged 1 commit into
profullstack:masterfrom
rissrice2105-agent:fix/api-key-invalid-json

Conversation

@rissrice2105-agent

Copy link
Copy Markdown
Contributor

Fixes #120.

What changed

  • parse API-key creation bodies explicitly instead of replacing JSON failures with {}
  • reject malformed, null, and array JSON payloads with HTTP 400
  • preserve the default API key label for valid JSON objects only
  • add regression coverage proving invalid payloads cannot reach key creation

Validation

  • pnpm --filter @aiornot/web exec vitest run lib/api-key-request.test.ts (3/3)
  • pnpm --filter @aiornot/web test (107/107)
  • pnpm --filter @aiornot/web typecheck
  • pnpm --filter @aiornot/web lint (0 errors; 7 existing warnings)
  • git diff --check

@ralyodio
ralyodio merged commit cc383a9 into profullstack:master Aug 1, 2026
5 checks passed
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.

Malformed JSON creates an API key with the default label

2 participants