Repository navigation
Dashboard: sign in with an API key or user name of any length - #302
Merged
Merged
Conversation
The sign-in page refused an API key shorter than 10 characters and a user name shorter than 3, and kept its button disabled. The server takes any length (WithApiKey, WithBasicAuth) and compares the credentials as they are, so a dashboard configured with a short key or user name could not be opened at all. The form now refuses only an empty field. The rules move to utilities/loginRules.ts, with tests.
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.
The sign-in page refused an API key shorter than 10 characters and a user name shorter than 3, and kept its button disabled. The server takes any length (
WithApiKey,WithBasicAuth) and compares the credentials as they are, so a dashboard configured with a short key or user name could not be opened at all.Change
utilities/loginRules.tsandLogin.vueuses them.What does not change
Testing
loginRules.test.ts: short keys and user names are accepted, empty fields refused. Mutants that put back the 10-character key rule (in the rule or in the button check) or the 3-character user name rule each fail the full dashboard suite (338 tests).WithApiKey("short1")): before, "API key must be at least 10 characters" with the button disabled, while/api/auth/validateaccepts the key; after, the button is enabled and sign-in lands on the dashboard.vue-tsc --buildclean, no new lint messages, every .NET test project passes, the scenario solution builds.