Repository navigation
Conversation
API v2 answers a user whose API access is turned off (API Enabled unset)
401 "API disabled for: <user>", and only once the password is right, but
every login 401 read as "Invalid username or password". That message is
now "API access is disabled for user <user>".
zm-api checks the user name's format before the password and answers 400
for a name outside 3-64 letters, digits, "_", "." and "-". ZoneMinder
allows other names ("cam viewer", "ha@home"), so that 400 isn't a wrong
password either: it now names the refused user name and zm-api's reason.
Both still raise ZMAuthenticationError: the account can't log in until an
admin changes something, and only the message changes.
fixes ZoneMinder#68
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Impact: low (a user with API access turned off, or a user name zm-api refuses, is told "Invalid username or password")
TL;DR
ZMAuthenticationError; tests and a changelog line; 5 files, +63/-2OPT_USE_APIoff (fix-low: tell API v2 being turned off from a wrong password #63) unchangedTested as
e26094d8f;a6be57045is the same tree withfixes #68in the message.fixes #68
🤖 Generated with Claude Code