Skip to content

Sundayjob#430

Open
sundayjob996 wants to merge 4 commits into
AnnabelJoe:mainfrom
sundayjob996:sundayjob
Open

Sundayjob#430
sundayjob996 wants to merge 4 commits into
AnnabelJoe:mainfrom
sundayjob996:sundayjob

Conversation

@sundayjob996
Copy link
Copy Markdown

@sundayjob996 sundayjob996 commented Jun 1, 2026

This PR introduces several improvements to governance, security, API consistency, and test coverage:

Changes Included
Added comprehensive unit tests for the Ed25519 signature verification utility to validate signature handling, edge cases, and failure scenarios.
Implemented quorum and threshold validation logic in community_governance to ensure proposals meet the required participation and approval criteria before execution.
Introduced API versioning with a /v1 route prefix to provide a stable foundation for future API evolution while maintaining backward compatibility.
Added supporting updates and refactoring where necessary to improve maintainability and reliability.
Benefits
Increased confidence in cryptographic signature verification through automated testing.
Strengthened governance decision-making by enforcing quorum and approval thresholds.
Established a scalable API versioning strategy for future releases.
Improved overall code quality and system reliability.
closes #276
closes #321
closes #300
closes #283

jhayniffy added 4 commits June 1, 2026 13:33
…edge-case tests

- initialize() now stores the passed quorum param instead of hardcoded default
- set_quorum_bps / set_threshold_bps now verify caller == stored admin
- Added tests: initialize configures quorum, zero quorum rejected, exactly-at-quorum
  passes, one-below-quorum expires, admin update paths, non-admin rejection
- Export verifyReadingSignature() from crypto.ts (wraps @noble/ed25519 verifyAsync,
  never throws — returns false on malformed input)
- Tests cover: valid sig, invalid sig, tampered payload, wrong key,
  malformed sig bytes, malformed pubkey, hash determinism, hash sensitivity
…ersion header

- middleware: change unversioned redirect from 308 to 301 (Moved Permanently)
- middleware: inject API-Version: v1 header on all /api/* responses
- openapi.yaml: document /api/v1/ canonical paths, legacy 301 redirect paths,
  API-Version response header component, and versioning policy in description
- ci.yml: add image-scan job (runs after web job)
  - builds Docker image from apps/web/Dockerfile
  - scans with aquasecurity/trivy-action@0.28.0
  - exit-code 1 blocks image promotion on CRITICAL CVEs
  - uploads SARIF as CI artifact (30-day retention)
  - uploads SARIF to GitHub Security tab
- Dockerfile: add comment guiding digest pinning procedure
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@sundayjob996 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants