Mining/pkg/node
snider c2ff474386 feat: Add API authentication and comprehensive code review fixes
Security:
- Add HTTP Basic/Digest authentication middleware (enable via MINING_API_AUTH env)
- Fix WebSocket origin check with proper URL parsing
- Add max limit (10000) to remote log lines request
- Improve CLI args validation with stricter patterns

Networking:
- Fix WebSocket double-close with sync.Once in PeerConnection
- Add 10s dial timeout for WebSocket connections
- Reset write deadline after failed sends
- Fix handler race in Transport.OnMessage with RWMutex
- Make EventHub.Stop() idempotent, buffer channels to prevent goroutine leaks

Code Simplification:
- Extract AtomicWriteFile helper to reduce duplication across 4 files
- Remove redundant MinerTypeRegistry, use MinerFactory instead
- Register simulated miner in MinerFactory
- Remove dead portToString() code from manager.go

Documentation:
- Add Advanced API Authentication section to FUTURE_IDEAS.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 14:07:26 +00:00
..
bundle.go refactor: Remove unused code and fix nil dereference issues 2025-12-31 09:24:12 +00:00
bundle_test.go feat: Add multi-node P2P mining management system 2025-12-29 19:49:33 +00:00
controller.go refactor: Add reliability fixes and architecture improvements 2025-12-31 12:43:46 +00:00
identity.go refactor: Remove unused code and fix nil dereference issues 2025-12-31 09:24:12 +00:00
identity_test.go fix: Add NewNodeManagerWithPaths for testing isolation 2025-12-31 03:25:43 +00:00
message.go refactor: Add reliability fixes and architecture improvements 2025-12-31 12:43:46 +00:00
message_test.go refactor: Add reliability fixes and architecture improvements 2025-12-31 12:43:46 +00:00
peer.go refactor: Replace log.Printf with structured logging 2025-12-31 11:48:45 +00:00
peer_test.go refactor: Remove unused code and fix nil dereference issues 2025-12-31 09:24:12 +00:00
protocol.go refactor: Add reliability fixes and architecture improvements 2025-12-31 12:43:46 +00:00
protocol_test.go refactor: Add reliability fixes and architecture improvements 2025-12-31 12:43:46 +00:00
transport.go feat: Add API authentication and comprehensive code review fixes 2025-12-31 14:07:26 +00:00
worker.go refactor: Add reliability fixes and architecture improvements 2025-12-31 12:43:46 +00:00
worker_test.go refactor: Add reliability fixes and architecture improvements 2025-12-31 12:43:46 +00:00