Skip to content

feat: add sign parameter to upload_data for notary-signed uploads (#44) - #139

Open
miles-on-nightshift wants to merge 1 commit into
datafund:mainfrom
miles-on-nightshift:feat/44-sign-parameter-upload-data
Open

feat: add sign parameter to upload_data for notary-signed uploads (#44)#139
miles-on-nightshift wants to merge 1 commit into
datafund:mainfrom
miles-on-nightshift:feat/44-sign-parameter-upload-data

Conversation

@miles-on-nightshift

Copy link
Copy Markdown
Contributor

Summary

Implements the sign parameter for the upload_data tool, resolving #44.

  • gateway_client.py — adds optional sign: Optional[str] = None to upload_data(), passes it as a query param when provided
  • server.py — adds sign to the MCP tool schema as an enum ["notary"] with descriptive help text; surfaces notary signer address in success response when present
  • tests/test_gateway_client.py` — adds tests for both signed and unsigned upload paths

Behaviour

When sign="notary", the request becomes POST /api/v1/data/?sign=notary&stamp_id=..., triggering the gateway's notary service to cryptographically sign the data at upload time. The success response includes:

🎉 Data uploaded successfully to Swarm!

📄 Upload Details:
   Size: 42 bytes
   Content Type: application/json
   Stamp Used: `<stamp>`
   Signing: notary

🔗 Retrieval Information:
   Reference Hash: `<hash>`

🔐 Notary Signature:
   Signer: 0x...

When sign is omitted, behaviour is identical to the previous release.

Test plan

  • pytest tests/test_gateway_client.py — 12 passed
  • Manual: upload with sign="notary" against a dev gateway with notary enabled and confirm signature fields appear

Closes #44

🤖 Generated with Claude Code

…tafund#44)

Adds optional sign parameter to upload_data tool and gateway client.
When sign="notary", the gateway cryptographically signs the data at
upload time. Response surfaces notary signer address when present.

Co-Authored-By: Claude Sonnet 4.6 <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.

Add sign parameter to upload_data for notary-signed uploads

1 participant