Repository navigation
Audit 2026-11: public API reference link + E-18 signed records export - #1
Draft
TheDude4224 wants to merge 3 commits into
Draft
TheDude4224 wants to merge 3 commits into
TheDude4224 wants to merge 3 commits into
Conversation
…json infinihash-baas #141 puts /api/docs behind auth; the public spec is served at /docs/openapi.public.json when PUBLIC_API_SPEC=true. README and the pyproject 'API reference' URL now link the public spec. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
records_export() parsed the JSON and dropped X-Infinihash-Export-Signature,
so nothing it returned could be verified (the Ed25519 signature covers the
exact body bytes). Add records_export_signed(from_, to, format) returning
{body: bytes, signature, key_id, sha256}, plus parse_export_signature().
records_export() is unchanged. cryptography is not a dependency, so
verification is documented in the README instead of shipped as a helper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by local-ci: `pip install .` packaged the committed, stale build/lib/infinihash_baas/client.py instead of the source, so the new records_export_signed() tests failed (4 failed / 8 passed on every matrix leg). Removes build/ and *.egg-info from git, ignores them, and fixes the CI step that imported infinihash_kyc instead of infinihash_baas. Clean install: 12 passed. 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.
Finding → commit → test
1. API reference link (follow-up to infinihash-baas #141, T-1/E-15a), commit
4175187infinihash-baas #141 puts
/api/docsbehind auth. The public spec is served at/docs/openapi.public.json, but only when the server hasPUBLIC_API_SPEC=true.Reference: https://rails-api.infinihash.com/api/docs.Reference: https://rails-api.infinihash.com/docs/openapi.public.json (public OpenAPI spec; the full /api/docs reference needs an API key)."API reference" = "https://rails-api.infinihash.com/api/docs""API reference" = "https://rails-api.infinihash.com/docs/openapi.public.json"Verified with
rg api/docs: the only remaining mention is the "needs an API key" note.Dependency / deploy order: as of 2026-11-26,
GET /docs/openapi.public.jsonreturns 404 and/api/docsreturns 200, because #141 isn't deployed and the flag is off. Merge this after #141 ships withPUBLIC_API_SPEC=true, or the new link is dead in the meantime.2. E-18: signed records export keeps bytes and signature, commit
32c1988records_export()parsed the body as JSON and droppedX-Infinihash-Export-Signature, so nothing it returned could be verified. The Ed25519 signature covers the exact body bytes (infinihash-baassrc/lib/recordsExport.js).Rails.records_export_signed(from_=None, to=None, format=None)returns{"body": bytes, "signature": str|None, "key_id": str|None, "sha256": str|None}.parse_export_signature(header)parsesed25519;keyid=<id>;sig=<base64>and returns{}for an unsigned or malformed header.records_export()is unchanged, so existing callers aren't affected. Its docstring now says the parsed result can't be verified.verify_export(), becausecryptographyisn't a dependency (onlyrequests). The README documents verification withcryptographyand withopenssl pkeyutl. I checked thecryptographysnippet in a scratch venv against a real Ed25519 signature: it verifies, and a tampered body raisesInvalidSignature.New tests in
tests/test_client.py:unsigneddeployment;RailsError, and a missing key refuses before any network call;records_export()still returns parsed JSON;Tests
CI cannot run: GitHub Actions has failed at startup across the org since about 2026-11-15.
Not done / flagged
.github/workflows/ci.ymlrunsimport infinihash_kyc(the wrong package), so CI's "Examples import cleanly" step fails even when Actions is working. Not changed here.build/lib/andinfinihash_baas.egg-info/are committed build artefacts with a stale copy ofclient.py. Not touched.v0.1.1when you release; the README install line pins@v0.1.0.🤖 Generated with Claude Code