Repository navigation
feat(antd-swift): sha256 on upload results and manifest entries (REST + gRPC) - #401
Merged
Merged
Conversation
… + gRPC) antd 0.17.0 returns the plaintext's SHA-256 (lowercase hex) on every upload response and lets a manifest entry carry one (V2-1724). Upload results: DataPutResult, DataPutPublicResult, FilePutResult, FilePutPublicResult, FinalizeUploadResult and FinalizeMerkleUploadResult gain `sha256: String?`. A missing key (antd < 0.17.0, REST) or an empty string (gRPC's zero value) reads as nil. POST /v1/data, /v1/data/public, /v1/files, /v1/files/public and /v1/upload/finalize (wave and merkle) are mapped on both transports. Manifests: ManifestEntryInput gains `sha256: String?`, sent only when set and non-empty (omitted from the REST JSON; proto3 optional presence left unset over gRPC). ManifestEntryInfo gains `sha256: String?`, nil when absent or empty, on build and decode. The hash is passed through as given: no hex, length or case check, so a malformed one is the daemon's 400 / INVALID_ARGUMENT as BadRequestError with the server's message. Compatibility: every new initializer parameter is last with a default of nil, so existing construction compiles unchanged. No protocol requirement, error type or enum changed. No fluent helper (no withSize siblings). No generated stub changed: the committed ones already carry the fields. Requires antd 0.17.0 or later; README documents it. Tests: 12 new unit tests (6 REST over StubURLProtocol, 6 in-process gRPC) cover presence, absence and empty on each result type, the manifest request JSON / proto presence, build and decode reads, and the 400 mapping. A gated live test (LiveSha256Tests, ANTD_TEST_URL / ANTD_TEST_GRPC plus ANTD_TEST_SHA_LINK) decodes the fixture link, builds with and without a hash, expects the bad-request error for "zz", and makes one paid public data upload per transport, checking the returned sha256 against a local SHA-256 (self-contained implementation, no new dependency). Run against antd 0.17.0 on a local devnet: rest 306a7998...facb62 and grpc 7efecabe...ef196f both matched. Full suite 185 tests, 5 skipped (live), 0 failures, on Swift 6.1.3. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
MaidSafe-Hermes
approved these changes
Oct 23, 2026
MaidSafe-Hermes
left a comment
There was a problem hiding this comment.
APPROVE — reviewed head a8a7766c7281e470789b65f2193ded1b84a40580.
Coverage: 2/2 seats reviewed (sol-1 gpt-6.1-sol xhigh; glm-1 z-ai/glm-5.3). Sol-1 raised a Swift 6 asynchronous locking concern; the exact-head macOS Build + test CI check passes, resolving that compile concern for the configured toolchain.
REST/gRPC upload results normalize absent/empty hashes; manifest inputs omit unset/empty values and outputs read the optional field. Tests cover these paths, and CI reports build and test success. Live devnet behavior was not independently rerun here. This is a code-review approval only; no merge performed.
Nic-dorman
marked this pull request as ready for review
October 23, 2026 19:37
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.
Part of the sha-fanout round (V2-1724): the SDK side of the sha256 fields antd 0.17.0 added in #347. Targets main; the daemon and antd-go are already released.
antd 0.17.0 returns the plaintext's SHA-256 (lowercase hex) on every upload
response and lets a manifest entry carry one (V2-1724).
Upload results: DataPutResult, DataPutPublicResult, FilePutResult,
FilePutPublicResult, FinalizeUploadResult and FinalizeMerkleUploadResult
gain
sha256: String?. A missing key (antd < 0.17.0, REST) or an emptystring (gRPC's zero value) reads as nil. POST /v1/data, /v1/data/public,
/v1/files, /v1/files/public and /v1/upload/finalize (wave and merkle) are
mapped on both transports.
Manifests: ManifestEntryInput gains
sha256: String?, sent only when setand non-empty (omitted from the REST JSON; proto3 optional presence left
unset over gRPC). ManifestEntryInfo gains
sha256: String?, nil when absentor empty, on build and decode. The hash is passed through as given: no hex,
length or case check, so a malformed one is the daemon's 400 /
INVALID_ARGUMENT as BadRequestError with the server's message.
Compatibility: every new initializer parameter is last with a default of
nil, so existing construction compiles unchanged. No protocol requirement,
error type or enum changed. No fluent helper (no withSize siblings). No
generated stub changed: the committed ones already carry the fields.
Requires antd 0.17.0 or later; README documents it.
Tests: 12 new unit tests (6 REST over StubURLProtocol, 6 in-process gRPC)
cover presence, absence and empty on each result type, the manifest request
JSON / proto presence, build and decode reads, and the 400 mapping. A
gated live test (LiveSha256Tests, ANTD_TEST_URL / ANTD_TEST_GRPC plus
ANTD_TEST_SHA_LINK) decodes the fixture link, builds with and without a
hash, expects the bad-request error for "zz", and makes one paid public data
upload per transport, checking the returned sha256 against a local SHA-256
(self-contained implementation, no new dependency). Run against antd 0.17.0
on a local devnet: rest 306a7998...facb62 and grpc 7efecabe...ef196f both
matched. Full suite 185 tests, 5 skipped (live), 0 failures, on Swift 6.1.3.
🤖 Generated with Claude Code