Skip to content

fix: replace all any request types with typed AuthRequest interface#30

Open
karanjadavi wants to merge 2 commits into
OrbitChainLabs:mainfrom
karanjadavi:fix/type-safety-auth-request
Open

fix: replace all any request types with typed AuthRequest interface#30
karanjadavi wants to merge 2 commits into
OrbitChainLabs:mainfrom
karanjadavi:fix/type-safety-auth-request

Conversation

@karanjadavi

Copy link
Copy Markdown
  • Add shared JwtUser and AuthRequest interfaces in src/common/types/auth-request.interface.ts
  • Update JwtStrategy.validate() to return typed JwtUser with sub field
  • Replace @request() req: any across users, admin, milestones, campaigns controllers
  • Replace @Req() req: Request & { user: any } in donations, notifications, api-keys controllers
  • Add AuthenticatedSocket interface in notifications.gateway.ts to remove (client as any) casts
  • Replace as any casts in users.service.ts with Prisma.InputJsonValue and typed assertions
  • Replace as any casts in campaigns.service.ts with Number(), Prisma.EnumCampaignStatusFilter, and type guard
  • Fix soroban.service.ts XDR response casts and scValResult double-cast via unknown
  • Fix email.service.ts (info as any).message with narrowed type
  • Enable @typescript-eslint/no-explicit-any: error in eslint.config.mjs to prevent regressions

Closes #17

- Add shared JwtUser and AuthRequest interfaces in src/common/types/auth-request.interface.ts
- Update JwtStrategy.validate() to return typed JwtUser with sub field
- Replace @request() req: any across users, admin, milestones, campaigns controllers
- Replace @Req() req: Request & { user: any } in donations, notifications, api-keys controllers
- Add AuthenticatedSocket interface in notifications.gateway.ts to remove (client as any) casts
- Replace as any casts in users.service.ts with Prisma.InputJsonValue and typed assertions
- Replace as any casts in campaigns.service.ts with Number(), Prisma.EnumCampaignStatusFilter, and type guard
- Fix soroban.service.ts XDR response casts and scValResult double-cast via unknown
- Fix email.service.ts (info as any).message with narrowed type
- Enable @typescript-eslint/no-explicit-any: error in eslint.config.mjs to prevent regressions

Closes OrbitChainLabs#17
@Alqku

Alqku commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

@karanjadavi please fix the CI.

Alqku commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Direction is good — typed AuthRequest is a real improvement. Heads up: CI is red on lint/build, so flipping @typescript-eslint/no-explicit-any to error surfaces a few leftover anys in src/auth, src/stellar, etc. that this PR didn\u2019t catch. Can you tighten those up and re-run? Happy to merge once CI is green.

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.

[LOW] — Widespread @Request() req: any, @Req() req: Request & { user: any }, and as any patterns defeat type safety across ~30 call sites

2 participants