Skip to content

feat(antd-swift): sha256 on upload results and manifest entries (REST + gRPC) - #401

Merged
Nic-dorman merged 1 commit into
mainfrom
nic/v2-1724-sha256-swift
Oct 23, 2026
Merged

Nic-dorman merged 1 commit into
mainfrom
nic/v2-1724-sha256-swift

Conversation

@Nic-dorman

Copy link
Copy Markdown
Member

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 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.

🤖 Generated with Claude Code

… + 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 MaidSafe-Hermes left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Nic-dorman marked this pull request as ready for review October 23, 2026 19:37
@Nic-dorman
Nic-dorman merged commit 811ee8d into main Oct 23, 2026
1 check passed
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.

2 participants