@telperion/nest-pack 1.2.0 → 1.4.1

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.
@@ -1,4 +1,5 @@
1
- import { Type, CanActivate } from '@nestjs/common';
1
+ import { InjectionToken, Type, CanActivate, ExecutionContext } from '@nestjs/common';
2
+ import { Reflector } from '@nestjs/core';
2
3
  import { JwtVerifyOptions } from '@nestjs/jwt';
3
4
 
4
5
  /**
@@ -8,9 +9,29 @@ interface JwtAuthGuardRequest {
8
9
  headers: Record<string, string | string[] | undefined>;
9
10
  }
10
11
  /**
11
- * Options of {@link createJwtAuthGuard}
12
+ * Verifies tokens for a {@link createJwtAuthGuard} in place of the `JwtService` of `@nestjs/jwt`,
13
+ * e.g. with `jwtVerify` and a JWKS of `jose`. Provide it under the token given as `verifier`.
12
14
  */
13
- interface JwtAuthGuardOptions<Request extends object = JwtAuthGuardRequest> {
15
+ interface JwtAuthGuardVerifier<Payload extends object = object, Request extends object = JwtAuthGuardRequest> {
16
+ /**
17
+ * The payload of a valid token; throws (or rejects) for an invalid or expired one
18
+ *
19
+ * @param token The token `extract` read
20
+ * @param request The HTTP request the token came with
21
+ */
22
+ verify(token: string, request: Request): Payload | Promise<Payload>;
23
+ }
24
+ /**
25
+ * How a {@link createJwtAuthGuard} treats routes marked with `public()`:
26
+ *
27
+ * - `'skip'`: the token is not read, the route has no user
28
+ * - `'optional'`: a valid token gives the route its user; a missing, invalid or expired token passes as anonymous
29
+ */
30
+ type JwtAuthGuardPublicRoutes = 'skip' | 'optional';
31
+ /**
32
+ * The options of {@link createJwtAuthGuard} besides the verification
33
+ */
34
+ interface JwtAuthGuardBaseOptions<Request extends object = JwtAuthGuardRequest> {
14
35
  /**
15
36
  * The message of the 401 answer for an expired token, so clients can renew the token and retry
16
37
  * (e.g. `ApiAuth.expired` of `@telperion/ng-pack/http`)
@@ -31,9 +52,17 @@ interface JwtAuthGuardOptions<Request extends object = JwtAuthGuardRequest> {
31
52
  */
32
53
  extract?: (request: Request) => string | null | undefined;
33
54
  /**
34
- * Options of `JwtService.verifyAsync`, e.g. the `audience`, `issuer` or a `secret` other than the `JwtModule`'s
55
+ * Whether a verification error means an expired token, which answers `expiredMessage`
56
+ *
57
+ * @default recognizes the errors of jsonwebtoken (`@nestjs/jwt`, `name === 'TokenExpiredError'`) and jose (`code === 'ERR_JWT_EXPIRED'`)
35
58
  */
36
- verifyOptions?: JwtVerifyOptions;
59
+ isExpired?: (error: unknown) => boolean;
60
+ /**
61
+ * How routes marked with `public()` treat tokens, see {@link JwtAuthGuardPublicRoutes}
62
+ *
63
+ * @default 'skip'
64
+ */
65
+ publicRoutes?: JwtAuthGuardPublicRoutes;
37
66
  /**
38
67
  * The request property the verified payload is written to
39
68
  *
@@ -41,22 +70,59 @@ interface JwtAuthGuardOptions<Request extends object = JwtAuthGuardRequest> {
41
70
  */
42
71
  property?: string;
43
72
  }
73
+ /**
74
+ * Verification with the `JwtService` of `@nestjs/jwt`
75
+ */
76
+ interface JwtAuthGuardJwtServiceOptions {
77
+ verifier?: undefined;
78
+ /**
79
+ * Options of `JwtService.verifyAsync`, e.g. the `audience`, `issuer` or a `secret` other than the `JwtModule`'s
80
+ */
81
+ verifyOptions?: JwtVerifyOptions;
82
+ }
83
+ /**
84
+ * Verification with a verifier of its own
85
+ */
86
+ interface JwtAuthGuardCustomVerifierOptions {
87
+ /**
88
+ * The injection token of a {@link JwtAuthGuardVerifier}, e.g. one verifying with a JWKS. With it, the guard does not use `@nestjs/jwt`.
89
+ */
90
+ verifier: InjectionToken;
91
+ /**
92
+ * Only for the `JwtService`; pass these options to the verifier itself
93
+ */
94
+ verifyOptions?: never;
95
+ }
96
+ /**
97
+ * Options of {@link createJwtAuthGuard}: the `JwtService` of `@nestjs/jwt` verifies the tokens, or the `verifier`
98
+ */
99
+ type JwtAuthGuardOptions<Request extends object = JwtAuthGuardRequest> = JwtAuthGuardBaseOptions<Request> & (JwtAuthGuardJwtServiceOptions | JwtAuthGuardCustomVerifierOptions);
44
100
  /**
45
101
  * The guard class {@link createJwtAuthGuard} returns, with its decorators
46
102
  */
47
103
  interface JwtAuthGuardType<Payload extends object> extends Type<CanActivate> {
48
104
  /**
49
- * Route or controller decorator: the route needs no token. A method's setting replaces its controller's.
105
+ * Route or controller decorator: the route needs no token (see `publicRoutes` for reading one anyway).
106
+ * A method's setting replaces its controller's.
50
107
  */
51
108
  public(): MethodDecorator & ClassDecorator;
52
109
  /**
53
- * Parameter decorator: the verified token payload, `undefined` on public routes
110
+ * Whether the route of a context is marked with `public()`, for other guards and interceptors that skip public
111
+ * routes (throttling, auditing, resolving the user, …). A method's setting replaces its controller's.
112
+ *
113
+ * @param context The context of the route, e.g. of `canActivate` or `intercept`
114
+ * @param reflector Reads the markers; a `Reflector` of its own by default
115
+ */
116
+ isPublic(context: ExecutionContext, reflector?: Reflector): boolean;
117
+ /**
118
+ * Parameter decorator: the verified token payload; on public routes `undefined`, or with `publicRoutes: 'optional'`
119
+ * the payload of a valid token
54
120
  */
55
121
  user(...pipes: unknown[]): ParameterDecorator;
56
122
  /**
57
- * The verified payload of a request, `undefined` before the guard ran or on public routes
123
+ * The verified payload of a request, `undefined` before the guard ran or on public routes without a valid token
58
124
  */
59
125
  userOf(request: object): Payload | undefined;
60
126
  }
61
127
 
62
- export type { JwtAuthGuardOptions, JwtAuthGuardRequest, JwtAuthGuardType };
128
+ export type { JwtAuthGuardBaseOptions, JwtAuthGuardCustomVerifierOptions, JwtAuthGuardJwtServiceOptions, JwtAuthGuardOptions, JwtAuthGuardPublicRoutes, JwtAuthGuardRequest, JwtAuthGuardType, JwtAuthGuardVerifier };
@@ -1,16 +1,17 @@
1
1
  import { __decorate, __metadata } from 'tslib';
2
- import { createParamDecorator, applyDecorators, SetMetadata, UseGuards, NotFoundException, ForbiddenException, Injectable, Inject } from '@nestjs/common';
2
+ import { createParamDecorator, applyDecorators, SetMetadata, UseGuards, ForbiddenException, NotFoundException, Injectable, Inject } from '@nestjs/common';
3
3
  import { Reflector } from '@nestjs/core';
4
4
 
5
5
  /**
6
6
  * #### Create Access Guard
7
7
  *
8
8
  * Creates a guard for routes about one entity, e.g. a project in `/projects/:projectId/...`.
9
- * The guard resolves the caller's access to the entity in a route parameter (or a body field or query parameter, see `from`)
10
- * and checks the route's requirements:
9
+ * The guard resolves the caller's access to the entity in a route parameter (or a body field or query parameter, see `from`;
10
+ * or a fixed or computed `id`) and checks the route's requirements:
11
11
  *
12
- * - missing or malformed parameter (see `validate`), or no access (`resolve` gives `null`/`undefined`): **404**,
13
- * so callers can't probe which ids exist
12
+ * - missing or malformed id (see `validate`): **404**
13
+ * - no access (`resolve` gives `null`/`undefined`): **404**, so callers can't probe which ids exist
14
+ * (or **403** with `noAccess: 'forbidden'`)
14
15
  * - access that does not meet every requirement of the route (see `allows`): **403**
15
16
  * - otherwise the request passes, and the resolved access is kept on the request for `@Guard.access()`
16
17
  *
@@ -44,15 +45,21 @@ import { Reflector } from '@nestjs/core';
44
45
  * To give the guard a class name of its own (in stack traces, or to inject it), extend it:
45
46
  * `@Injectable() export class ProjectAccessGuard extends createAccessGuard({ ... }) {}`.
46
47
  * * * *
47
- * @param options Which parameter to read, how to resolve the access, and how to check a requirement
48
+ * @param options Which parameter to read (or the `id`), how to resolve the access, and how to check a requirement
48
49
  * @returns An injectable guard class with `require()`, `access()` and `accessOf()`
50
+ * @throws When neither or both of `param` and `id` are given
49
51
  */
50
52
  function createAccessGuard(options) {
51
53
  var AccessGuard_1;
52
- const { param, from = 'params', validate = () => true, inject = [], resolve, allows, notFound = 'Not Found', forbidden = 'Forbidden' } = options;
54
+ const { param, from = 'params', id, validate = () => true, inject = [], resolve, allows, notFound = 'Not Found', forbidden = 'Forbidden', noAccess = 'not-found', } = options;
55
+ if ((param === undefined) === (id === undefined)) {
56
+ throw new Error('createAccessGuard: give exactly one of `param` (a request parameter) and `id` (a fixed or computed id)');
57
+ }
53
58
  const sources = typeof from === 'string' ? [from] : from;
54
- const requirementsKey = Symbol(`access-guard:${param}:requirements`);
55
- const accessKey = Symbol(`access-guard:${param}:access`);
59
+ /** Names the id in metadata keys and errors */
60
+ const label = param !== undefined ? `:${param}` : typeof id === 'string' ? id : 'the computed id';
61
+ const requirementsKey = Symbol(`access-guard:${label}:requirements`);
62
+ const accessKey = Symbol(`access-guard:${label}:access`);
56
63
  let AccessGuard = class AccessGuard {
57
64
  static { AccessGuard_1 = this; }
58
65
  static access = createParamDecorator((_data, context) => AccessGuard_1.accessOf(context.switchToHttp().getRequest()) ?? AccessGuard_1.notGuarded());
@@ -73,25 +80,31 @@ function createAccessGuard(options) {
73
80
  return request[accessKey];
74
81
  }
75
82
  /**
76
- * The parameter in the first source holding a string value
83
+ * The fixed or computed `id`, or else the parameter in the first source holding a string value
77
84
  */
78
85
  static idOf(request) {
79
- return sources
80
- .map(source => request[source])
81
- .map(holder => (typeof holder === 'object' && holder !== null ? holder[param] : undefined))
82
- .find((value) => typeof value === 'string');
86
+ return typeof id === 'function'
87
+ ? id(request)
88
+ : (id ??
89
+ sources
90
+ .map(source => request[source])
91
+ .map(holder => (typeof holder === 'object' && holder !== null ? holder[param] : undefined))
92
+ .find((value) => typeof value === 'string'));
93
+ }
94
+ /** The answer when `resolve` finds no access */
95
+ static noAccess() {
96
+ throw noAccess === 'forbidden' ? new ForbiddenException(forbidden) : new NotFoundException(notFound);
83
97
  }
84
98
  static notGuarded() {
85
- throw new Error(`The access of :${param} is read on a route without its access guard; add \`.require()\` to the route or controller`);
99
+ throw new Error(`The access of ${label} is read on a route without its access guard; add \`.require()\` to the route or controller`);
86
100
  }
87
101
  canActivate(context) {
88
102
  const request = context.switchToHttp().getRequest();
89
103
  const value = AccessGuard_1.idOf(request);
90
104
  const required = this.reflector.getAllAndOverride(requirementsKey, [context.getHandler(), context.getClass()]) ?? [];
91
- return Promise.resolve(typeof value === 'string' && validate(value) ? resolve(value, request, ...this.dependencies) : null).then(access => {
92
- if (access === null || access === undefined) {
93
- throw new NotFoundException(notFound);
94
- }
105
+ return (typeof value === 'string' && validate(value)
106
+ ? Promise.resolve(resolve(value, request, ...this.dependencies)).then(access => access ?? AccessGuard_1.noAccess())
107
+ : Promise.reject(new NotFoundException(notFound))).then(access => {
95
108
  if (!required.every(requirement => allows(access, requirement))) {
96
109
  throw new ForbiddenException(forbidden);
97
110
  }
@@ -1 +1 @@
1
- {"version":3,"file":"nest-pack.mjs","sources":["../../../../libs/nest-pack/src/access/create-access-guard.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CG;AACG,SAAU,iBAAiB,CAK/B,OAAiE,EAAA;;AACjE,IAAA,MAAM,EAAE,KAAK,EAAE,IAAI,GAAG,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI,EAAE,MAAM,GAAG,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAG,WAAW,EAAE,SAAS,GAAG,WAAW,EAAE,GAAG,OAAO;AAChJ,IAAA,MAAM,OAAO,GAAiC,OAAO,IAAI,KAAK,QAAQ,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI;IACtF,MAAM,eAAe,GAAG,MAAM,CAAC,gBAAgB,KAAK,CAAA,aAAA,CAAe,CAAC;IACpE,MAAM,SAAS,GAAG,MAAM,CAAC,gBAAgB,KAAK,CAAA,OAAA,CAAS,CAAC;IAExD,IACM,WAAW,GADjB,MACM,WAAW,CAAA;;AACf,QAAA,OAAgB,MAAM,GAAG,oBAAoB,CAC3C,CAAC,KAAc,EAAE,OAAyB,KACxC,aAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAU,CAAC,IAAI,aAAW,CAAC,UAAU,EAAE,CAChG;AAEgB,QAAA,SAAS;AACT,QAAA,YAAY;AAE7B;;AAEG;AACH,QAAA,WAAA,CAAY,GAAG,QAAmC,EAAA;YAChD,MAAM,CAAC,SAAS,EAAE,GAAG,YAAY,CAA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CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,IAAI,aAAW,CAAC,QAAQ,EAAE;AAChH,kBAAE,OAAO,CAAC,MAAM,CAAC,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAAC,EACnD,IAAI,CAAC,MAAM,IAAG;AACd,gBAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,EAAE;AAC/D,oBAAA,MAAM,IAAI,kBAAkB,CAAC,SAAS,CAAC;gBACzC;AAEA,gBAAA,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,GAAG,MAAM,EAAE,CAAC;AAE/C,gBAAA,OAAO,IAAI;AACb,YAAA,CAAC,CAAC;QACJ;;IAnEI,WAAW,GAAA,aAAA,GAAA,UAAA,CAAA;AADhB,QAAA,UAAU,EAAE;;AACP,KAAA,EAAA,WAAW,CAoEhB;IAED,CAAC,SAAS,EAAE,GAAG,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;AAE9F,IAAA,OAAO,WAAW;AACpB;;;;"}
package/index.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- export { AccessGuardOptions, AccessGuardRequest, AccessGuardSource, AccessGuardType, InjectedDependencies } from './access/access-guard-options.cjs';
1
+ export { AccessGuardBaseOptions, AccessGuardIdOptions, AccessGuardNoAccess, AccessGuardOptions, AccessGuardParamOptions, AccessGuardRequest, AccessGuardSource, AccessGuardType, InjectedDependencies } from './access/access-guard-options.cjs';
2
2
  export { createAccessGuard } from './access/create-access-guard.cjs';
3
3
  import '@nestjs/common';
package/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { AccessGuardOptions, AccessGuardRequest, AccessGuardSource, AccessGuardType, InjectedDependencies } from './access/access-guard-options.js';
1
+ export { AccessGuardBaseOptions, AccessGuardIdOptions, AccessGuardNoAccess, AccessGuardOptions, AccessGuardParamOptions, AccessGuardRequest, AccessGuardSource, AccessGuardType, InjectedDependencies } from './access/access-guard-options.js';
2
2
  export { createAccessGuard } from './access/create-access-guard.js';
3
3
  import '@nestjs/common';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telperion/nest-pack",
3
- "version": "1.2.0",
3
+ "version": "1.4.1",
4
4
  "description": "NestJS utilities: JWT auth and access guards, validation helpers and pagination",
5
5
  "keywords": [
6
6
  "nestjs",