cred-ui: NAME_RE/ENTRY_RE non-string input drops the connection instead of 400

Open Beginner friendly
#118 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
api, backend

Research direction

Start with api_set, api_host, api_delete, and do_POST, then compare their validation with the host_ok hardening in issue #117. Verify that non-string name or entry values receive HTTP 400 responses and that the connection is not dropped, with no writes occurring before validation.

Written by the indexing model from the issue text.

Description

bug

Same shape as the host_ok TypeError fixed in #117: api_set/api_host/api_delete call NAME_RE.match(name) / ENTRY_RE.match(entry) directly, so a non-string name/entry (e.g. JSON {"name": 123}) raises TypeError that escapes do_POST (catches only ValueError/RuntimeError) and drops the connection instead of answering 400. Pre-existing, fail-closed (no writes happen before validation), leaks nothing — apply the same isinstance hardening host_ok got, for consistency.

Dominant language
Python
Stars
1
Forks
0
Avg merge
4h 37m
Merged PRs (30d)
87

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ntindle/spark-vm

All issues in ntindle/spark-vm

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.