@objectstack/core 1.0.4 → 1.0.6
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 +22 -0
- package/CHANGELOG.md +19 -0
- package/dist/index.cjs +4304 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1777 -0
- package/dist/index.d.ts +1776 -21
- package/dist/index.js +4246 -23
- package/dist/index.js.map +1 -0
- package/package.json +5 -5
- package/src/logger.ts +2 -2
- package/src/security/plugin-signature-verifier.ts +12 -11
- package/tsconfig.json +1 -3
- package/dist/api-registry-plugin.d.ts +0 -54
- package/dist/api-registry-plugin.d.ts.map +0 -1
- package/dist/api-registry-plugin.js +0 -53
- package/dist/api-registry-plugin.test.d.ts +0 -2
- package/dist/api-registry-plugin.test.d.ts.map +0 -1
- package/dist/api-registry-plugin.test.js +0 -334
- package/dist/api-registry.d.ts +0 -259
- package/dist/api-registry.d.ts.map +0 -1
- package/dist/api-registry.js +0 -600
- package/dist/api-registry.test.d.ts +0 -2
- package/dist/api-registry.test.d.ts.map +0 -1
- package/dist/api-registry.test.js +0 -957
- package/dist/contracts/data-engine.d.ts +0 -62
- package/dist/contracts/data-engine.d.ts.map +0 -1
- package/dist/contracts/data-engine.js +0 -1
- package/dist/contracts/http-server.d.ts +0 -119
- package/dist/contracts/http-server.d.ts.map +0 -1
- package/dist/contracts/http-server.js +0 -11
- package/dist/contracts/logger.d.ts +0 -63
- package/dist/contracts/logger.d.ts.map +0 -1
- package/dist/contracts/logger.js +0 -1
- package/dist/dependency-resolver.d.ts +0 -62
- package/dist/dependency-resolver.d.ts.map +0 -1
- package/dist/dependency-resolver.js +0 -317
- package/dist/dependency-resolver.test.d.ts +0 -2
- package/dist/dependency-resolver.test.d.ts.map +0 -1
- package/dist/dependency-resolver.test.js +0 -241
- package/dist/health-monitor.d.ts +0 -65
- package/dist/health-monitor.d.ts.map +0 -1
- package/dist/health-monitor.js +0 -269
- package/dist/health-monitor.test.d.ts +0 -2
- package/dist/health-monitor.test.d.ts.map +0 -1
- package/dist/health-monitor.test.js +0 -68
- package/dist/hot-reload.d.ts +0 -79
- package/dist/hot-reload.d.ts.map +0 -1
- package/dist/hot-reload.js +0 -313
- package/dist/index.d.ts.map +0 -1
- package/dist/kernel-base.d.ts +0 -84
- package/dist/kernel-base.d.ts.map +0 -1
- package/dist/kernel-base.js +0 -219
- package/dist/kernel.d.ts +0 -113
- package/dist/kernel.d.ts.map +0 -1
- package/dist/kernel.js +0 -472
- package/dist/kernel.test.d.ts +0 -2
- package/dist/kernel.test.d.ts.map +0 -1
- package/dist/kernel.test.js +0 -414
- package/dist/lite-kernel.d.ts +0 -55
- package/dist/lite-kernel.d.ts.map +0 -1
- package/dist/lite-kernel.js +0 -112
- package/dist/lite-kernel.test.d.ts +0 -2
- package/dist/lite-kernel.test.d.ts.map +0 -1
- package/dist/lite-kernel.test.js +0 -161
- package/dist/logger.d.ts +0 -71
- package/dist/logger.d.ts.map +0 -1
- package/dist/logger.js +0 -312
- package/dist/logger.test.d.ts +0 -2
- package/dist/logger.test.d.ts.map +0 -1
- package/dist/logger.test.js +0 -92
- package/dist/plugin-loader.d.ts +0 -164
- package/dist/plugin-loader.d.ts.map +0 -1
- package/dist/plugin-loader.js +0 -319
- package/dist/plugin-loader.test.d.ts +0 -2
- package/dist/plugin-loader.test.d.ts.map +0 -1
- package/dist/plugin-loader.test.js +0 -348
- package/dist/qa/adapter.d.ts +0 -14
- package/dist/qa/adapter.d.ts.map +0 -1
- package/dist/qa/adapter.js +0 -1
- package/dist/qa/http-adapter.d.ts +0 -16
- package/dist/qa/http-adapter.d.ts.map +0 -1
- package/dist/qa/http-adapter.js +0 -107
- package/dist/qa/index.d.ts +0 -4
- package/dist/qa/index.d.ts.map +0 -1
- package/dist/qa/index.js +0 -3
- package/dist/qa/runner.d.ts +0 -27
- package/dist/qa/runner.d.ts.map +0 -1
- package/dist/qa/runner.js +0 -157
- package/dist/security/index.d.ts +0 -17
- package/dist/security/index.d.ts.map +0 -1
- package/dist/security/index.js +0 -17
- package/dist/security/permission-manager.d.ts +0 -96
- package/dist/security/permission-manager.d.ts.map +0 -1
- package/dist/security/permission-manager.js +0 -235
- package/dist/security/permission-manager.test.d.ts +0 -2
- package/dist/security/permission-manager.test.d.ts.map +0 -1
- package/dist/security/permission-manager.test.js +0 -220
- package/dist/security/plugin-config-validator.d.ts +0 -79
- package/dist/security/plugin-config-validator.d.ts.map +0 -1
- package/dist/security/plugin-config-validator.js +0 -166
- package/dist/security/plugin-config-validator.test.d.ts +0 -2
- package/dist/security/plugin-config-validator.test.d.ts.map +0 -1
- package/dist/security/plugin-config-validator.test.js +0 -223
- package/dist/security/plugin-permission-enforcer.d.ts +0 -154
- package/dist/security/plugin-permission-enforcer.d.ts.map +0 -1
- package/dist/security/plugin-permission-enforcer.js +0 -323
- package/dist/security/plugin-permission-enforcer.test.d.ts +0 -2
- package/dist/security/plugin-permission-enforcer.test.d.ts.map +0 -1
- package/dist/security/plugin-permission-enforcer.test.js +0 -205
- package/dist/security/plugin-signature-verifier.d.ts +0 -96
- package/dist/security/plugin-signature-verifier.d.ts.map +0 -1
- package/dist/security/plugin-signature-verifier.js +0 -250
- package/dist/security/sandbox-runtime.d.ts +0 -115
- package/dist/security/sandbox-runtime.d.ts.map +0 -1
- package/dist/security/sandbox-runtime.js +0 -311
- package/dist/security/security-scanner.d.ts +0 -92
- package/dist/security/security-scanner.d.ts.map +0 -1
- package/dist/security/security-scanner.js +0 -273
- package/dist/types.d.ts +0 -89
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -1
- package/dist/utils/env.d.ts +0 -20
- package/dist/utils/env.d.ts.map +0 -1
- package/dist/utils/env.js +0 -46
- package/dist/utils/env.test.d.ts +0 -2
- package/dist/utils/env.test.d.ts.map +0 -1
- package/dist/utils/env.test.js +0 -52
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach } from 'vitest';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { PluginConfigValidator } from './plugin-config-validator.js';
|
|
4
|
-
import { createLogger } from '../logger.js';
|
|
5
|
-
describe('PluginConfigValidator', () => {
|
|
6
|
-
let validator;
|
|
7
|
-
let logger;
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
logger = createLogger({ level: 'error' });
|
|
10
|
-
validator = new PluginConfigValidator(logger);
|
|
11
|
-
});
|
|
12
|
-
describe('validatePluginConfig', () => {
|
|
13
|
-
it('should validate valid configuration', () => {
|
|
14
|
-
const configSchema = z.object({
|
|
15
|
-
port: z.number().min(1000).max(65535),
|
|
16
|
-
host: z.string(),
|
|
17
|
-
debug: z.boolean().default(false),
|
|
18
|
-
});
|
|
19
|
-
const plugin = {
|
|
20
|
-
name: 'com.test.plugin',
|
|
21
|
-
version: '1.0.0',
|
|
22
|
-
configSchema,
|
|
23
|
-
init: async () => { },
|
|
24
|
-
};
|
|
25
|
-
const config = {
|
|
26
|
-
port: 3000,
|
|
27
|
-
host: 'localhost',
|
|
28
|
-
debug: true,
|
|
29
|
-
};
|
|
30
|
-
const validatedConfig = validator.validatePluginConfig(plugin, config);
|
|
31
|
-
expect(validatedConfig).toEqual(config);
|
|
32
|
-
});
|
|
33
|
-
it('should apply defaults for missing optional fields', () => {
|
|
34
|
-
const configSchema = z.object({
|
|
35
|
-
port: z.number().default(3000),
|
|
36
|
-
host: z.string().default('localhost'),
|
|
37
|
-
debug: z.boolean().default(false),
|
|
38
|
-
});
|
|
39
|
-
const plugin = {
|
|
40
|
-
name: 'com.test.plugin',
|
|
41
|
-
version: '1.0.0',
|
|
42
|
-
configSchema,
|
|
43
|
-
init: async () => { },
|
|
44
|
-
};
|
|
45
|
-
const config = {
|
|
46
|
-
port: 8080,
|
|
47
|
-
};
|
|
48
|
-
const validatedConfig = validator.validatePluginConfig(plugin, config);
|
|
49
|
-
expect(validatedConfig).toEqual({
|
|
50
|
-
port: 8080,
|
|
51
|
-
host: 'localhost',
|
|
52
|
-
debug: false,
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
it('should throw error for invalid configuration', () => {
|
|
56
|
-
const configSchema = z.object({
|
|
57
|
-
port: z.number().min(1000).max(65535),
|
|
58
|
-
host: z.string(),
|
|
59
|
-
});
|
|
60
|
-
const plugin = {
|
|
61
|
-
name: 'com.test.plugin',
|
|
62
|
-
version: '1.0.0',
|
|
63
|
-
configSchema,
|
|
64
|
-
init: async () => { },
|
|
65
|
-
};
|
|
66
|
-
const config = {
|
|
67
|
-
port: 100, // Invalid: < 1000
|
|
68
|
-
host: 'localhost',
|
|
69
|
-
};
|
|
70
|
-
expect(() => validator.validatePluginConfig(plugin, config)).toThrow();
|
|
71
|
-
});
|
|
72
|
-
it('should provide detailed error messages', () => {
|
|
73
|
-
const configSchema = z.object({
|
|
74
|
-
port: z.number().min(1000),
|
|
75
|
-
host: z.string().min(1),
|
|
76
|
-
});
|
|
77
|
-
const plugin = {
|
|
78
|
-
name: 'com.test.plugin',
|
|
79
|
-
version: '1.0.0',
|
|
80
|
-
configSchema,
|
|
81
|
-
init: async () => { },
|
|
82
|
-
};
|
|
83
|
-
const config = {
|
|
84
|
-
port: 100,
|
|
85
|
-
host: '',
|
|
86
|
-
};
|
|
87
|
-
try {
|
|
88
|
-
validator.validatePluginConfig(plugin, config);
|
|
89
|
-
expect.fail('Should have thrown validation error');
|
|
90
|
-
}
|
|
91
|
-
catch (error) {
|
|
92
|
-
const errorMessage = error.message;
|
|
93
|
-
expect(errorMessage).toContain('com.test.plugin');
|
|
94
|
-
expect(errorMessage).toContain('port');
|
|
95
|
-
expect(errorMessage).toContain('host');
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
it('should skip validation when no schema is provided', () => {
|
|
99
|
-
const plugin = {
|
|
100
|
-
name: 'com.test.plugin',
|
|
101
|
-
version: '1.0.0',
|
|
102
|
-
init: async () => { },
|
|
103
|
-
};
|
|
104
|
-
const config = { anything: 'goes' };
|
|
105
|
-
const validatedConfig = validator.validatePluginConfig(plugin, config);
|
|
106
|
-
expect(validatedConfig).toEqual(config);
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
describe('validatePartialConfig', () => {
|
|
110
|
-
it('should validate partial configuration', () => {
|
|
111
|
-
const configSchema = z.object({
|
|
112
|
-
port: z.number().min(1000),
|
|
113
|
-
host: z.string(),
|
|
114
|
-
debug: z.boolean(),
|
|
115
|
-
});
|
|
116
|
-
const plugin = {
|
|
117
|
-
name: 'com.test.plugin',
|
|
118
|
-
version: '1.0.0',
|
|
119
|
-
configSchema,
|
|
120
|
-
init: async () => { },
|
|
121
|
-
};
|
|
122
|
-
const partialConfig = {
|
|
123
|
-
port: 8080,
|
|
124
|
-
};
|
|
125
|
-
const validatedConfig = validator.validatePartialConfig(plugin, partialConfig);
|
|
126
|
-
expect(validatedConfig).toEqual({ port: 8080 });
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
describe('getDefaultConfig', () => {
|
|
130
|
-
it('should extract default configuration', () => {
|
|
131
|
-
const configSchema = z.object({
|
|
132
|
-
port: z.number().default(3000),
|
|
133
|
-
host: z.string().default('localhost'),
|
|
134
|
-
debug: z.boolean().default(false),
|
|
135
|
-
});
|
|
136
|
-
const plugin = {
|
|
137
|
-
name: 'com.test.plugin',
|
|
138
|
-
version: '1.0.0',
|
|
139
|
-
configSchema,
|
|
140
|
-
init: async () => { },
|
|
141
|
-
};
|
|
142
|
-
const defaults = validator.getDefaultConfig(plugin);
|
|
143
|
-
expect(defaults).toEqual({
|
|
144
|
-
port: 3000,
|
|
145
|
-
host: 'localhost',
|
|
146
|
-
debug: false,
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
it('should return undefined when schema requires fields', () => {
|
|
150
|
-
const configSchema = z.object({
|
|
151
|
-
port: z.number(),
|
|
152
|
-
host: z.string(),
|
|
153
|
-
});
|
|
154
|
-
const plugin = {
|
|
155
|
-
name: 'com.test.plugin',
|
|
156
|
-
version: '1.0.0',
|
|
157
|
-
configSchema,
|
|
158
|
-
init: async () => { },
|
|
159
|
-
};
|
|
160
|
-
const defaults = validator.getDefaultConfig(plugin);
|
|
161
|
-
expect(defaults).toBeUndefined();
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
describe('isConfigValid', () => {
|
|
165
|
-
it('should return true for valid config', () => {
|
|
166
|
-
const configSchema = z.object({
|
|
167
|
-
port: z.number(),
|
|
168
|
-
});
|
|
169
|
-
const plugin = {
|
|
170
|
-
name: 'com.test.plugin',
|
|
171
|
-
version: '1.0.0',
|
|
172
|
-
configSchema,
|
|
173
|
-
init: async () => { },
|
|
174
|
-
};
|
|
175
|
-
const isValid = validator.isConfigValid(plugin, { port: 3000 });
|
|
176
|
-
expect(isValid).toBe(true);
|
|
177
|
-
});
|
|
178
|
-
it('should return false for invalid config', () => {
|
|
179
|
-
const configSchema = z.object({
|
|
180
|
-
port: z.number(),
|
|
181
|
-
});
|
|
182
|
-
const plugin = {
|
|
183
|
-
name: 'com.test.plugin',
|
|
184
|
-
version: '1.0.0',
|
|
185
|
-
configSchema,
|
|
186
|
-
init: async () => { },
|
|
187
|
-
};
|
|
188
|
-
const isValid = validator.isConfigValid(plugin, { port: 'invalid' });
|
|
189
|
-
expect(isValid).toBe(false);
|
|
190
|
-
});
|
|
191
|
-
});
|
|
192
|
-
describe('getConfigErrors', () => {
|
|
193
|
-
it('should return errors for invalid config', () => {
|
|
194
|
-
const configSchema = z.object({
|
|
195
|
-
port: z.number().min(1000),
|
|
196
|
-
host: z.string().min(1),
|
|
197
|
-
});
|
|
198
|
-
const plugin = {
|
|
199
|
-
name: 'com.test.plugin',
|
|
200
|
-
version: '1.0.0',
|
|
201
|
-
configSchema,
|
|
202
|
-
init: async () => { },
|
|
203
|
-
};
|
|
204
|
-
const errors = validator.getConfigErrors(plugin, { port: 100, host: '' });
|
|
205
|
-
expect(errors).toHaveLength(2);
|
|
206
|
-
expect(errors[0].path).toBe('port');
|
|
207
|
-
expect(errors[1].path).toBe('host');
|
|
208
|
-
});
|
|
209
|
-
it('should return empty array for valid config', () => {
|
|
210
|
-
const configSchema = z.object({
|
|
211
|
-
port: z.number(),
|
|
212
|
-
});
|
|
213
|
-
const plugin = {
|
|
214
|
-
name: 'com.test.plugin',
|
|
215
|
-
version: '1.0.0',
|
|
216
|
-
configSchema,
|
|
217
|
-
init: async () => { },
|
|
218
|
-
};
|
|
219
|
-
const errors = validator.getConfigErrors(plugin, { port: 3000 });
|
|
220
|
-
expect(errors).toEqual([]);
|
|
221
|
-
});
|
|
222
|
-
});
|
|
223
|
-
});
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import type { Logger } from '@objectstack/spec/contracts';
|
|
2
|
-
import type { PluginCapability } from '@objectstack/spec/kernel';
|
|
3
|
-
import type { PluginContext } from '../types.js';
|
|
4
|
-
/**
|
|
5
|
-
* Plugin Permissions
|
|
6
|
-
* Defines what actions a plugin is allowed to perform
|
|
7
|
-
*/
|
|
8
|
-
export interface PluginPermissions {
|
|
9
|
-
canAccessService(serviceName: string): boolean;
|
|
10
|
-
canTriggerHook(hookName: string): boolean;
|
|
11
|
-
canReadFile(path: string): boolean;
|
|
12
|
-
canWriteFile(path: string): boolean;
|
|
13
|
-
canNetworkRequest(url: string): boolean;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Permission Check Result
|
|
17
|
-
*/
|
|
18
|
-
export interface PermissionCheckResult {
|
|
19
|
-
allowed: boolean;
|
|
20
|
-
reason?: string;
|
|
21
|
-
capability?: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Plugin Permission Enforcer
|
|
25
|
-
*
|
|
26
|
-
* Implements capability-based security model to enforce:
|
|
27
|
-
* 1. Service access control - which services a plugin can use
|
|
28
|
-
* 2. Hook restrictions - which hooks a plugin can trigger
|
|
29
|
-
* 3. File system permissions - what files a plugin can read/write
|
|
30
|
-
* 4. Network permissions - what URLs a plugin can access
|
|
31
|
-
*
|
|
32
|
-
* Architecture:
|
|
33
|
-
* - Uses capability declarations from plugin manifest
|
|
34
|
-
* - Checks permissions before allowing operations
|
|
35
|
-
* - Logs all permission denials for security audit
|
|
36
|
-
* - Supports allowlist and denylist patterns
|
|
37
|
-
*
|
|
38
|
-
* Security Model:
|
|
39
|
-
* - Principle of least privilege - plugins get minimal permissions
|
|
40
|
-
* - Explicit declaration - all capabilities must be declared
|
|
41
|
-
* - Runtime enforcement - checks happen at operation time
|
|
42
|
-
* - Audit trail - all denials are logged
|
|
43
|
-
*
|
|
44
|
-
* Usage:
|
|
45
|
-
* ```typescript
|
|
46
|
-
* const enforcer = new PluginPermissionEnforcer(logger);
|
|
47
|
-
* enforcer.registerPluginPermissions(pluginName, capabilities);
|
|
48
|
-
* enforcer.enforceServiceAccess(pluginName, 'database');
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
export declare class PluginPermissionEnforcer {
|
|
52
|
-
private logger;
|
|
53
|
-
private permissionRegistry;
|
|
54
|
-
private capabilityRegistry;
|
|
55
|
-
constructor(logger: Logger);
|
|
56
|
-
/**
|
|
57
|
-
* Register plugin capabilities and build permission set
|
|
58
|
-
*
|
|
59
|
-
* @param pluginName - Plugin identifier
|
|
60
|
-
* @param capabilities - Array of capability declarations
|
|
61
|
-
*/
|
|
62
|
-
registerPluginPermissions(pluginName: string, capabilities: PluginCapability[]): void;
|
|
63
|
-
/**
|
|
64
|
-
* Enforce service access permission
|
|
65
|
-
*
|
|
66
|
-
* @param pluginName - Plugin requesting access
|
|
67
|
-
* @param serviceName - Service to access
|
|
68
|
-
* @throws Error if permission denied
|
|
69
|
-
*/
|
|
70
|
-
enforceServiceAccess(pluginName: string, serviceName: string): void;
|
|
71
|
-
/**
|
|
72
|
-
* Enforce hook trigger permission
|
|
73
|
-
*
|
|
74
|
-
* @param pluginName - Plugin requesting access
|
|
75
|
-
* @param hookName - Hook to trigger
|
|
76
|
-
* @throws Error if permission denied
|
|
77
|
-
*/
|
|
78
|
-
enforceHookTrigger(pluginName: string, hookName: string): void;
|
|
79
|
-
/**
|
|
80
|
-
* Enforce file read permission
|
|
81
|
-
*
|
|
82
|
-
* @param pluginName - Plugin requesting access
|
|
83
|
-
* @param path - File path to read
|
|
84
|
-
* @throws Error if permission denied
|
|
85
|
-
*/
|
|
86
|
-
enforceFileRead(pluginName: string, path: string): void;
|
|
87
|
-
/**
|
|
88
|
-
* Enforce file write permission
|
|
89
|
-
*
|
|
90
|
-
* @param pluginName - Plugin requesting access
|
|
91
|
-
* @param path - File path to write
|
|
92
|
-
* @throws Error if permission denied
|
|
93
|
-
*/
|
|
94
|
-
enforceFileWrite(pluginName: string, path: string): void;
|
|
95
|
-
/**
|
|
96
|
-
* Enforce network request permission
|
|
97
|
-
*
|
|
98
|
-
* @param pluginName - Plugin requesting access
|
|
99
|
-
* @param url - URL to access
|
|
100
|
-
* @throws Error if permission denied
|
|
101
|
-
*/
|
|
102
|
-
enforceNetworkRequest(pluginName: string, url: string): void;
|
|
103
|
-
/**
|
|
104
|
-
* Get plugin capabilities
|
|
105
|
-
*
|
|
106
|
-
* @param pluginName - Plugin identifier
|
|
107
|
-
* @returns Array of capabilities or undefined
|
|
108
|
-
*/
|
|
109
|
-
getPluginCapabilities(pluginName: string): PluginCapability[] | undefined;
|
|
110
|
-
/**
|
|
111
|
-
* Get plugin permissions
|
|
112
|
-
*
|
|
113
|
-
* @param pluginName - Plugin identifier
|
|
114
|
-
* @returns Permissions object or undefined
|
|
115
|
-
*/
|
|
116
|
-
getPluginPermissions(pluginName: string): PluginPermissions | undefined;
|
|
117
|
-
/**
|
|
118
|
-
* Revoke all permissions for a plugin
|
|
119
|
-
*
|
|
120
|
-
* @param pluginName - Plugin identifier
|
|
121
|
-
*/
|
|
122
|
-
revokePermissions(pluginName: string): void;
|
|
123
|
-
private checkPermission;
|
|
124
|
-
private checkServiceAccess;
|
|
125
|
-
private checkHookAccess;
|
|
126
|
-
private checkFileRead;
|
|
127
|
-
private checkFileWrite;
|
|
128
|
-
private checkNetworkAccess;
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Secure Plugin Context
|
|
132
|
-
* Wraps PluginContext with permission checks
|
|
133
|
-
*/
|
|
134
|
-
export declare class SecurePluginContext implements PluginContext {
|
|
135
|
-
private pluginName;
|
|
136
|
-
private permissionEnforcer;
|
|
137
|
-
private baseContext;
|
|
138
|
-
constructor(pluginName: string, permissionEnforcer: PluginPermissionEnforcer, baseContext: PluginContext);
|
|
139
|
-
registerService(name: string, service: any): void;
|
|
140
|
-
getService<T>(name: string): T;
|
|
141
|
-
getServices(): Map<string, any>;
|
|
142
|
-
hook(name: string, handler: (...args: any[]) => void | Promise<void>): void;
|
|
143
|
-
trigger(name: string, ...args: any[]): Promise<void>;
|
|
144
|
-
get logger(): Logger;
|
|
145
|
-
getKernel(): import("../kernel.js").ObjectKernel;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Create a plugin permission enforcer
|
|
149
|
-
*
|
|
150
|
-
* @param logger - Logger instance
|
|
151
|
-
* @returns Plugin permission enforcer
|
|
152
|
-
*/
|
|
153
|
-
export declare function createPluginPermissionEnforcer(logger: Logger): PluginPermissionEnforcer;
|
|
154
|
-
//# sourceMappingURL=plugin-permission-enforcer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-permission-enforcer.d.ts","sourceRoot":"","sources":["../../src/security/plugin-permission-enforcer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/C,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1C,WAAW,CAAC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