Skip to content

user: read back a user created without names - #94

Merged
msimerson merged 2 commits into
NicTool:mainfrom
aberoham:user-null-names
Nov 16, 2026
Merged

msimerson merged 2 commits into
NicTool:mainfrom
aberoham:user-null-names

Conversation

@aberoham

Copy link
Copy Markdown
Contributor

POST /user takes first_name and last_name as optional, and mysql stores the missing ones as NULL. user.v3 in validate refuses NULL, so every response holding that user answered 500.

On main, with the mysql store:

POST /user {"gid":4095,"username":"nameless","email":"n@example.com","password":"…"}  → 500, row stored
GET /user/{id}                                                                         → 500
GET /user?gid=4095                                                                     → 500
POST /session as nameless@group                                                        → 500

The json and toml stores leave the fields out, so they answer 200.

The mysql store now drops NULL names when it reads a user, in get() and authenticate(). The nameserver and zone_record stores already do this with their NULL columns. The new route test covers create, read, listing, login and GET /session.

POST /user takes first_name and last_name as optional, and mysql stores the
missing ones as NULL. The response schema refuses NULL, so creating, reading,
listing and logging in as that user all answered 500. The mysql store now drops
NULL names when it reads a row, as the nameserver and zone_record stores do.
@aberoham

Copy link
Copy Markdown
Contributor Author

The ubuntu test and coverage jobs fail at sudo /etc/init.d/mysql start, before any test runs. ubuntu-latest moved to 26.04. It has no init.d script. api#96 and NicTool/.github#9 fix the workflows.

@msimerson
msimerson merged commit 16b0b3b into NicTool:main Nov 16, 2026
11 checks passed
@aberoham
aberoham deleted the user-null-names branch November 16, 2026 17:36
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