@objectstack/plugin-security 3.0.3 → 3.0.5

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,5 +1,5 @@
1
1
 
2
- > @objectstack/plugin-security@3.0.3 build /home/runner/work/spec/spec/packages/plugins/plugin-security
2
+ > @objectstack/plugin-security@3.0.5 build /home/runner/work/spec/spec/packages/plugins/plugin-security
3
3
  > tsup --config ../../../tsup.config.ts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -10,13 +10,13 @@
10
10
  CLI Cleaning output folder
11
11
  ESM Build start
12
12
  CJS Build start
13
- ESM dist/index.mjs 9.76 KB
14
- ESM dist/index.mjs.map 21.06 KB
15
- ESM ⚡️ Build success in 57ms
16
13
  CJS dist/index.js 10.89 KB
17
14
  CJS dist/index.js.map 21.59 KB
18
- CJS ⚡️ Build success in 57ms
15
+ CJS ⚡️ Build success in 74ms
16
+ ESM dist/index.mjs 9.76 KB
17
+ ESM dist/index.mjs.map 21.06 KB
18
+ ESM ⚡️ Build success in 75ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 7856ms
20
+ DTS ⚡️ Build success in 8505ms
21
21
  DTS dist/index.d.mts 4.30 KB
22
22
  DTS dist/index.d.ts 4.30 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @objectstack/plugin-security
2
2
 
3
+ ## 3.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [23a4a68]
8
+ - @objectstack/spec@3.0.5
9
+ - @objectstack/core@3.0.5
10
+
11
+ ## 3.0.4
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [d738987]
16
+ - @objectstack/spec@3.0.4
17
+ - @objectstack/core@3.0.4
18
+
3
19
  ## 3.0.3
4
20
 
5
21
  ### Patch Changes
package/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # @objectstack/plugin-security
2
+
3
+ Security Plugin for ObjectStack — RBAC, Row-Level Security (RLS), and Field-Level Security runtime.
4
+
5
+ ## Features
6
+
7
+ - **RBAC Permission Evaluator**: Checks object-level CRUD permissions per user role with most-permissive merging across multiple roles.
8
+ - **Row-Level Security (RLS)**: Compiles RLS policy expressions into ObjectQL query filters, automatically injected into all read operations.
9
+ - **Field-Level Masking**: Strips non-readable fields from query results and identifies non-editable fields.
10
+ - **ObjectQL Middleware Integration**: Hooks into the ObjectQL pipeline to enforce security transparently on every operation.
11
+ - **System Bypass**: System-level operations skip security checks for internal workflows.
12
+
13
+ ## Usage
14
+
15
+ ```typescript
16
+ import { SecurityPlugin } from '@objectstack/plugin-security';
17
+ import { ObjectKernel } from '@objectstack/core';
18
+
19
+ const kernel = new ObjectKernel({
20
+ plugins: [
21
+ new SecurityPlugin(),
22
+ ],
23
+ });
24
+ ```
25
+
26
+ ### Exported Components
27
+
28
+ ```typescript
29
+ import {
30
+ SecurityPlugin,
31
+ PermissionEvaluator,
32
+ RLSCompiler,
33
+ FieldMasker,
34
+ } from '@objectstack/plugin-security';
35
+ ```
36
+
37
+ ## Architecture
38
+
39
+ The plugin registers three core services and executes a 4-step security chain on every data operation:
40
+
41
+ 1. **Resolve Permission Sets** — Match user roles to permission set definitions from metadata.
42
+ 2. **Check Object Permissions** — Validate CRUD access (`allowRead`, `allowCreate`, `allowEdit`, `allowDelete`).
43
+ 3. **Inject RLS Filters** — Compile row-level policy expressions and merge them into the query.
44
+ 4. **Mask Fields** — Remove restricted fields from results based on field-level permissions.
45
+
46
+ ## License
47
+
48
+ Apache-2.0 © ObjectStack
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectstack/plugin-security",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Security Plugin for ObjectStack — RBAC, RLS, and Field-Level Security Runtime",
6
6
  "main": "dist/index.js",
@@ -13,8 +13,8 @@
13
13
  }
14
14
  },
15
15
  "dependencies": {
16
- "@objectstack/core": "3.0.3",
17
- "@objectstack/spec": "3.0.3"
16
+ "@objectstack/core": "3.0.5",
17
+ "@objectstack/spec": "3.0.5"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@types/node": "^25.2.2",