Cover the installer's connection check, the import, and two link paths - #723
Merged
Conversation
The installer's check is the first thing anybody runs and the only feedback they get about credentials that do not work. Covered: what it says for a host that is empty, a socket path that is not there, a database that cannot be reached, and what happens once the attempt limit is hit — the refusal comes before any connection is tried. The import: what it refuses, and what it reports when the import itself fails. The account configuration and the custom field create: their own refusals. For public links, two paths that had nothing on them: a link that renders its password as an image when the instance is configured that way, and the audit event a valid link records, whose viewer address is masked on a demo instance. One thing this pins deliberately rather than approvingly: a hash that was never issued answers with the bare string 'Link not found' while a real but expired link answers with the permission-denied page, so the two are distinguishable from outside. The hashes are long random strings, so it is an oracle nobody can walk, but it is written down rather than left to be rediscovered. The throttle directory is keyed on random bytes rather than faker, which the harness seeds — two tests in a class drew the same name and the second mkdir warned.
The two tests that connect to a real server named the host 'db', which is what it is called inside the development compose network and nothing at all on CI — where they failed on name resolution rather than on what they were testing. Read the same environment the rest of the suite reads.
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.
What
Tests across five controllers, salvaged and finished from an agent run that stopped part-way.
The installer's connection check
The first thing anybody runs, and the only feedback they get about credentials that do not work:
The throttle writes to a real directory, keyed on random bytes rather than faker — the harness seeds faker, so two tests in the same class drew the same name and the second
mkdirwarned.The import, and two save controllers
What the import refuses and what it reports when the import itself fails part-way; the account-configuration and custom-field-create refusals.
Two public link paths
One thing pinned deliberately rather than approvingly
A hash that was never issued answers with the bare string
Link not found, while a real but expired link answers with the permission-denied page — the exception for an unknown hash escapes to the generic handler, which renders it through the action's plain-text type. So the two are distinguishable from outside, on a page reachable without signing in.Public link hashes are long random strings, so this is an oracle nobody can practically walk — it tells an attacker who already holds a hash that it was once real. It is written down in the test rather than left to be rediscovered, and it is worth a decision separately from this PR.
Testing
Integration: 30 green across the four classes. Unit: 2 green on the custom-field controller.