@aooth/arbac-moost 0.1.66 → 0.1.67
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,4 @@
|
|
|
1
|
-
import { r as AoothArbacClaims, t as ArbacUserProvider } from "../user.provider-
|
|
1
|
+
import { r as AoothArbacClaims, t as ArbacUserProvider } from "../user.provider-DDwcuUsU.mjs";
|
|
2
2
|
import { TAtscriptAnnotatedType, TAtscriptTypeObject, TMetadataMap, TValidatorOptions, Validator } from "@atscript/typescript/utils";
|
|
3
3
|
import { AoothUserCredentials } from "@aooth/user/atscript-db/model.as";
|
|
4
4
|
//#region src/atscript/auto-provider.d.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ArbacDbScope, c as enforceControlsPolicy, d as NavRelationKey, f as NavTarget, i as conjoinArbacDbScopes, l as extractUsedControlValues, m as ProjectionOf, n as ArbacUserProviderToken, o as AsArbacDbController, p as OwnFieldKey, r as AoothArbacClaims, s as applyAllowedFieldsAndSet, t as ArbacUserProvider, u as ControlsOf } from "./user.provider-
|
|
1
|
+
import { a as ArbacDbScope, c as enforceControlsPolicy, d as NavRelationKey, f as NavTarget, i as conjoinArbacDbScopes, l as extractUsedControlValues, m as ProjectionOf, n as ArbacUserProviderToken, o as AsArbacDbController, p as OwnFieldKey, r as AoothArbacClaims, s as applyAllowedFieldsAndSet, t as ArbacUserProvider, u as ControlsOf } from "./user.provider-DDwcuUsU.mjs";
|
|
2
2
|
import { Arbac, Arbac as Arbac$1, TArbacCompiledRule, TArbacEvalResult, TArbacRole, TArbacRoleForResource, TArbacRule, arbacPatternToRegex } from "@aooth/arbac-core";
|
|
3
3
|
import { TAuthGuardDef } from "@moostjs/event-http";
|
|
4
4
|
import { EventContext } from "@wooksjs/event-core";
|
|
@@ -129,11 +129,8 @@ declare class AsArbacDbReadableController<T extends TAtscriptAnnotatedType = TAt
|
|
|
129
129
|
*/
|
|
130
130
|
protected applyMetaOverlay(meta: TMetaResponse): Promise<TMetaResponse>;
|
|
131
131
|
/**
|
|
132
|
-
* Scope-aware field
|
|
133
|
-
* {@link AsArbacDbController.hasField}
|
|
134
|
-
* read-scope projection union answers `false`, so `validateInsights` rejects
|
|
135
|
-
* `$select` / filter / sort references to it with the identical
|
|
136
|
-
* `Unknown field "x"` 400 a nonexistent field gets.
|
|
132
|
+
* Scope-aware field visibility — same contract as
|
|
133
|
+
* {@link AsArbacDbController.hasField}.
|
|
137
134
|
*/
|
|
138
135
|
protected hasField(path: string): boolean;
|
|
139
136
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -717,9 +717,9 @@ let AsArbacDbController = class AsArbacDbController extends AsDbController {
|
|
|
717
717
|
* controls of a request. Runs after the base validator (which checks the
|
|
718
718
|
* controls DTO shape) and BEFORE the query/aggregation pipeline executes.
|
|
719
719
|
*
|
|
720
|
-
*
|
|
721
|
-
*
|
|
722
|
-
*
|
|
720
|
+
* Reads the scopes the route-level authorize interceptor cached via
|
|
721
|
+
* `arbac.setScopes(...)` — validation runs before `transformFilter`, so
|
|
722
|
+
* this hook never re-evaluates ARBAC.
|
|
723
723
|
*
|
|
724
724
|
* On a violation we throw `HttpError(403)`. moost-db's `query` / `pages` /
|
|
725
725
|
* `getOne` handlers do NOT wrap `validateParsed` in try/catch, so the
|
|
@@ -736,18 +736,12 @@ let AsArbacDbController = class AsArbacDbController extends AsDbController {
|
|
|
736
736
|
return applyArbacMetaOverlay(meta, metaAlwaysVisibleFields(this, this.readable));
|
|
737
737
|
}
|
|
738
738
|
/**
|
|
739
|
-
*
|
|
740
|
-
*
|
|
741
|
-
*
|
|
742
|
-
*
|
|
743
|
-
*
|
|
744
|
-
*
|
|
745
|
-
* as an existence/value oracle. Identifier fields stay visible (reads
|
|
746
|
-
* always return them — see {@link MetaVisibility.alwaysVisible}), and paths
|
|
747
|
-
* under a `with`-granted relation pass through to the sub-scope's own
|
|
748
|
-
* enforcement. Scopes were cached by the route-level authorize interceptor
|
|
749
|
-
* before validation runs (`useArbac` setScopes), so the union reflects the
|
|
750
|
-
* exact action being executed.
|
|
739
|
+
* Scope-aware field visibility (BUG-3 twin of the `/meta` pruning above): a
|
|
740
|
+
* field outside the read-scope projection union answers `false`, which
|
|
741
|
+
* moost-db's visibility hook turns into the same `Unknown field "x"` 400 a
|
|
742
|
+
* nonexistent field gets at every gated query position — see the docs'
|
|
743
|
+
* "Column-scope security floor". Identifiers stay visible; paths under a
|
|
744
|
+
* `with`-granted relation pass through to the sub-scope's own enforcement.
|
|
751
745
|
*/
|
|
752
746
|
hasField(path) {
|
|
753
747
|
return super.hasField(path) && isScopedFieldVisible(readCachedScopes(), path, metaAlwaysVisibleFields(this, this.readable));
|
|
@@ -932,11 +926,8 @@ let AsArbacDbReadableController = class AsArbacDbReadableController extends AsDb
|
|
|
932
926
|
return applyArbacMetaOverlay(meta, metaAlwaysVisibleFields(this, this.readable));
|
|
933
927
|
}
|
|
934
928
|
/**
|
|
935
|
-
* Scope-aware field
|
|
936
|
-
* {@link AsArbacDbController.hasField}
|
|
937
|
-
* read-scope projection union answers `false`, so `validateInsights` rejects
|
|
938
|
-
* `$select` / filter / sort references to it with the identical
|
|
939
|
-
* `Unknown field "x"` 400 a nonexistent field gets.
|
|
929
|
+
* Scope-aware field visibility — same contract as
|
|
930
|
+
* {@link AsArbacDbController.hasField}.
|
|
940
931
|
*/
|
|
941
932
|
hasField(path) {
|
|
942
933
|
return super.hasField(path) && isScopedFieldVisible(readCachedScopes(), path, metaAlwaysVisibleFields(this, this.readable));
|
|
@@ -152,9 +152,9 @@ declare class AsArbacDbController<T extends TAtscriptAnnotatedType = TAtscriptAn
|
|
|
152
152
|
* controls of a request. Runs after the base validator (which checks the
|
|
153
153
|
* controls DTO shape) and BEFORE the query/aggregation pipeline executes.
|
|
154
154
|
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
155
|
+
* Reads the scopes the route-level authorize interceptor cached via
|
|
156
|
+
* `arbac.setScopes(...)` — validation runs before `transformFilter`, so
|
|
157
|
+
* this hook never re-evaluates ARBAC.
|
|
158
158
|
*
|
|
159
159
|
* On a violation we throw `HttpError(403)`. moost-db's `query` / `pages` /
|
|
160
160
|
* `getOne` handlers do NOT wrap `validateParsed` in try/catch, so the
|
|
@@ -163,18 +163,12 @@ declare class AsArbacDbController<T extends TAtscriptAnnotatedType = TAtscriptAn
|
|
|
163
163
|
protected validateControls(controls: Record<string, unknown>, type: "query" | "pages" | "getOne"): string | undefined;
|
|
164
164
|
protected applyMetaOverlay(meta: TMetaResponse): Promise<TMetaResponse>;
|
|
165
165
|
/**
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
* as an existence/value oracle. Identifier fields stay visible (reads
|
|
173
|
-
* always return them — see {@link MetaVisibility.alwaysVisible}), and paths
|
|
174
|
-
* under a `with`-granted relation pass through to the sub-scope's own
|
|
175
|
-
* enforcement. Scopes were cached by the route-level authorize interceptor
|
|
176
|
-
* before validation runs (`useArbac` setScopes), so the union reflects the
|
|
177
|
-
* exact action being executed.
|
|
166
|
+
* Scope-aware field visibility (BUG-3 twin of the `/meta` pruning above): a
|
|
167
|
+
* field outside the read-scope projection union answers `false`, which
|
|
168
|
+
* moost-db's visibility hook turns into the same `Unknown field "x"` 400 a
|
|
169
|
+
* nonexistent field gets at every gated query position — see the docs'
|
|
170
|
+
* "Column-scope security floor". Identifiers stay visible; paths under a
|
|
171
|
+
* `with`-granted relation pass through to the sub-scope's own enforcement.
|
|
178
172
|
*/
|
|
179
173
|
protected hasField(path: string): boolean;
|
|
180
174
|
protected onWrite(action: "insert" | "insertMany" | "replace" | "replaceMany" | "update" | "updateMany", data: unknown): Promise<unknown>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aooth/arbac-moost",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.67",
|
|
4
4
|
"description": "Moost RBAC integration for aoothjs (migrated from @moostjs/arbac)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"abac",
|
|
@@ -60,17 +60,17 @@
|
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@uniqu/core": "^0.1.
|
|
64
|
-
"@aooth/arbac": "0.1.
|
|
65
|
-
"@aooth/user": "0.1.
|
|
66
|
-
"@aooth/arbac-core": "0.1.
|
|
63
|
+
"@uniqu/core": "^0.1.10",
|
|
64
|
+
"@aooth/arbac": "0.1.67",
|
|
65
|
+
"@aooth/user": "0.1.67",
|
|
66
|
+
"@aooth/arbac-core": "0.1.67"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@atscript/core": "^0.1.93",
|
|
70
|
-
"@atscript/db": "^0.1.
|
|
71
|
-
"@atscript/db-sql-tools": "^0.1.
|
|
72
|
-
"@atscript/db-sqlite": "^0.1.
|
|
73
|
-
"@atscript/moost-db": "^0.1.
|
|
70
|
+
"@atscript/db": "^0.1.133",
|
|
71
|
+
"@atscript/db-sql-tools": "^0.1.133",
|
|
72
|
+
"@atscript/db-sqlite": "^0.1.133",
|
|
73
|
+
"@atscript/moost-db": "^0.1.133",
|
|
74
74
|
"@atscript/typescript": "^0.1.93",
|
|
75
75
|
"@moostjs/event-http": "^0.6.37",
|
|
76
76
|
"@types/better-sqlite3": "^7.6.13",
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"unplugin-atscript": "^0.1.93"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
|
-
"@atscript/db": "^0.1.
|
|
82
|
-
"@atscript/moost-db": "^0.1.
|
|
81
|
+
"@atscript/db": "^0.1.133",
|
|
82
|
+
"@atscript/moost-db": "^0.1.133",
|
|
83
83
|
"@atscript/typescript": "^0.1.93",
|
|
84
84
|
"@moostjs/event-http": "^0.6.37",
|
|
85
85
|
"@wooksjs/event-core": "^0.7.23",
|