Skip to content

fix(hashview): align integration with Hashview v0.8.3-dev API routes#113

Open
bandrel wants to merge 5 commits into
mainfrom
fix/hashview-hashfile-listing
Open

fix(hashview): align integration with Hashview v0.8.3-dev API routes#113
bandrel wants to merge 5 commits into
mainfrom
fix/hashview-hashfile-listing

Conversation

@bandrel

@bandrel bandrel commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

The Hashview integration called several API routes that don't exist in Hashview (verified against the v0.8.3-dev branch the server runs). The most visible symptom: entering a customer ID immediately 404'd with Warning: Could not list hashfiles: 404 Client Error: NOT FOUND for url: …/v1/hashfiles.

These are all client-side bugs in hate_crack — wrong paths/methods, or assuming capabilities the API doesn't expose. Fixes:

Operation Was (404/405) Now (real route)
List a customer's hashfiles GET /v1/hashfiles (no list-all route) GET /v1/hashfiles/hash_type/<type>, scoped to the session hash type, filtered by customer
Hashfile hash-type lookup GET /v1/hashfiles/<id>/hash_type GET /v1/getHashType/<id>
Download "left" (uncracked) hashes GET /v1/hashfiles/<id>/left GET /v1/hashfiles/<id>
Delete job GET /v1/jobs/delete/<id> DELETE /v1/jobs/<id>
Start job GET /v1/jobs/start/<id> POST /v1/jobs/start/<id>

Two operations have no equivalent in the v0.8.3-dev API and are handled honestly instead of calling phantom endpoints:

  • Stop job — no stop route exists; stop_job() now raises NotImplementedError pointing at delete_job().
  • Bulk "found"/cracked-hash export — only single-hash POST /v1/search exists; the best-effort found-merge in download_left_hashes is documented and degrades gracefully on the expected 404.

The dead list_hashfiles() wrapper (only consumer of the phantom list-all route) was removed.

Testing

  • HATE_CRACK_SKIP_INIT=1 uv run pytest901 passed, 24 skipped
  • uv run ruff check hate_crack — clean; uv run ty check — no new diagnostics
  • Added offline tests: type-scoped customer listing, start_job POSTs, delete_job uses DELETE verb, stop_job raises.

🤖 Generated with Claude Code

bandrel and others added 5 commits June 18, 2026 16:53
The customer->hashfile flow called GET /v1/hashfiles to list all
hashfiles, then filtered client-side. That route does not exist in
Hashview (confirmed against v0.8.3-dev), so it 404'd as soon as a
customer ID was entered ("Could not list hashfiles").

Hashview exposes no list-all route; the only enumeration endpoint is
GET /v1/hashfiles/hash_type/<hash_type>, which already returns
customer_id and hash_type per file. Rebuild get_customer_hashfiles on
top of get_hashfiles_by_type, scoped to the session hash type
(hcatHashType), and filter by customer. Also fix get_hashfile_details
to call GET /v1/getHashType/<id> instead of the nonexistent
/v1/hashfiles/<id>/hash_type. Remove the dead list_hashfiles wrapper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Continues the v0.8.3-dev API alignment beyond the hashfile-listing 404:

- download_left_hashes: "left" hashes are GET /v1/hashfiles/<id>
  (returns uncracked ciphertexts), not the nonexistent /<id>/left.
- delete_job: DELETE /v1/jobs/<id>, not GET /v1/jobs/delete/<id>.
- start_job: POST /v1/jobs/start/<id>, not GET (route is POST-only).
- stop_job: Hashview has no stop route; raise NotImplementedError
  pointing at delete_job rather than calling a phantom endpoint.
- found-hash bulk export: no such route exists (only single-hash
  POST /v1/search); the best-effort merge is documented and degrades
  gracefully on the expected 404.

Adds offline tests asserting start_job POSTs, delete_job uses DELETE,
and stop_job raises. Documents the release in README.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The download-hashes flow scoped the customer hashfile listing to
hcatHashType, but that is None when the Hashview menu is entered
without a hashfile loaded this session -> "No hashfiles of type None
found". Since Hashview only lists hashfiles per type, prompt for a
hashcat hash-type when none is set (Q cancels back to the menu) and
use it for the listing. Downstream selection still derives the real
type from the chosen hashfile.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…type

Downloading previously required knowing/typing the hash type because
Hashview only lists hashfiles per type. The download flow now sweeps
common hashcat modes (HashviewAPI.get_all_customer_hashfiles) and shows
all of the customer's uploaded hashfiles to pick from, deduped by id.
A manual hash-type prompt remains as a fallback only when nothing is
found among the common set (uncommon modes). The chosen file's real
hash type still drives the download.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…bsent

The hashfile-listing route (/v1/hashfiles/hash_type/<type>) only exists
on Hashview builds from 2026-06-08+ (v0.8.3-dev). On `main` and older
servers it 404s, which surfaced as "Could not list hashfiles" and a dead
end. The download flow is now version-adaptive:

- get_all_customer_hashfiles stops sweeping after the first 404 (the
  listing endpoint is absent) instead of probing every common type.
- The menu treats listing as best-effort: when no listing is available
  it prints a clear note and accepts a hashfile ID typed directly (read
  from the web UI), with no list-membership check. The chosen file's
  type is resolved via GET /v1/getHashType/<id> and downloaded via
  GET /v1/hashfiles/<id> -- both present on all server versions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant