@nextage/era-lib 1.0.209 → 1.0.211
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/build/constants.d.ts +3 -3
- package/build/constants.d.ts.map +1 -1
- package/build/constants.js +3 -3
- package/build/constants.js.map +1 -1
- package/build/events/access-revoked-publisher.d.ts +1 -1
- package/build/events/access-revoked-publisher.js +1 -1
- package/build/events/base/base-event.controller.d.ts +35 -5
- package/build/events/base/base-event.controller.d.ts.map +1 -1
- package/build/events/base/base-event.controller.js +43 -6
- package/build/events/base/base-event.controller.js.map +1 -1
- package/build/events/base/base-msg-listener.d.ts +26 -0
- package/build/events/base/base-msg-listener.d.ts.map +1 -1
- package/build/events/base/base-msg-listener.js +53 -2
- package/build/events/base/base-msg-listener.js.map +1 -1
- package/build/events/base/base-nats-listener.d.ts +2 -2
- package/build/events/base/base-nats-listener.js +3 -3
- package/build/events/base/base-nats-listener.js.map +1 -1
- package/build/events/dlq-manager.js +3 -3
- package/build/events/event-relay.js +2 -2
- package/build/events/field-map.js +1 -1
- package/build/events/interfaces.d.ts +1 -1
- package/build/events/organization/interfaces.d.ts +3 -3
- package/build/events/organization/restored-event.d.ts +1 -1
- package/build/events/publisher-registry.js +1 -1
- package/build/events/revocation-denylist.js +2 -2
- package/build/events/revocation-listener.js +1 -1
- package/build/events/transport/base-client-wrapper.d.ts +1 -1
- package/build/events/transport/base-client-wrapper.js +1 -1
- package/build/events/transport/nats-client-manager.d.ts +1 -1
- package/build/events/transport/nats-client-manager.js +1 -1
- package/build/events/types/dlq.constants.js +1 -1
- package/build/events/types/dlq.constants.js.map +1 -1
- package/build/events/types/dlq.interfaces.js +1 -1
- package/build/events/types/dlq.interfaces.js.map +1 -1
- package/build/events/types/enums.d.ts +1 -1
- package/build/events/types/enums.js +3 -3
- package/build/events/types/enums.js.map +1 -1
- package/build/events/types/relay.constants.js +1 -1
- package/build/events/types/relay.constants.js.map +1 -1
- package/build/events/types/relay.interfaces.js +1 -1
- package/build/events/types/relay.interfaces.js.map +1 -1
- package/build/events/types/revocation.constants.js +1 -1
- package/build/events/types/revocation.constants.js.map +1 -1
- package/build/events/types/revocation.interfaces.js +1 -1
- package/build/events/types/revocation.interfaces.js.map +1 -1
- package/build/interfaces.d.ts +1 -1
- package/build/services/tenant-archive.d.ts +2 -2
- package/build/services/tenant-archive.js +2 -2
- package/build/types/app-config.d.ts +3 -3
- package/build/types/nx-context.d.ts +1 -1
- package/build/types/nx-context.js +1 -1
- package/build/utils/domain.d.ts +1 -1
- package/build/utils/domain.js +1 -1
- package/build/utils/env.constants.js +1 -1
- package/build/utils/env.constants.js.map +1 -1
- package/build/utils/express.d.ts +1 -1
- package/build/utils/express.js +2 -2
- package/build/utils/express.js.map +1 -1
- package/build/utils/functs.d.ts +2 -2
- package/build/utils/functs.js +6 -6
- package/build/utils/functs.js.map +1 -1
- package/build/utils/jwt.constants.d.ts +2 -2
- package/build/utils/jwt.constants.js +2 -2
- package/build/utils/jwt.js +3 -3
- package/build/utils/jwt.js.map +1 -1
- package/build/utils/tenancy.d.ts +4 -4
- package/build/utils/tenancy.js +5 -5
- package/build/utils/tenant.d.ts +6 -6
- package/build/utils/tenant.js +7 -7
- package/build/utils/tenant.js.map +1 -1
- package/package.json +2 -2
package/build/utils/jwt.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// │ • hashToken() → sha256 hex, stored on the `accesses` record so the │
|
|
11
11
|
// │ refresh can be rotated / revoked server-side. │
|
|
12
12
|
// │ │
|
|
13
|
-
// │ The ACCESS token is signed by nx-frame-be `generateJwt()`.
|
|
13
|
+
// │ The ACCESS token is signed by nx-frame-be `generateJwt()`. Since then it │
|
|
14
14
|
// │ uses ASYMMETRIC ES256 (auth-srv signs with the private key, every service │
|
|
15
15
|
// │ verifies with the public key). The REFRESH token below stays SYMMETRIC │
|
|
16
16
|
// │ (HS512): it never leaves auth-srv, so its algorithm is deliberately decoupled │
|
|
@@ -68,7 +68,7 @@ function refreshSecret(secret) {
|
|
|
68
68
|
* REFRESH token algorithm, parsed by `initConfig` (default `HS512` via
|
|
69
69
|
* `ENV_DEFAULTS`). Symmetric and DECOUPLED from the ACCESS token's
|
|
70
70
|
* `JWT_ALGORITHM`: the refresh never leaves auth-srv, so it keeps a symmetric
|
|
71
|
-
* secret even after the access token moves to ES256
|
|
71
|
+
* secret even after the access token moves to ES256. Override with
|
|
72
72
|
* `REFRESH_ALGORITHM` (must stay symmetric — the refresh secret is a string).
|
|
73
73
|
*/
|
|
74
74
|
function refreshAlgorithm() {
|
|
@@ -133,7 +133,7 @@ function verifyTokenHash(token, hash) {
|
|
|
133
133
|
const b = Buffer.from(hash);
|
|
134
134
|
return a.length === b.length && node_crypto_1.default.timingSafeEqual(a, b);
|
|
135
135
|
}
|
|
136
|
-
// ── ACCESS token key resolution (asymmetric ES256
|
|
136
|
+
// ── ACCESS token key resolution (asymmetric ES256) ───────────────────────────────
|
|
137
137
|
/**
|
|
138
138
|
* True when the ACCESS token algorithm uses an asymmetric key pair (private key
|
|
139
139
|
* to sign, public key to verify): the `ES`, `RS`, `PS` families and `EdDSA`.
|
package/build/utils/jwt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.js","sourceRoot":"","sources":["../../src/utils/jwt.ts"],"names":[],"mappings":";AAAA,iFAAiF;AACjF,mFAAmF;AACnF,mFAAmF;AACnF,mFAAmF;AACnF,mFAAmF;AACnF,mFAAmF;AACnF,mFAAmF;AACnF,mFAAmF;AACnF,oFAAoF;AACpF,oFAAoF;AACpF,mFAAmF;AACnF,
|
|
1
|
+
{"version":3,"file":"jwt.js","sourceRoot":"","sources":["../../src/utils/jwt.ts"],"names":[],"mappings":";AAAA,iFAAiF;AACjF,mFAAmF;AACnF,mFAAmF;AACnF,mFAAmF;AACnF,mFAAmF;AACnF,mFAAmF;AACnF,mFAAmF;AACnF,mFAAmF;AACnF,oFAAoF;AACpF,oFAAoF;AACpF,mFAAmF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C/D,CAAC;AAED,oFAAoF;AAEpF;;;;GAIG;AACH,SAAS,qBAAqB,CAAC,GAAW;IAExC,OAAO,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,uBAAO,CAAC,KAAK,CAAC;AAChE,CAAC;AAED;;;;GAIG;AACH,SAAS,UAAU,CAAC,KAAc;IAEhC,IAAI,CAAC,KAAK;QACR,OAAO,SAAS,CAAC;IAEnB,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC/G,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,gBAAgB;IAE9B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,wCAAwB,CAAC;IAElE,OAAO,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;AACvG,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,qBAAqB;IAEnC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,wCAAwB,CAAC;IAElE,OAAO,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;AACtG,CAAC"}
|
package/build/utils/tenancy.d.ts
CHANGED
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
* restated, because two implementations of one rule eventually disagree and any *
|
|
11
11
|
* disagreement is a leak. *
|
|
12
12
|
* *
|
|
13
|
-
* WHY THE SCOPING IS NOW OPT-OUT
|
|
13
|
+
* WHY THE SCOPING IS NOW OPT-OUT *
|
|
14
14
|
* *
|
|
15
15
|
* It used to be opt-IN: a model owning a `tenantId` was isolated only for as long as its *
|
|
16
16
|
* author remembered to override five hooks, one class at a time. That is 45 methods saying *
|
|
17
17
|
* the same thing across nine models, and the failure mode is silence - the collection *
|
|
18
|
-
* simply answers every tenant. It went wrong three times:
|
|
19
|
-
* filters
|
|
20
|
-
* body is empty
|
|
18
|
+
* simply answers every tenant. It went wrong three times: a read by id escaping the *
|
|
19
|
+
* filters, a delete with no tenancy filter at all, and `controlAttribute`, whose *
|
|
20
|
+
* body is empty. The same shape turned up once more, on the two hooks nobody had even *
|
|
21
21
|
* counted among the five: the subscription ones. *
|
|
22
22
|
* *
|
|
23
23
|
* Registering this provider inverts the default. A model with the field is scoped unless *
|
package/build/utils/tenancy.js
CHANGED
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
* restated, because two implementations of one rule eventually disagree and any *
|
|
12
12
|
* disagreement is a leak. *
|
|
13
13
|
* *
|
|
14
|
-
* WHY THE SCOPING IS NOW OPT-OUT
|
|
14
|
+
* WHY THE SCOPING IS NOW OPT-OUT *
|
|
15
15
|
* *
|
|
16
16
|
* It used to be opt-IN: a model owning a `tenantId` was isolated only for as long as its *
|
|
17
17
|
* author remembered to override five hooks, one class at a time. That is 45 methods saying *
|
|
18
18
|
* the same thing across nine models, and the failure mode is silence - the collection *
|
|
19
|
-
* simply answers every tenant. It went wrong three times:
|
|
20
|
-
* filters
|
|
21
|
-
* body is empty
|
|
19
|
+
* simply answers every tenant. It went wrong three times: a read by id escaping the *
|
|
20
|
+
* filters, a delete with no tenancy filter at all, and `controlAttribute`, whose *
|
|
21
|
+
* body is empty. The same shape turned up once more, on the two hooks nobody had even *
|
|
22
22
|
* counted among the five: the subscription ones. *
|
|
23
23
|
* *
|
|
24
24
|
* Registering this provider inverts the default. A model with the field is scoped unless *
|
|
@@ -73,7 +73,7 @@ exports.eraTenancy = {
|
|
|
73
73
|
* caller's own tenant - a silent downgrade would let a client discover the rule by
|
|
74
74
|
* watching where its documents end up.
|
|
75
75
|
*
|
|
76
|
-
* Anything else in the payload is ignored outright,
|
|
76
|
+
* Anything else in the payload is ignored outright, and that is the invariant: the
|
|
77
77
|
* owner comes from the request context and never from the body.
|
|
78
78
|
*
|
|
79
79
|
* ### What happens when nothing is asked, on a mixed collection
|
package/build/utils/tenant.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { ExistenceCheckModel, ScopedReadModel } from './tenant.interfaces';
|
|
|
16
16
|
* The selection NEVER comes from the payload: it travels out of band (`X-Org-Id`
|
|
17
17
|
* header, or `orgId` in the WebSocket connection params) and lands on
|
|
18
18
|
* `NxContext.orgId`. Reading it from the body would let a client name any tenant
|
|
19
|
-
* simply by adding a field to a mutation input
|
|
19
|
+
* simply by adding a field to a mutation input.
|
|
20
20
|
*
|
|
21
21
|
* Resolution order (ADR-0005 section 5.1) - the first match wins:
|
|
22
22
|
*
|
|
@@ -54,7 +54,7 @@ export declare function resolveTenant(user?: BaseUser, orgId?: string): string;
|
|
|
54
54
|
* defect D2 of ADR-0005 section 5.1, a fail-open by default.
|
|
55
55
|
*
|
|
56
56
|
* IMPORTANT: **What it is FOR, since 2026-08-13.** Scoping is no longer its job: `BaseModel`
|
|
57
|
-
* applies the tenant on its own (opt-out
|
|
57
|
+
* applies the tenant on its own (opt-out), so this is not what keeps a query
|
|
58
58
|
* inside its organization anymore. The four remaining callers use it for a different
|
|
59
59
|
* reason - they need the resolved tenant as a VALUE, to then load
|
|
60
60
|
* `organization.get(params.tenantId)` or to pick the right items while composing a
|
|
@@ -84,11 +84,11 @@ export declare function getTenant(user?: BaseUser): string;
|
|
|
84
84
|
* tenant scoping is **opt-out**: `BaseModel.beforeRemove` refuses an out-of-scope `_id`
|
|
85
85
|
* on its own, so the nine `beforeRemove` overrides that called this helper are gone
|
|
86
86
|
* (OPS-10) and it has **no production caller left**. Do NOT reach for it in new code -
|
|
87
|
-
* a second copy of the rule is exactly what
|
|
87
|
+
* a second copy of the rule is exactly what the opt-out design removed. It stays exported,
|
|
88
88
|
* and covered by its test, because the framework keeps its old behaviour whenever no
|
|
89
89
|
* tenancy provider is registered: a consumer in that state still needs this.
|
|
90
90
|
*
|
|
91
|
-
* Fills
|
|
91
|
+
* Fills a gap in the framework: `BaseModel.remove(id)` calls `beforeRemove` and then
|
|
92
92
|
* `findByIdAndDelete(id)`, applying neither `updateFilters` nor any `tenantId`
|
|
93
93
|
* constraint - and `bulkRemove(ids)` is nothing but `ids.map(remove)`. Without this
|
|
94
94
|
* check any user deletes documents belonging to OTHER organizations, knowing only
|
|
@@ -103,7 +103,7 @@ export declare function getTenant(user?: BaseUser): string;
|
|
|
103
103
|
* **Fail-closed**: a missing or out-of-scope `id` raises an error, without telling
|
|
104
104
|
* the two cases apart (the existence of someone else's document is never confirmed).
|
|
105
105
|
* That muteness was lost when the guard moved into the framework, which at first
|
|
106
|
-
* refused only EXISTING documents - an enumeration oracle,
|
|
106
|
+
* refused only EXISTING documents - an enumeration oracle, since
|
|
107
107
|
* repaired in nx-frame-be 1.0.47.
|
|
108
108
|
*
|
|
109
109
|
* @param model the model the removal happens on (`this` inside the hook)
|
|
@@ -114,7 +114,7 @@ export declare function getTenant(user?: BaseUser): string;
|
|
|
114
114
|
*/
|
|
115
115
|
export declare function assertTenantScope(model: ScopedReadModel, id: string, context?: NxContext): Promise<string>;
|
|
116
116
|
/**
|
|
117
|
-
* Answers whether the organization NAMED by a request actually exists
|
|
117
|
+
* Answers whether the organization NAMED by a request actually exists.
|
|
118
118
|
*
|
|
119
119
|
* {@link resolveTenant} answers one question - "may this user REACH the
|
|
120
120
|
* selection" - and for a cross-tenant role the answer is "any of them", so it
|
package/build/utils/tenant.js
CHANGED
|
@@ -25,7 +25,7 @@ const scope_1 = require("./scope");
|
|
|
25
25
|
* The selection NEVER comes from the payload: it travels out of band (`X-Org-Id`
|
|
26
26
|
* header, or `orgId` in the WebSocket connection params) and lands on
|
|
27
27
|
* `NxContext.orgId`. Reading it from the body would let a client name any tenant
|
|
28
|
-
* simply by adding a field to a mutation input
|
|
28
|
+
* simply by adding a field to a mutation input.
|
|
29
29
|
*
|
|
30
30
|
* Resolution order (ADR-0005 section 5.1) - the first match wins:
|
|
31
31
|
*
|
|
@@ -62,7 +62,7 @@ function resolveTenant(user, orgId) {
|
|
|
62
62
|
return orgId;
|
|
63
63
|
// `messages.forbidden` was defined by NO dictionary, so the client - which
|
|
64
64
|
// falls back to the message when `extensions.i18n` is absent - showed the raw
|
|
65
|
-
// key to the user
|
|
65
|
+
// key to the user. This refusal is an access denial, and reads as one.
|
|
66
66
|
if (!reachable.includes(orgId))
|
|
67
67
|
throw new nx_frame_be_1.AppError('messages.authorization.accessDenied');
|
|
68
68
|
return orgId;
|
|
@@ -76,7 +76,7 @@ function resolveTenant(user, orgId) {
|
|
|
76
76
|
* defect D2 of ADR-0005 section 5.1, a fail-open by default.
|
|
77
77
|
*
|
|
78
78
|
* IMPORTANT: **What it is FOR, since 2026-08-13.** Scoping is no longer its job: `BaseModel`
|
|
79
|
-
* applies the tenant on its own (opt-out
|
|
79
|
+
* applies the tenant on its own (opt-out), so this is not what keeps a query
|
|
80
80
|
* inside its organization anymore. The four remaining callers use it for a different
|
|
81
81
|
* reason - they need the resolved tenant as a VALUE, to then load
|
|
82
82
|
* `organization.get(params.tenantId)` or to pick the right items while composing a
|
|
@@ -112,11 +112,11 @@ function getTenant(user) {
|
|
|
112
112
|
* tenant scoping is **opt-out**: `BaseModel.beforeRemove` refuses an out-of-scope `_id`
|
|
113
113
|
* on its own, so the nine `beforeRemove` overrides that called this helper are gone
|
|
114
114
|
* (OPS-10) and it has **no production caller left**. Do NOT reach for it in new code -
|
|
115
|
-
* a second copy of the rule is exactly what
|
|
115
|
+
* a second copy of the rule is exactly what the opt-out design removed. It stays exported,
|
|
116
116
|
* and covered by its test, because the framework keeps its old behaviour whenever no
|
|
117
117
|
* tenancy provider is registered: a consumer in that state still needs this.
|
|
118
118
|
*
|
|
119
|
-
* Fills
|
|
119
|
+
* Fills a gap in the framework: `BaseModel.remove(id)` calls `beforeRemove` and then
|
|
120
120
|
* `findByIdAndDelete(id)`, applying neither `updateFilters` nor any `tenantId`
|
|
121
121
|
* constraint - and `bulkRemove(ids)` is nothing but `ids.map(remove)`. Without this
|
|
122
122
|
* check any user deletes documents belonging to OTHER organizations, knowing only
|
|
@@ -131,7 +131,7 @@ function getTenant(user) {
|
|
|
131
131
|
* **Fail-closed**: a missing or out-of-scope `id` raises an error, without telling
|
|
132
132
|
* the two cases apart (the existence of someone else's document is never confirmed).
|
|
133
133
|
* That muteness was lost when the guard moved into the framework, which at first
|
|
134
|
-
* refused only EXISTING documents - an enumeration oracle,
|
|
134
|
+
* refused only EXISTING documents - an enumeration oracle, since
|
|
135
135
|
* repaired in nx-frame-be 1.0.47.
|
|
136
136
|
*
|
|
137
137
|
* @param model the model the removal happens on (`this` inside the hook)
|
|
@@ -146,7 +146,7 @@ async function assertTenantScope(model, id, context = {}) {
|
|
|
146
146
|
return id;
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
|
-
* Answers whether the organization NAMED by a request actually exists
|
|
149
|
+
* Answers whether the organization NAMED by a request actually exists.
|
|
150
150
|
*
|
|
151
151
|
* {@link resolveTenant} answers one question - "may this user REACH the
|
|
152
152
|
* selection" - and for a cross-tenant role the answer is "any of them", so it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenant.js","sourceRoot":"","sources":["../../src/utils/tenant.ts"],"names":[],"mappings":";AAAA;;;;;;;;;+FAS+F;;AA0C/F,sCAkBC;AAqBD,8BAGC;AAaD,8BAMC;AAqCD,8CAMC;AAqDD,8CASC;AAkBD,0DAIC;AApOD,sDAA+E;AAC/E,oFAA6G;AAE7G,mCAAkE;AAGlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,SAAgB,aAAa,CAAC,IAAe,EAAE,KAAc;I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
|
6
6
|
"files": [
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"ws": "^8.18.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@nextage/nx-frame-be": "^1.0.
|
|
55
|
+
"@nextage/nx-frame-be": "^1.0.52",
|
|
56
56
|
"del-cli": "^6.0.0",
|
|
57
57
|
"mongodb-memory-server": "^10.1.4",
|
|
58
58
|
"vitest": "^4.1.10"
|