@objectstack/plugin-security 3.0.3 → 3.0.4
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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +8 -0
- package/README.md +48 -0
- package/package.json +3 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @objectstack/plugin-security@3.0.
|
|
2
|
+
> @objectstack/plugin-security@3.0.4 build /home/runner/work/spec/spec/packages/plugins/plugin-security
|
|
3
3
|
> tsup --config ../../../tsup.config.ts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
[34mCJS[39m Build start
|
|
13
13
|
[32mESM[39m [1mdist/index.mjs [22m[32m9.76 KB[39m
|
|
14
14
|
[32mESM[39m [1mdist/index.mjs.map [22m[32m21.06 KB[39m
|
|
15
|
-
[32mESM[39m ⚡️ Build success in
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 87ms
|
|
16
16
|
[32mCJS[39m [1mdist/index.js [22m[32m10.89 KB[39m
|
|
17
17
|
[32mCJS[39m [1mdist/index.js.map [22m[32m21.59 KB[39m
|
|
18
|
-
[32mCJS[39m ⚡️ Build success in
|
|
18
|
+
[32mCJS[39m ⚡️ Build success in 83ms
|
|
19
19
|
[34mDTS[39m Build start
|
|
20
|
-
[32mDTS[39m ⚡️ Build success in
|
|
20
|
+
[32mDTS[39m ⚡️ Build success in 8856ms
|
|
21
21
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m4.30 KB[39m
|
|
22
22
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m4.30 KB[39m
|
package/CHANGELOG.md
CHANGED
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
|
+
"version": "3.0.4",
|
|
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.
|
|
17
|
-
"@objectstack/spec": "3.0.
|
|
16
|
+
"@objectstack/core": "3.0.4",
|
|
17
|
+
"@objectstack/spec": "3.0.4"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@types/node": "^25.2.2",
|