Skip to content

Document wallet GitHub link API response#241

Merged
ramimbo merged 2 commits into
ramimbo:mainfrom
TUPM96:codex/docs-229-link-github-example
May 25, 2026
Merged

Document wallet GitHub link API response#241
ramimbo merged 2 commits into
ramimbo:mainfrom
TUPM96:codex/docs-229-link-github-example

Conversation

@TUPM96
Copy link
Copy Markdown
Contributor

@TUPM96 TUPM96 commented May 25, 2026

/claim #229

Summary

  • Documented POST /api/v1/wallets/link-github in docs/api-examples.md.
  • Clarified that the GitHub login comes from the signed session cookie while the body carries only address, nonce, and signature_hex.
  • Added the successful response shape, matching the public wallet object returned by wallet_to_dict() after github_login is linked.
  • Added regression coverage in tests/test_docs_public_urls.py.

Evidence

  • Request fields match app/main.py::api_link_wallet_github().
  • Signature guidance matches app/ledger/service.py::wallet_link_payload() and link_wallet_to_github().
  • Response fields match app/main.py::wallet_to_dict().

Verification

  • uv run --python 3.12 --extra dev python -m pytest tests/test_docs_public_urls.py -q -> 14 passed
  • uv run --python 3.12 --extra dev python scripts/docs_smoke.py -> docs smoke ok
  • uv run --python 3.12 --extra dev ruff check docs/api-examples.md tests/test_docs_public_urls.py -> all checks passed
  • uv run --python 3.12 --extra dev ruff format --check --preview docs/api-examples.md tests/test_docs_public_urls.py -> 2 files already formatted
  • uv run --python 3.12 --extra dev python -m pytest -q -> 206 passed, 2 warnings
  • git diff --check -> clean

No private keys, wallet secrets, real signatures, payout details, PayPal details, deployment credentials, private vulnerability details, or MRWK price claims are included.

Copilot AI review requested due to automatic review settings May 25, 2026 08:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds documentation and a regression test for linking a registered wallet to the authenticated GitHub account via a new API example in the docs.

Changes:

  • Document POST /api/v1/wallets/link-github request/response in docs/api-examples.md
  • Add a docs regression test to ensure key strings for the new example remain present

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tests/test_docs_public_urls.py Adds assertions validating the new “link GitHub” API example is present in docs
docs/api-examples.md Adds a curl example and sample JSON response for linking a wallet to a GitHub login

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/api-examples.md
curl -s -X POST "$API_HOST/api/v1/wallets/link-github" \
-H "Content-Type: application/json" \
-b "<signed GitHub session cookie>" \
-d '{"address":"<registered_mrwk1_address>","nonce":1,"signature_hex":"<128 lowercase hex chars>"}'
Comment on lines +135 to +143
assert 'POST "$API_HOST/api/v1/wallets/link-github"' in examples
assert "signed-in session cookie" in examples
assert '"address":"<registered_mrwk1_address>"' in examples
assert '"signature_hex":"<128 lowercase hex chars>"' in examples
assert "wallet-link payload" in examples
assert "wallet's `next_nonce`" in examples
assert '"github_login": "tatelyman"' in examples
assert '"nonce": 1' in examples
assert '"next_nonce": 2' in examples
Copy link
Copy Markdown
Contributor

@MolhamHamwi MolhamHamwi left a comment

Choose a reason for hiding this comment

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

No blockers from my review.

Evidence checked:

  • Inspected docs/api-examples.md and confirmed the new /api/v1/wallets/link-github example states that GitHub login comes from the signed-in session cookie, not request body.
  • Cross-checked app/main.py::api_link_wallet_github(): it passes github_login from require_github_login, reads only address, nonce, and signature_hex from JSON, and returns wallet_to_dict().
  • Cross-checked app/ledger/service.py::wallet_link_payload(): the documented compact sorted-key payload fields match type, normalized address, normalized github_login, and nonce.
  • Inspected tests/test_docs_public_urls.py coverage for endpoint path, session-cookie wording, signature placeholder, payload type, GitHub login placeholder, and response nonce fields.
  • Ran pytest tests/test_docs_public_urls.py -q locally: 14 passed.
  • Ran ruff check docs/api-examples.md tests/test_docs_public_urls.py and ruff format --check tests/test_docs_public_urls.py locally: both passed.

The docs change is focused and I did not see wallet private-key, deployment, payout-detail, MRWK price-claim, or secret-handling exposure in the touched scope.

@ramimbo ramimbo merged commit 8c3cda1 into ramimbo:main May 25, 2026
1 check passed
@ramimbo ramimbo added mrwk:accepted Maintainer accepted for payout mrwk:paid Ledger payment recorded labels May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mrwk:accepted Maintainer accepted for payout mrwk:paid Ledger payment recorded

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants