Skip to content

feat(faucet): GitHub OAuth verification with tiered rate limits (Bounty #751) - #7466

Closed
foreveropen66 wants to merge 4 commits into
Scottcjn:mainfrom
foreveropen66:feat/faucet-github-oauth-bounty-751
Closed

foreveropen66 wants to merge 4 commits into
Scottcjn:mainfrom
foreveropen66:feat/faucet-github-oauth-bounty-751

Conversation

@foreveropen66

Copy link
Copy Markdown

Summary

Implements Bounty #751 — GitHub OAuth verification for the RustChain testnet faucet, unlocking tiered rate limits.

Tier Rate Limit Requirement
🔓 Anonymous 0.5 RTC / 24h None
✅ GitHub Auth 1.0 RTC / 24h GitHub account
⭐ GitHub Veteran 2.0 RTC / 24h Account > 1 year old

What's Added

faucet_github_oauth.py (~23KB)

  • Full Flask application with GitHub OAuth 2.0 flow
  • CSRF protection via IP-bound state tokens
  • SQLite backend with atomic transactions
  • Session-based authentication
  • REST API + responsive web UI

test_faucet_github_oauth.py (21 tests, all passing)

  • Wallet validation (RTC + 0x formats)
  • GitHub veteran detection
  • IP / auth / veteran rate limiting
  • OAuth state security
  • HTTP endpoint coverage

FAUCET_GITHUB_OAUTH_README.md

  • Setup instructions, API docs, architecture diagram

Security

  • One-time OAuth state tokens (10-min expiry, IP-bound)
  • Atomic SQLite BEGIN IMMEDIATE transactions
  • Signed Flask sessions
  • Strict wallet address validation

Testing

pip install flask requests pyyaml pycryptodome pytest
python -m pytest test_faucet_github_oauth.py -v
# 21 passed in 0.47s

Bounty Reference

Checklist

  • Feature implemented
  • Tests written (21 passing)
  • Documentation added
  • No breaking changes to existing faucet
  • Compatible with existing SQLite schema (adds 2 nullable columns)

foreverzyf and others added 4 commits June 12, 2026 02:50
…ut (Scottcjn#2787)

Bounty: [ONBOARD: 5 RTC] Star + Write a Unit Test for Any Module
- 15 test cases covering valid JSON, invalid JSON, edge cases
- Tests for objects, arrays, strings, numbers, booleans, null
- Unicode support validation
- Large JSON structure handling
- Malformed JSON error handling
Fixes issue #13889 - Private Key Exposed as MCP Tool Parameter

Changes:
- Add _SENSITIVE_KEYS constant for fields to scrub (private_key, secret,
  password, token, api_key, mnemonic, seed, auth_key)
- Add _scrub_sensitive() helper to redact sensitive values before logging
- Update call_tool handler to log only scrubbed arguments
- Verified with unit test: all sensitive fields redacted to ***REDACTED***,
  non-sensitive fields preserved unchanged

This prevents private keys and other credentials from appearing in:
- MCP server logs
- LLM conversation history
- Proxy/network logs
- AI training data

Resolves CWE-312 (Cleartext Storage of Sensitive Information)
Implements bounty Scottcjn#751 GitHub OAuth enhancement (+5 RTC):
- GitHub OAuth 2.0 login flow with CSRF protection
- Tiered rate limits: IP (0.5 RTC) / GitHub auth (1.0 RTC) / Veteran (2.0 RTC)
- SQLite backend for persistent drip and session tracking
- REST API + responsive web UI with auth bar
- 21 comprehensive tests, all passing
- Atomic SQLite transactions prevent race conditions

Files added:
- faucet_github_oauth.py (main app, ~23KB)
- test_faucet_github_oauth.py (test suite, 21 tests)
- FAUCET_GITHUB_OAUTH_README.md (documentation)

Wallet: foreveropen66
@github-actions github-actions Bot added documentation Improvements or additions to documentation BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) tests Test suite changes size/XL PR: 500+ lines labels Jun 15, 2026

@jaxint jaxint left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated Review

Reviewed by bounty bot for RTC rewards.

  • Code structure looks good
  • Changes align with project goals
  • Ready for maintainer review

Wallet: AhqbFaPBPLMMiaLDzA9WhQcyvv4hMxiteLhPk3NhG1iG

@jaxint jaxint left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewing PR #7466

✅ Code review completed

Wallet: AhqbFaPBPLMMiaLDzA9WhQcyvv4hMxiteLhPk3NhG1iG

@Scottcjn

Copy link
Copy Markdown
Owner

Thanks for the contribution. Closing under our SECURITY.md deployment-scope policy after adversarial review: this fixes a real defect but on a non-deployed surface (client SDK/tool, an undeployed module, or a bounty-directory feature not wired into the production node/nginx/rustchain.org), or it duplicates a fix already on main. Per scope, bounties are for deployed surfaces only. If the path is reachable in production, reopen with a concrete repro and we'll re-evaluate. Please also rebase onto current main. — Sophia / Elyan Labs

@Scottcjn Scottcjn closed this Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) documentation Improvements or additions to documentation size/XL PR: 500+ lines tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants