@stratum-hq/nestjs 1.0.0 → 1.2.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 +9 -2
- package/dist/stratum.guard.d.ts.map +1 -1
- package/dist/stratum.guard.js +33 -31
- package/dist/stratum.guard.js.map +1 -1
- package/dist/stratum.interceptor.d.ts +1 -1
- package/dist/stratum.interceptor.d.ts.map +1 -1
- package/dist/stratum.module.d.ts +8 -0
- package/dist/stratum.module.d.ts.map +1 -1
- package/dist/stratum.module.js.map +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -16,12 +16,19 @@ Peer dependencies: `@nestjs/common >= 10`, `@nestjs/core >= 10`, `reflect-metada
|
|
|
16
16
|
import { Module } from "@nestjs/common";
|
|
17
17
|
import { StratumModule } from "@stratum-hq/nestjs";
|
|
18
18
|
|
|
19
|
+
// Without jwtSecret, the guard does not verify tokens and reads the tenant
|
|
20
|
+
// from the X-Tenant-ID header, which any client can send.
|
|
21
|
+
const jwtSecret = process.env.JWT_SECRET;
|
|
22
|
+
if (!jwtSecret) {
|
|
23
|
+
throw new Error("JWT_SECRET is required to verify bearer tokens.");
|
|
24
|
+
}
|
|
25
|
+
|
|
19
26
|
@Module({
|
|
20
27
|
imports: [
|
|
21
28
|
StratumModule.forRoot({
|
|
22
29
|
controlPlaneUrl: "http://localhost:3001",
|
|
23
30
|
apiKey: "sk_live_your_key",
|
|
24
|
-
jwtSecret
|
|
31
|
+
jwtSecret, // optional: enables JWT verification
|
|
25
32
|
jwtClaimPath: "tenant_id",
|
|
26
33
|
}),
|
|
27
34
|
],
|
|
@@ -48,7 +55,7 @@ export class DataController {
|
|
|
48
55
|
## API
|
|
49
56
|
|
|
50
57
|
- **`StratumModule.forRoot(options)` / `forRootAsync(options)`** — register the SDK client for DI. `forRootAsync` supports `useFactory` + `inject` for config that depends on other providers (e.g. `ConfigService`).
|
|
51
|
-
- **`StratumGuard`** — resolves the tenant from the `X-Tenant-ID` header,
|
|
58
|
+
- **`StratumGuard`** — resolves the tenant from a verified JWT claim, then the `X-Tenant-ID` header, then custom `resolvers`. When `jwtSecret` or `jwtVerify` is set, the guard reads the header only with `trustTenantHeader: true`, and it rejects a Bearer token that fails verification with 401. Sets `req.tenant` (full `TenantContext`), plus `req.impersonating` / `req.originalTenantId` when impersonation is enabled. Throws `UnauthorizedException` (401) if the request has no tenant ID, `NotFoundException` (404) if the tenant does not exist, `ForbiddenException` (403) if the tenant is suspended or access is denied, and `GoneException` (410) if the tenant is archived. A control plane timeout throws `GatewayTimeoutException` (504). A rejected SDK API key throws `InternalServerErrorException` (500) and writes the cause to `console.error`.
|
|
52
59
|
- **`@Tenant()`** — parameter decorator that extracts `req.tenant`.
|
|
53
60
|
- **`StratumContextInterceptor`** — binds the resolved context to AsyncLocalStorage so services can call `getTenantContext()` from `@stratum-hq/sdk` without the request object.
|
|
54
61
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stratum.guard.d.ts","sourceRoot":"","sources":["../src/stratum.guard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stratum.guard.d.ts","sourceRoot":"","sources":["../src/stratum.guard.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAuBhE,qBACa,YAAa,YAAW,WAAW;IAEpB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADR,MAAM,EAAE,aAAa,EACpB,OAAO,EAAE,oBAAoB;IAKnE,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;CAmE/D"}
|
package/dist/stratum.guard.js
CHANGED
|
@@ -10,57 +10,62 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
12
|
};
|
|
13
|
-
import { Inject, Injectable, UnauthorizedException, ForbiddenException } from "@nestjs/common";
|
|
14
|
-
import {
|
|
15
|
-
import { TenantNotFoundError } from "@stratum-hq/core";
|
|
13
|
+
import { Inject, Injectable, UnauthorizedException, ForbiddenException, GatewayTimeoutException, GoneException, HttpException, InternalServerErrorException, NotFoundException, } from "@nestjs/common";
|
|
14
|
+
import { assertJwtSupport, controlPlaneErrorResponse, resolveTenantId, tenantErrorResponse } from "@stratum-hq/sdk";
|
|
16
15
|
import { STRATUM_CLIENT, STRATUM_OPTIONS } from "./constants.js";
|
|
16
|
+
const EXCEPTIONS = {
|
|
17
|
+
403: ForbiddenException,
|
|
18
|
+
404: NotFoundException,
|
|
19
|
+
410: GoneException,
|
|
20
|
+
500: InternalServerErrorException,
|
|
21
|
+
504: GatewayTimeoutException,
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Convert a tenant resolution error into the HTTP exception for the status
|
|
25
|
+
* that the SDK's Express and Fastify middleware send for the same error.
|
|
26
|
+
* Other errors come back unchanged, so Nest answers them with a 500.
|
|
27
|
+
*/
|
|
28
|
+
function resolutionException(err, tenantId) {
|
|
29
|
+
const response = tenantErrorResponse(err, tenantId) ?? controlPlaneErrorResponse(err);
|
|
30
|
+
if (!response)
|
|
31
|
+
return err;
|
|
32
|
+
const Exception = EXCEPTIONS[response.status];
|
|
33
|
+
const message = response.body.error.message;
|
|
34
|
+
return Exception ? new Exception(message) : new HttpException(message, response.status);
|
|
35
|
+
}
|
|
17
36
|
let StratumGuard = class StratumGuard {
|
|
18
37
|
client;
|
|
19
38
|
options;
|
|
20
39
|
constructor(client, options) {
|
|
21
40
|
this.client = client;
|
|
22
41
|
this.options = options;
|
|
42
|
+
assertJwtSupport(options);
|
|
23
43
|
}
|
|
24
44
|
async canActivate(context) {
|
|
25
45
|
const req = context.switchToHttp().getRequest();
|
|
26
46
|
// 1. Resolve tenant ID: JWT (verified) → header → custom resolvers.
|
|
27
|
-
//
|
|
28
|
-
//
|
|
47
|
+
// When JWT verification is configured, a token that fails verification
|
|
48
|
+
// is rejected, and the header is only read if trustTenantHeader is set.
|
|
29
49
|
// Order mirrors express.ts.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
verify: this.options.jwtVerify,
|
|
34
|
-
});
|
|
35
|
-
if (!tenantId) {
|
|
36
|
-
tenantId = resolveFromHeader(req);
|
|
50
|
+
const resolution = await resolveTenantId(req, this.options);
|
|
51
|
+
if (resolution.status === "invalid_token") {
|
|
52
|
+
throw new UnauthorizedException("Bearer token could not be verified");
|
|
37
53
|
}
|
|
38
|
-
if (
|
|
39
|
-
for (const resolver of this.options.resolvers) {
|
|
40
|
-
const result = await resolver.resolve(req);
|
|
41
|
-
if (result) {
|
|
42
|
-
tenantId = result;
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
if (!tenantId) {
|
|
54
|
+
if (resolution.status === "missing") {
|
|
48
55
|
throw new UnauthorizedException("Tenant ID could not be resolved from request");
|
|
49
56
|
}
|
|
57
|
+
const tenantId = resolution.tenantId;
|
|
50
58
|
// 2. Resolve caller tenant context
|
|
51
59
|
let callerContext;
|
|
52
60
|
try {
|
|
53
61
|
callerContext = await this.client.resolveTenant(tenantId);
|
|
54
62
|
}
|
|
55
63
|
catch (err) {
|
|
56
|
-
|
|
57
|
-
throw new UnauthorizedException(`Tenant not found: ${tenantId}`);
|
|
58
|
-
}
|
|
59
|
-
throw err;
|
|
64
|
+
throw resolutionException(err, tenantId);
|
|
60
65
|
}
|
|
61
66
|
req["tenant"] = callerContext;
|
|
62
67
|
req["impersonating"] = false;
|
|
63
|
-
// 3. Impersonation support — mirrors express.ts
|
|
68
|
+
// 3. Impersonation support — mirrors express.ts
|
|
64
69
|
if (this.options.impersonation?.enabled) {
|
|
65
70
|
const impersonateHeader = this.options.impersonation.headerName ?? "X-Impersonate-Tenant";
|
|
66
71
|
const headers = req.headers;
|
|
@@ -76,10 +81,7 @@ let StratumGuard = class StratumGuard {
|
|
|
76
81
|
impersonatedContext = await this.client.resolveTenant(impersonateTenantId);
|
|
77
82
|
}
|
|
78
83
|
catch (err) {
|
|
79
|
-
|
|
80
|
-
throw new UnauthorizedException(`Impersonated tenant not found: ${impersonateTenantId}`);
|
|
81
|
-
}
|
|
82
|
-
throw err;
|
|
84
|
+
throw resolutionException(err, impersonateTenantId);
|
|
83
85
|
}
|
|
84
86
|
req["tenant"] = impersonatedContext;
|
|
85
87
|
req["impersonating"] = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stratum.guard.js","sourceRoot":"","sources":["../src/stratum.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"stratum.guard.js","sourceRoot":"","sources":["../src/stratum.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,aAAa,EACb,aAAa,EACb,4BAA4B,EAC5B,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACpH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjE,MAAM,UAAU,GAA2D;IACzE,GAAG,EAAE,kBAAkB;IACvB,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,aAAa;IAClB,GAAG,EAAE,4BAA4B;IACjC,GAAG,EAAE,uBAAuB;CAC7B,CAAC;AAEF;;;;GAIG;AACH,SAAS,mBAAmB,CAAC,GAAY,EAAE,QAAgB;IAC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AmB,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;gBACtD,CAAC;gBAED,GAAG,CAAC,QAAQ,CAAC,GAAG,mBAAmB,CAAC;gBACpC,GAAG,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC;gBAC5B,GAAG,CAAC,kBAAkB,CAAC,GAAG,QAAQ,CAAC;gBAEnC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,mBAAmB,CAAC,CAAC;gBAE/E,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AA3EY,YAAY;IADxB,UAAU,EAAE;IAGR,WAAA,MAAM,CAAC,cAAc,CAAC,CAAA;IACtB,WAAA,MAAM,CAAC,eAAe,CAAC,CAAA;;GAHf,YAAY,CA2ExB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NestInterceptor, ExecutionContext, CallHandler } from "@nestjs/common";
|
|
2
2
|
import { Observable } from "rxjs";
|
|
3
3
|
export declare class StratumContextInterceptor implements NestInterceptor {
|
|
4
|
-
intercept(context: ExecutionContext, next: CallHandler): Observable<
|
|
4
|
+
intercept(context: ExecutionContext, next: CallHandler): Observable<unknown>;
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=stratum.interceptor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stratum.interceptor.d.ts","sourceRoot":"","sources":["../src/stratum.interceptor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGlC,qBACa,yBAA0B,YAAW,eAAe;IAC/D,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"stratum.interceptor.d.ts","sourceRoot":"","sources":["../src/stratum.interceptor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGlC,qBACa,yBAA0B,YAAW,eAAe;IAC/D,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU,CAAC,OAAO,CAAC;CAU7E"}
|
package/dist/stratum.module.d.ts
CHANGED
|
@@ -9,6 +9,14 @@ export interface StratumModuleOptions {
|
|
|
9
9
|
jwtSecret?: string;
|
|
10
10
|
/** Custom JWT verify function — takes priority over jwtSecret. */
|
|
11
11
|
jwtVerify?: (token: string) => Record<string, unknown> | null;
|
|
12
|
+
/** Header to read the tenant ID from. When set, only this header is read (default: X-Tenant-ID). */
|
|
13
|
+
headerName?: string;
|
|
14
|
+
/**
|
|
15
|
+
* When jwtSecret or jwtVerify is configured, the tenant header is ignored
|
|
16
|
+
* unless this is true. A bearer token that fails verification is always
|
|
17
|
+
* rejected. Default: false.
|
|
18
|
+
*/
|
|
19
|
+
trustTenantHeader?: boolean;
|
|
12
20
|
/** Custom tenant resolvers evaluated after header and JWT resolution. */
|
|
13
21
|
resolvers?: import("@stratum-hq/sdk").TenantResolver[];
|
|
14
22
|
/** Enable tenant impersonation via X-Impersonate-Tenant header. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stratum.module.d.ts","sourceRoot":"","sources":["../src/stratum.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAOtE,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,uHAA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AoB,GAAG,aAAa;IAqB5D;;;OAGG;IACH,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,yBAAyB,GAAG,aAAa;CA0B5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stratum.module.js","sourceRoot":"","sources":["../src/stratum.module.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"stratum.module.js","sourceRoot":"","sources":["../src/stratum.module.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAqC9D,IAAM,aAAa,qBAAnB,MAAM,aAAa;IACxB;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,OAA6B;QAC1C,MAAM,cAAc,GAAG;YACrB,OAAO,EAAE,cAAc;YACvB,QAAQ,EAAE,IAAI,aAAa,CAAC;gBAC1B,eAAe,EAAE,OAAO,CAAC,eAAe;gBACxC,MAAM,EAAE,OAAO,CAAC,MAAM;aACvB,CAAC;SACH,C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AC,EAAE,CAAC;GACE,aAAa,CAuDzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stratum-hq/nestjs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Stratum NestJS integration — StratumGuard, @Tenant() decorator, and StratumModule",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"multi-tenancy",
|
|
@@ -43,19 +43,19 @@
|
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@nestjs/common": ">=10.0.0",
|
|
45
45
|
"@nestjs/core": ">=10.0.0",
|
|
46
|
-
"@stratum-hq/core": "
|
|
47
|
-
"@stratum-hq/sdk": "
|
|
46
|
+
"@stratum-hq/core": "^1.0.0",
|
|
47
|
+
"@stratum-hq/sdk": "^1.2.0",
|
|
48
48
|
"reflect-metadata": ">=0.1.13"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@nestjs/common": "^
|
|
52
|
-
"@nestjs/core": "^
|
|
53
|
-
"@nestjs/testing": "^
|
|
51
|
+
"@nestjs/common": "^12.1.2",
|
|
52
|
+
"@nestjs/core": "^12.1.2",
|
|
53
|
+
"@nestjs/testing": "^12.1.2",
|
|
54
54
|
"@stratum-hq/core": "*",
|
|
55
55
|
"@stratum-hq/sdk": "*",
|
|
56
|
-
"reflect-metadata": "^0.
|
|
56
|
+
"reflect-metadata": "^0.2.2",
|
|
57
57
|
"typescript": "^5.4.0",
|
|
58
|
-
"vitest": "^1.
|
|
58
|
+
"vitest": "^4.1.11"
|
|
59
59
|
},
|
|
60
60
|
"license": "MIT",
|
|
61
61
|
"author": "Christian Crank",
|