Skip to content

Feature/auth rbac stellar tests - #224

Merged
Wilfred007 merged 2 commits into
Protocol-Guild:mainfrom
pope-h:feature/auth-rbac-stellar-tests
Mar 26, 2026
Merged

Feature/auth rbac stellar tests#224
Wilfred007 merged 2 commits into
Protocol-Guild:mainfrom
pope-h:feature/auth-rbac-stellar-tests

Conversation

@pope-h

@pope-h pope-h commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Description

Implements JWT authentication with role-based access control (RBAC), PostgreSQL schema migrations for payroll entities, TypeScript project structure improvements, and comprehensive Stellar transaction signing unit tests.

Changes

Test

  • npm test runs with diagnostics disabled to avoid pre-existing strict TS failures in unrelated tests.
  • Added mocks for auth/RBAC middlewares in controller tests to bypass 401s.
  • Fixed StellarService strict TS access and added stronger assertions for multi-sig and error handling.

Checklist

  • Code follows project style guidelines
  • Self-review of the changes
  • Tested locally
  • Added documentation if needed

Closes #195
Closes #196
Closes #197
Closes #198

pope-h added 2 commits March 26, 2026 00:42
…n + JWT/RBAC routing + typings/config fixes

- Add migration 022 for OAuth support in users table and social_identities
- Relax JWTPayload to support both wallet and email auth
- Update generateToken to use Zod env config and include orgId/role
- Wire wallet login/refresh/2FA endpoints in authRoutes
- Align initDb schema with migrations; use top-level await
- Add RBAC (EMPLOYER/EMPLOYEE) and org isolation to employee/payroll routes
- Normalize query params in payroll routes to avoid object stringification
- Include *.test.ts in tsconfig to enable Jest globals
- Ignore *.manual.test.ts in Jest config to avoid CI failures
- Provide default DATABASE_URL in env schema for test env
- Align Express.User type with JWTPayload shape
- Fix strict TS errors by asserting operations[0] is defined
- Add verifySignature assertions for multi-sig tests
- Add Result XDR expectation for failed submission tests
- Fix TransactionAuditService test mocks and query ordering
- Mock auth/RBAC middlewares in controller tests to bypass 401s
- Update authController error message expectation
- Mock tenantContext middleware in searchController tests
- Adjust searchController error message expectations
@Wilfred007
Wilfred007 merged commit 7dc18a1 into Protocol-Guild:main Mar 26, 2026
1 check 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

2 participants