Skip to content

fix(security): validate JWT issuer & audience claims per environment (#101) - #216

Merged
dzekojohn4 merged 2 commits into
NovaCoreLabs1:mainfrom
peaceshallom37-rgb:fix/101-jwt-issuer-audience
Jul 30, 2026
Merged

fix(security): validate JWT issuer & audience claims per environment (#101)#216
dzekojohn4 merged 2 commits into
NovaCoreLabs1:mainfrom
peaceshallom37-rgb:fix/101-jwt-issuer-audience

Conversation

@peaceshallom37-rgb

Copy link
Copy Markdown
Contributor

Summary

Validates JWT issuer and audience claims per environment to prevent cross-environment token replay attacks.

Changes

  • jwt.strategy.ts: env-driven JWT_ISSUER / JWT_AUDIENCE validation in Passport strategy
  • jwt-helper.ts: issuer and audience added to all JWT sign() calls, hubId added to access token payload
  • user.interface.ts: hubId field added to JwtPayload interface

Acceptance Criteria

  • Cross-environment token rejected
  • Issuer/audience validated from env vars with sensible defaults

Closes #101

…ovaCoreLabs1#101)

- Add env-driven JWT_ISSUER / JWT_AUDIENCE validation in JwtStrategy
- Add issuer and audience to all JWT sign() calls in JwtHelper
- Add hubId to JwtPayload interface for multi-tenant support

Closes NovaCoreLabs1#101
@dzekojohn4
dzekojohn4 merged commit 39bd47a into NovaCoreLabs1:main Jul 30, 2026
6 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.

Validate JWT issuer & audience claims per environment

2 participants