Skip to content

fix(crypto): trim public key user ids - #178

Open
aiirvizionz wants to merge 1 commit into
profullstack:masterfrom
aiirvizionz:clientkit/public-key-user-id-trim-2
Open

fix(crypto): trim public key user ids#178
aiirvizionz wants to merge 1 commit into
profullstack:masterfrom
aiirvizionz:clientkit/public-key-user-id-trim-2

Conversation

@aiirvizionz

Copy link
Copy Markdown
Contributor

Summary

  • trim user_id query params before public key lookup and response
  • reject blank user_id values before authentication or service-role database work
  • add focused route coverage for trimmed and blank user ids

Tests

  • node node_modules\vitest\vitest.mjs run --config $env:TEMP\qryptchat-vitest-minimal.config.mjs "src/app/api/crypto/public-keys/route.test.js"
  • git diff --check

Note: I used the minimal Vitest config already present locally because the repo's default Vitest setup imports @vitejs/plugin-react, which currently fails against the installed Vite package export map in this checkout.

const url = new URL(request.url);
try {
const userId = url.searchParams.get('user_id')?.trim();
if (!userId) {
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.

2 participants