@zeltjs/auth-jwt 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/dist/index.js +47 -14
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @zeltjs/auth-jwt
|
|
2
|
+
|
|
3
|
+
[](https://zeltjs.com)
|
|
4
|
+
|
|
5
|
+
JWT authentication middleware for Zelt applications.
|
|
6
|
+
|
|
7
|
+
**[Read the Documentation](https://zeltjs.com)**
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @zeltjs/auth-jwt @zeltjs/core
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { createApp, Controller, Get, inject } from '@zeltjs/core';
|
|
19
|
+
import { JwtConfig, JwtMiddleware, JwtService } from '@zeltjs/auth-jwt';
|
|
20
|
+
|
|
21
|
+
@Controller('/protected')
|
|
22
|
+
class ProtectedController {
|
|
23
|
+
constructor(private jwt = inject(JwtService)) {}
|
|
24
|
+
|
|
25
|
+
@Get('/')
|
|
26
|
+
secret() {
|
|
27
|
+
return { message: 'Secret data' };
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const app = createApp({
|
|
32
|
+
http: {
|
|
33
|
+
controllers: [ProtectedController],
|
|
34
|
+
middlewares: [JwtMiddleware],
|
|
35
|
+
},
|
|
36
|
+
configs: [JwtConfig],
|
|
37
|
+
});
|
|
38
|
+
```
|
package/dist/index.js
CHANGED
|
@@ -22,11 +22,16 @@ const UnauthorizedException = defineHttpException("UnauthorizedException", 401,
|
|
|
22
22
|
}) });
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/jwt.config.ts
|
|
25
|
-
|
|
25
|
+
function _ts_decorate$2(decorators, target, key, desc) {
|
|
26
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
27
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
28
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
29
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
30
|
+
}
|
|
31
|
+
var JwtConfig = class {
|
|
26
32
|
/**
|
|
27
33
|
* @throws {ZeltJwtConfigError} When JWT_SECRET is not set
|
|
28
|
-
*/
|
|
29
|
-
get secret() {
|
|
34
|
+
*/ get secret() {
|
|
30
35
|
const secret = process.env["JWT_SECRET"];
|
|
31
36
|
if (!secret) throw new ZeltJwtConfigError({ reason: "missing_secret" });
|
|
32
37
|
return secret;
|
|
@@ -47,12 +52,19 @@ var JwtConfig = @Config class {
|
|
|
47
52
|
});
|
|
48
53
|
}
|
|
49
54
|
};
|
|
55
|
+
JwtConfig = _ts_decorate$2([Config], JwtConfig);
|
|
50
56
|
//#endregion
|
|
51
57
|
//#region src/jwt.service.ts
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
function _ts_decorate$1(decorators, target, key, desc) {
|
|
59
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
60
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
61
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
62
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
63
|
+
}
|
|
64
|
+
function _ts_metadata$1(k, v) {
|
|
65
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
66
|
+
}
|
|
67
|
+
var JwtService = class {
|
|
56
68
|
async sign(payload) {
|
|
57
69
|
const secret = new TextEncoder().encode(this.config.secret);
|
|
58
70
|
const expiresIn = this.parseExpiresIn(this.config.expiresIn);
|
|
@@ -79,19 +91,31 @@ var JwtService = @Injectable() class {
|
|
|
79
91
|
}[match[2] ?? ""]}`;
|
|
80
92
|
return expiresIn;
|
|
81
93
|
}
|
|
94
|
+
constructor(config = inject(JwtConfig)) {
|
|
95
|
+
this.config = config;
|
|
96
|
+
}
|
|
82
97
|
};
|
|
98
|
+
JwtService = _ts_decorate$1([
|
|
99
|
+
Injectable(),
|
|
100
|
+
_ts_metadata$1("design:type", Function),
|
|
101
|
+
_ts_metadata$1("design:paramtypes", [void 0])
|
|
102
|
+
], JwtService);
|
|
83
103
|
//#endregion
|
|
84
104
|
//#region src/jwt.middleware.ts
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
105
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
106
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
107
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
108
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
109
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
110
|
+
}
|
|
111
|
+
function _ts_metadata(k, v) {
|
|
112
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
113
|
+
}
|
|
114
|
+
var JwtMiddleware = class {
|
|
90
115
|
/**
|
|
91
116
|
* @throws {UnauthorizedException} When token is missing (401)
|
|
92
117
|
* @throws {UnauthorizedException} When token is invalid or expired (401)
|
|
93
|
-
*/
|
|
94
|
-
async use(c, next) {
|
|
118
|
+
*/ async use(c, next) {
|
|
95
119
|
const token = this.extractToken(c);
|
|
96
120
|
if (!token) throw new UnauthorizedException({ reason: "missing_token" });
|
|
97
121
|
const verified = await this.jwtService.verify(token).then((payload) => ({
|
|
@@ -109,7 +133,16 @@ var JwtMiddleware = @Middleware class {
|
|
|
109
133
|
if (!authHeader?.startsWith("Bearer ")) return null;
|
|
110
134
|
return authHeader.slice(7);
|
|
111
135
|
}
|
|
136
|
+
constructor(jwtService = inject(JwtService), config = inject(JwtConfig)) {
|
|
137
|
+
this.jwtService = jwtService;
|
|
138
|
+
this.config = config;
|
|
139
|
+
}
|
|
112
140
|
};
|
|
141
|
+
JwtMiddleware = _ts_decorate([
|
|
142
|
+
Middleware,
|
|
143
|
+
_ts_metadata("design:type", Function),
|
|
144
|
+
_ts_metadata("design:paramtypes", [void 0, void 0])
|
|
145
|
+
], JwtMiddleware);
|
|
113
146
|
//#endregion
|
|
114
147
|
export { JwtConfig, JwtMiddleware, JwtService, UnauthorizedException, ZeltJwtConfigError };
|
|
115
148
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["messages"],"sources":["../src/errors.ts","../src/exceptions.ts","../src/jwt.config.ts","../src/jwt.service.ts","../src/jwt.middleware.ts"],"sourcesContent":["import { defineError } from '@zeltjs/core/internal-bridge/errors';\n\nexport type JwtConfigErrorReason = 'missing_secret';\n\nconst messages: Record<JwtConfigErrorReason, string> = {\n missing_secret: 'JWT_SECRET environment variable is required',\n};\n\nexport const ZeltJwtConfigError = defineError(\n 'ZeltJwtConfigError',\n (ctx: { reason: JwtConfigErrorReason }) => messages[ctx.reason],\n);\n","import { defineHttpException } from '@zeltjs/core';\n\nexport type UnauthorizedReason = 'missing_token' | 'invalid_token' | 'expired';\n\nconst messages: Record<UnauthorizedReason, string> = {\n missing_token: 'Authorization token is required',\n invalid_token: 'Invalid authorization token',\n expired: 'Authorization token has expired',\n};\n\nexport const UnauthorizedException = defineHttpException(\n 'UnauthorizedException',\n 401,\n (ctx: { reason: UnauthorizedReason }) => messages[ctx.reason],\n {\n buildResponse: (ctx, status, message) =>\n Response.json(\n { code: 'UNAUTHORIZED', reason: ctx.reason, message },\n { status, headers: { 'WWW-Authenticate': 'Bearer' } },\n ),\n },\n);\n","import type { RequestContextSchema } from '@zeltjs/core';\nimport { Config } from '@zeltjs/core';\n\nimport { ZeltJwtConfigError } from './errors';\nimport type { JwtDriver, JwtPayload } from './jwt.types';\n\nexport interface ResolveUserResult {\n user: RequestContextSchema['user'];\n roles: RequestContextSchema['authRoles'];\n}\n\n@Config\nexport class JwtConfig {\n /**\n * @throws {ZeltJwtConfigError} When JWT_SECRET is not set\n */\n get secret(): string {\n const secret = process.env['JWT_SECRET'];\n if (!secret) {\n throw new ZeltJwtConfigError({ reason: 'missing_secret' });\n }\n return secret;\n }\n\n get expiresIn(): string {\n return '1h';\n }\n\n get driver(): JwtDriver {\n return 'header';\n }\n\n get cookieName(): string {\n return 'jwt';\n }\n\n get resolveUser(): (payload: JwtPayload) => Promise<ResolveUserResult> {\n return async (payload) => ({\n user: payload.sub,\n roles: [],\n });\n }\n}\n","import { Injectable, inject } from '@zeltjs/core';\nimport { decodeJwt, jwtVerify, SignJWT } from 'jose';\n\nimport { JwtConfig } from './jwt.config';\nimport type { JwtPayload } from './jwt.types';\n\n@Injectable()\nexport class JwtService {\n constructor(private config = inject(JwtConfig)) {}\n\n async sign(payload: Record<string, unknown>): Promise<string> {\n const secret = new TextEncoder().encode(this.config.secret);\n const expiresIn = this.parseExpiresIn(this.config.expiresIn);\n\n const jwt = await new SignJWT(payload)\n .setProtectedHeader({ alg: 'HS256' })\n .setIssuedAt()\n .setExpirationTime(expiresIn)\n .sign(secret);\n\n return jwt;\n }\n\n async verify(token: string): Promise<JwtPayload> {\n const secret = new TextEncoder().encode(this.config.secret);\n const { payload } = await jwtVerify<JwtPayload>(token, secret);\n return payload;\n }\n\n decode(token: string): JwtPayload | null {\n try {\n return decodeJwt<JwtPayload>(token);\n } catch {\n return null;\n }\n }\n\n private parseExpiresIn(expiresIn: string): string | number {\n const match = /^(\\d+)([smhd])$/.exec(expiresIn);\n if (match) {\n const value = parseInt(match[1] ?? '0', 10);\n const unit = match[2] ?? '';\n const unitMap: Record<string, string> = {\n s: 'seconds',\n m: 'minutes',\n h: 'hours',\n d: 'days',\n };\n return `${value} ${unitMap[unit]}`;\n }\n return expiresIn;\n }\n}\n","import type { Next, RequestContext } from '@zeltjs/core';\nimport { inject, Middleware, setUser } from '@zeltjs/core';\nimport { getCookie } from 'hono/cookie';\n\nimport { UnauthorizedException } from './exceptions';\nimport { JwtConfig } from './jwt.config';\nimport { JwtService } from './jwt.service';\n\n@Middleware\nexport class JwtMiddleware {\n constructor(\n private readonly jwtService = inject(JwtService),\n private readonly config = inject(JwtConfig),\n ) {}\n\n /**\n * @throws {UnauthorizedException} When token is missing (401)\n * @throws {UnauthorizedException} When token is invalid or expired (401)\n */\n async use(c: RequestContext, next: Next): Promise<Response | undefined> {\n const token = this.extractToken(c);\n\n if (!token) {\n throw new UnauthorizedException({ reason: 'missing_token' });\n }\n\n const verified = await this.jwtService.verify(token).then(\n (payload) => ({ ok: true as const, payload }),\n () => ({ ok: false as const }),\n );\n\n if (!verified.ok) {\n throw new UnauthorizedException({ reason: 'invalid_token' });\n }\n\n const { user, roles } = await this.config.resolveUser(verified.payload);\n setUser(user, roles);\n await next();\n return undefined;\n }\n\n private extractToken(c: RequestContext): string | null {\n if (this.config.driver === 'cookie') {\n return getCookie(c, this.config.cookieName) ?? null;\n }\n\n const authHeader = c.req.header('Authorization');\n if (!authHeader?.startsWith('Bearer ')) {\n return null;\n }\n return authHeader.slice(7);\n }\n}\n"],"mappings":";;;;;AAIA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["defineError","messages","missing_secret","ZeltJwtConfigError","ctx","reason","defineHttpException","messages","missing_token","invalid_token","expired","UnauthorizedException","ctx","reason","buildResponse","status","message","Response","json","code","headers","Config","ZeltJwtConfigError","JwtConfig","secret","process","env","reason","expiresIn","driver","cookieName","resolveUser","payload","user","sub","roles","Injectable","inject","decodeJwt","jwtVerify","SignJWT","JwtConfig","JwtService","sign","payload","secret","TextEncoder","encode","config","expiresIn","parseExpiresIn","jwt","setProtectedHeader","alg","setIssuedAt","setExpirationTime","verify","token","decode","match","exec","value","parseInt","unit","unitMap","s","m","h","d","inject","Middleware","setUser","getCookie","UnauthorizedException","JwtConfig","JwtService","JwtMiddleware","use","c","next","token","extractToken","reason","verified","jwtService","verify","then","payload","ok","user","roles","config","resolveUser","undefined","driver","cookieName","authHeader","req","header","startsWith","slice"],"sources":["../src/errors.ts","../src/exceptions.ts","../src/jwt.config.ts","../src/jwt.service.ts","../src/jwt.middleware.ts"],"sourcesContent":["import { defineError } from '@zeltjs/core/internal-bridge/errors';\n\nexport type JwtConfigErrorReason = 'missing_secret';\n\nconst messages: Record<JwtConfigErrorReason, string> = {\n missing_secret: 'JWT_SECRET environment variable is required',\n};\n\nexport const ZeltJwtConfigError = defineError(\n 'ZeltJwtConfigError',\n (ctx: { reason: JwtConfigErrorReason }) => messages[ctx.reason],\n);\n","import { defineHttpException } from '@zeltjs/core';\n\nexport type UnauthorizedReason = 'missing_token' | 'invalid_token' | 'expired';\n\nconst messages: Record<UnauthorizedReason, string> = {\n missing_token: 'Authorization token is required',\n invalid_token: 'Invalid authorization token',\n expired: 'Authorization token has expired',\n};\n\nexport const UnauthorizedException = defineHttpException(\n 'UnauthorizedException',\n 401,\n (ctx: { reason: UnauthorizedReason }) => messages[ctx.reason],\n {\n buildResponse: (ctx, status, message) =>\n Response.json(\n { code: 'UNAUTHORIZED', reason: ctx.reason, message },\n { status, headers: { 'WWW-Authenticate': 'Bearer' } },\n ),\n },\n);\n","import type { RequestContextSchema } from '@zeltjs/core';\nimport { Config } from '@zeltjs/core';\n\nimport { ZeltJwtConfigError } from './errors';\nimport type { JwtDriver, JwtPayload } from './jwt.types';\n\nexport interface ResolveUserResult {\n user: RequestContextSchema['user'];\n roles: RequestContextSchema['authRoles'];\n}\n\n@Config\nexport class JwtConfig {\n /**\n * @throws {ZeltJwtConfigError} When JWT_SECRET is not set\n */\n get secret(): string {\n const secret = process.env['JWT_SECRET'];\n if (!secret) {\n throw new ZeltJwtConfigError({ reason: 'missing_secret' });\n }\n return secret;\n }\n\n get expiresIn(): string {\n return '1h';\n }\n\n get driver(): JwtDriver {\n return 'header';\n }\n\n get cookieName(): string {\n return 'jwt';\n }\n\n get resolveUser(): (payload: JwtPayload) => Promise<ResolveUserResult> {\n return async (payload) => ({\n user: payload.sub,\n roles: [],\n });\n }\n}\n","import { Injectable, inject } from '@zeltjs/core';\nimport { decodeJwt, jwtVerify, SignJWT } from 'jose';\n\nimport { JwtConfig } from './jwt.config';\nimport type { JwtPayload } from './jwt.types';\n\n@Injectable()\nexport class JwtService {\n constructor(private config = inject(JwtConfig)) {}\n\n async sign(payload: Record<string, unknown>): Promise<string> {\n const secret = new TextEncoder().encode(this.config.secret);\n const expiresIn = this.parseExpiresIn(this.config.expiresIn);\n\n const jwt = await new SignJWT(payload)\n .setProtectedHeader({ alg: 'HS256' })\n .setIssuedAt()\n .setExpirationTime(expiresIn)\n .sign(secret);\n\n return jwt;\n }\n\n async verify(token: string): Promise<JwtPayload> {\n const secret = new TextEncoder().encode(this.config.secret);\n const { payload } = await jwtVerify<JwtPayload>(token, secret);\n return payload;\n }\n\n decode(token: string): JwtPayload | null {\n try {\n return decodeJwt<JwtPayload>(token);\n } catch {\n return null;\n }\n }\n\n private parseExpiresIn(expiresIn: string): string | number {\n const match = /^(\\d+)([smhd])$/.exec(expiresIn);\n if (match) {\n const value = parseInt(match[1] ?? '0', 10);\n const unit = match[2] ?? '';\n const unitMap: Record<string, string> = {\n s: 'seconds',\n m: 'minutes',\n h: 'hours',\n d: 'days',\n };\n return `${value} ${unitMap[unit]}`;\n }\n return expiresIn;\n }\n}\n","import type { Next, RequestContext } from '@zeltjs/core';\nimport { inject, Middleware, setUser } from '@zeltjs/core';\nimport { getCookie } from 'hono/cookie';\n\nimport { UnauthorizedException } from './exceptions';\nimport { JwtConfig } from './jwt.config';\nimport { JwtService } from './jwt.service';\n\n@Middleware\nexport class JwtMiddleware {\n constructor(\n private readonly jwtService = inject(JwtService),\n private readonly config = inject(JwtConfig),\n ) {}\n\n /**\n * @throws {UnauthorizedException} When token is missing (401)\n * @throws {UnauthorizedException} When token is invalid or expired (401)\n */\n async use(c: RequestContext, next: Next): Promise<Response | undefined> {\n const token = this.extractToken(c);\n\n if (!token) {\n throw new UnauthorizedException({ reason: 'missing_token' });\n }\n\n const verified = await this.jwtService.verify(token).then(\n (payload) => ({ ok: true as const, payload }),\n () => ({ ok: false as const }),\n );\n\n if (!verified.ok) {\n throw new UnauthorizedException({ reason: 'invalid_token' });\n }\n\n const { user, roles } = await this.config.resolveUser(verified.payload);\n setUser(user, roles);\n await next();\n return undefined;\n }\n\n private extractToken(c: RequestContext): string | null {\n if (this.config.driver === 'cookie') {\n return getCookie(c, this.config.cookieName) ?? null;\n }\n\n const authHeader = c.req.header('Authorization');\n if (!authHeader?.startsWith('Bearer ')) {\n return null;\n }\n return authHeader.slice(7);\n }\n}\n"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeltjs/auth-jwt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"hono": "^4.0.0",
|
|
25
|
-
"@zeltjs/core": "0.
|
|
25
|
+
"@zeltjs/core": "0.5.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"jose": "6.0.11"
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "22.19.17",
|
|
32
32
|
"hono": "4.12.16",
|
|
33
|
-
"@zeltjs/core": "0.
|
|
34
|
-
"@zeltjs/testing": "0.
|
|
33
|
+
"@zeltjs/core": "0.5.0",
|
|
34
|
+
"@zeltjs/testing": "0.5.0"
|
|
35
35
|
},
|
|
36
36
|
"volta": {
|
|
37
37
|
"extends": "../../package.json"
|