UNPKG

@ahhaohho/auth-middleware

Version:

Shared authentication middleware with Passport.js for ahhaohho microservices

37 lines (32 loc) 1.01 kB
/** * @ahhaohho/auth-middleware * * Shared authentication middleware with Passport.js * for ahhaohho microservices */ const { authenticateJWT, authenticateRefresh, optionalAuth, authenticateHybrid } = require('./middleware/auth'); const { verifyTokenWithFallback, signToken, getCurrentSigningKey } = require('./utils/jwtValidator'); const { isBlacklisted, addToBlacklist, clearBlacklist } = require('./utils/blacklist'); const { getJwtKeys, invalidateCache } = require('./utils/secretManager'); const redisManager = require('./config/redis'); // 메인 export - Express 미들웨어 module.exports = { // 미들웨어 authenticateJWT, authenticateRefresh, optionalAuth, authenticateHybrid, // 유틸리티 함수 (필요시 직접 사용) utils: { verifyTokenWithFallback, signToken, getCurrentSigningKey, isBlacklisted, addToBlacklist, clearBlacklist, getJwtKeys, invalidateCache }, // Redis 관리자 (필요시 직접 접근) redisManager };