Document wallet GitHub link API response#241
Merged
Merged
Conversation
There was a problem hiding this comment.
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-githubrequest/response indocs/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.
| 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 |
MolhamHamwi
reviewed
May 25, 2026
Contributor
MolhamHamwi
left a comment
There was a problem hiding this comment.
No blockers from my review.
Evidence checked:
- Inspected
docs/api-examples.mdand confirmed the new/api/v1/wallets/link-githubexample states that GitHub login comes from the signed-in session cookie, not request body. - Cross-checked
app/main.py::api_link_wallet_github(): it passesgithub_loginfromrequire_github_login, reads onlyaddress,nonce, andsignature_hexfrom JSON, and returnswallet_to_dict(). - Cross-checked
app/ledger/service.py::wallet_link_payload(): the documented compact sorted-key payload fields matchtype, normalizedaddress, normalizedgithub_login, andnonce. - Inspected
tests/test_docs_public_urls.pycoverage 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 -qlocally: 14 passed. - Ran
ruff check docs/api-examples.md tests/test_docs_public_urls.pyandruff format --check tests/test_docs_public_urls.pylocally: 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.
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.
/claim #229
Summary
POST /api/v1/wallets/link-githubindocs/api-examples.md.address,nonce, andsignature_hex.wallet_to_dict()aftergithub_loginis linked.tests/test_docs_public_urls.py.Evidence
app/main.py::api_link_wallet_github().app/ledger/service.py::wallet_link_payload()andlink_wallet_to_github().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 passeduv run --python 3.12 --extra dev python scripts/docs_smoke.py-> docs smoke okuv run --python 3.12 --extra dev ruff check docs/api-examples.md tests/test_docs_public_urls.py-> all checks passeduv run --python 3.12 --extra dev ruff format --check --preview docs/api-examples.md tests/test_docs_public_urls.py-> 2 files already formatteduv run --python 3.12 --extra dev python -m pytest -q-> 206 passed, 2 warningsgit diff --check-> cleanNo private keys, wallet secrets, real signatures, payout details, PayPal details, deployment credentials, private vulnerability details, or MRWK price claims are included.