Repository navigation
feat(http-client): add byte-level sendSecure/sendRaw and Crypto sha256/hmacSha256/toHex primitives - #905
Open
stepandra wants to merge 6 commits into
Open
feat(http-client): add byte-level sendSecure/sendRaw and Crypto sha256/hmacSha256/toHex primitives#905stepandra wants to merge 6 commits into
stepandra wants to merge 6 commits into
Conversation
Generalize the existing getSecure/getRaw GET path into one method-agnostic primitive: raw Bytes body, non-throwing status codes, response headers, same redirect/proxy/TLS/size defaults. getSecure and getRaw become Get specializations. Spec: docs/changes/016-http-client-byte-level-methods.md.
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ent Http.Client helpers Protocol code inside nhcore (the S3 signer in change 017, FileUpload's content hash) needs the raw digest, a chainable HMAC and hex encoding, and today reaches for crypton/Data.ByteArray and Bytes.unwrap directly. Per the neohaskell#748 review ("add it to the Bytes/Core module instead of unwrapping"), the primitives now live in Crypto, which already owns that boundary. signWith is re-expressed on hmacSha256 + toHex (one implementation; output unchanged, pinned by a test). Known-answer tests: FIPS 180-4 SHA-256 vectors, RFC 4231 HMAC case 2, hex. Spec: docs/changes/021-crypto-sha256-hmac-hex.md (touches core-primitives). Also adds the one-line Haddock the doc-ratchet wants on Http.Client's existing helpers and regenerates codemap: undocumented_exports 560 -> 545, undocumented_doctest_modules 315 -> 314. Gates: ./dev check 0; ./dev test Crypto 24/0; ./dev test Http.Client 37/0; ./dev doctest 0 failures; ./dev lint No hints; ./dev codemap-check OK; ./dev spec-check 021 OK; git diff --check 0.
Member
|
Hey, thanks for this PR! One evidence correction:
Thanks! |
…tion ClientRawSpec's sendRaw and getRaw status examples send real loopback HTTP to an in-process Warp server, so they are integration / http:real with exact selector attestations in test-surfaces.json. The scheme check, methodName and the closed-port network error stay unit / none. Amp-Thread-ID: https://ampcode.com/threads/T-01a11c53-f9bd-70df-81b8-4369dbfd3e1b
… so 021 selectors resolve The C1/C2 locators named "abc" and "Jefe" in quotes, but the hspec source escapes them, so the exact-title selector never matched. Rename the two example titles and their locators; every assertion is unchanged. Amp-Thread-ID: https://ampcode.com/threads/T-01a11c53-f9bd-70df-81b8-4369dbfd3e1b
Integration criteria may name nhcore-test-core locators (change 016), but the --criteria-runtime --report gate in test-service read only the service report, so every core locator failed report mode. test-core now tees its direct output to nhcore-test-core.report under pipefail and uploads it fail-closed; test-service needs test-core, downloads that artifact and gates on the concatenation of both reports. workflow-check contract 6 freezes the wiring with self-test regressions. Amp-Thread-ID: https://ampcode.com/threads/T-01a11c53-f9bd-70df-81b8-4369dbfd3e1b
NickSeagull
marked this pull request as ready for review
October 12, 2026 09:52
NickSeagull
enabled auto-merge (squash)
October 12, 2026 09:55
This branch has not been deployed
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.
NeoHaskell integrations can send raw bytes with PUT, HEAD, DELETE, POST and PATCH, and read status codes and headers without treating every non-2xx response as an exception. Existing GET callers keep their behavior. The accompanying SHA-256, HMAC-SHA256 and hex helpers let protocol clients sign requests through Core instead of importing cryptography internals.
Review follow-up
integration / http:real, with exact selectors and fixture names intest-surfaces.json. Pure method/URL checks remainunit / none. The refused-connection example staysunit / none: no server fixture answers it.Verification
Local macOS checks with the pinned toolchain:
nhcore-test-core: 1109 examples, 0 failures, 3 pending. Includes 37 HTTP and 24 Crypto examples.These tests use real HTTP over local loopback, not external services. The full PostgreSQL/Hurl suite was not rerun. This remains a draft; this update does not claim final maintainer approval.
Migration: none. Specs: 016, 021. #906 depends on these APIs.