How timjam/passport-fast-jwt works
Passport-Fast-JWT is a small Passport strategy adapter: it extracts a request token, verifies it with fast-jwt, then delegates application-specific identity resolution to a callback that reports success, failure, or error through Passport. The extractor options and callback behavior are documented in the README; source confirms the strategy’s dispatch and helper calls. Application lookup is consumer-owned, not implemented in this repository.
Main entry points: strategy.ts JwtStrategy · extractors.ts Extractors · parseAuthHeader.ts Auth parser · isDefined.ts Defined filter
Components 10
JWT strategy
- JwtStrategy
src/strategy.ts
Token extraction
- Extractors
src/extractors.ts - Auth parser
src/helpers/parseAuthHeader.ts - Defined filter
src/helpers/isDefined.ts
Public API
- Exports
src/index.ts
Other components
- Passport application
- fast-jwt
- Identity callback
- Passport
- HTTP request
Connections 11
- Passport application → Exports: imports
- Passport application → JwtStrategy: configures
- Passport application → Extractors: selects extractor
- HTTP request → JwtStrategy: authenticates
- JwtStrategy → Extractors: extracts token
- Extractors → Auth parser: parses scheme
- Extractors → Defined filter: filters tokens
- JwtStrategy → fast-jwt: creates verifier / verifies token
- JwtStrategy → Identity callback: passes verified sections
- Identity callback → Passport: reports outcome
- JwtStrategy → Passport: dispatches success, fail, error