Skip to content

feat(openapi): declare admin auth and the real version - #399

Merged
Ashborne267 merged 3 commits into
StreamGive:mainfrom
Sensei-Victor:feat/openapi-security-scheme
Oct 27, 2026
Merged

Ashborne267 merged 3 commits into
StreamGive:mainfrom
Sensei-Victor:feat/openapi-security-scheme

Conversation

@Sensei-Victor

Copy link
Copy Markdown
Contributor

Closes #357

Summary of Changes

  • Read the OpenAPI document version dynamically from package.json at startup instead of hardcoding 1.0.0.
  • Added OpenAPI security schemes for the three admin headers under components.securitySchemes:
    • adminAddress (x-admin-address)
    • adminSignature (x-admin-signature)
    • adminTimestamp (x-admin-timestamp)
  • Declared the admin security requirement ([{ adminAddress: [], adminSignature: [], adminTimestamp: [] }]) on all admin endpoints (/ngo-applications/stats, /ngo-applications, /ngo-applications/:id, /ngo-applications/:id/approve, /ngo-applications/:id/reject, /ngos/all, and /admin/ngos/:id).
  • Added an onRoute hook check to ensure any route using requireAdminSignature automatically inherits the security scheme in OpenAPI documentation.
  • Ensured all routes across the API have explicit OpenAPI tags (Health, NGOs, Donors, Streams, Impact, NGO Applications, Indexer, Metrics).
  • Added comprehensive OpenAPI test suite in test/openapi.test.ts asserting spec version, security schemes, endpoint protections, and tags.

Testing Performed

  • npm run lint / npx eslint . — code conforms cleanly to project ESLint standards without warnings.
  • npm run typecheck — TypeScript check passed with 0 errors.
  • npm test — all test suites including unit, integration, and OpenAPI assertions passed cleanly.

@drips-wave

drips-wave Bot commented Oct 20, 2026

Copy link
Copy Markdown

@Sensei-Victor 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

@Ashborne267
Ashborne267 merged commit eae9f09 into StreamGive:main Oct 27, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Declare the admin security scheme and read the API version from package.json

2 participants