zexus 1.6.8 → 1.7.2
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/README.md +12 -5
- package/package.json +1 -1
- package/src/__init__.py +7 -0
- package/src/zexus/__init__.py +1 -1
- package/src/zexus/__pycache__/__init__.cpython-312.pyc +0 -0
- package/src/zexus/__pycache__/capability_system.cpython-312.pyc +0 -0
- package/src/zexus/__pycache__/debug_sanitizer.cpython-312.pyc +0 -0
- package/src/zexus/__pycache__/environment.cpython-312.pyc +0 -0
- package/src/zexus/__pycache__/error_reporter.cpython-312.pyc +0 -0
- package/src/zexus/__pycache__/input_validation.cpython-312.pyc +0 -0
- package/src/zexus/__pycache__/lexer.cpython-312.pyc +0 -0
- package/src/zexus/__pycache__/module_cache.cpython-312.pyc +0 -0
- package/src/zexus/__pycache__/module_manager.cpython-312.pyc +0 -0
- package/src/zexus/__pycache__/object.cpython-312.pyc +0 -0
- package/src/zexus/__pycache__/security.cpython-312.pyc +0 -0
- package/src/zexus/__pycache__/security_enforcement.cpython-312.pyc +0 -0
- package/src/zexus/__pycache__/syntax_validator.cpython-312.pyc +0 -0
- package/src/zexus/__pycache__/zexus_ast.cpython-312.pyc +0 -0
- package/src/zexus/__pycache__/zexus_token.cpython-312.pyc +0 -0
- package/src/zexus/access_control_system/__pycache__/__init__.cpython-312.pyc +0 -0
- package/src/zexus/access_control_system/__pycache__/access_control.cpython-312.pyc +0 -0
- package/src/zexus/advanced_types.py +17 -2
- package/src/zexus/blockchain/__init__.py +411 -0
- package/src/zexus/blockchain/accelerator.py +1160 -0
- package/src/zexus/blockchain/chain.py +660 -0
- package/src/zexus/blockchain/consensus.py +821 -0
- package/src/zexus/blockchain/contract_vm.py +1019 -0
- package/src/zexus/blockchain/crypto.py +79 -14
- package/src/zexus/blockchain/events.py +526 -0
- package/src/zexus/blockchain/loadtest.py +721 -0
- package/src/zexus/blockchain/monitoring.py +350 -0
- package/src/zexus/blockchain/mpt.py +716 -0
- package/src/zexus/blockchain/multichain.py +951 -0
- package/src/zexus/blockchain/multiprocess_executor.py +338 -0
- package/src/zexus/blockchain/network.py +886 -0
- package/src/zexus/blockchain/node.py +666 -0
- package/src/zexus/blockchain/rpc.py +1203 -0
- package/src/zexus/blockchain/rust_bridge.py +421 -0
- package/src/zexus/blockchain/storage.py +423 -0
- package/src/zexus/blockchain/tokens.py +750 -0
- package/src/zexus/blockchain/upgradeable.py +1004 -0
- package/src/zexus/blockchain/verification.py +1602 -0
- package/src/zexus/blockchain/wallet.py +621 -0
- package/src/zexus/capability_system.py +184 -9
- package/src/zexus/cli/__pycache__/main.cpython-312.pyc +0 -0
- package/src/zexus/cli/main.py +383 -34
- package/src/zexus/cli/zpm.py +1 -1
- package/src/zexus/compiler/__pycache__/bytecode.cpython-312.pyc +0 -0
- package/src/zexus/compiler/__pycache__/lexer.cpython-312.pyc +0 -0
- package/src/zexus/compiler/__pycache__/parser.cpython-312.pyc +0 -0
- package/src/zexus/compiler/__pycache__/semantic.cpython-312.pyc +0 -0
- package/src/zexus/compiler/__pycache__/zexus_ast.cpython-312.pyc +0 -0
- package/src/zexus/compiler/bytecode.py +124 -7
- package/src/zexus/compiler/compat_runtime.py +6 -2
- package/src/zexus/compiler/lexer.py +16 -5
- package/src/zexus/compiler/parser.py +108 -7
- package/src/zexus/compiler/semantic.py +18 -19
- package/src/zexus/compiler/zexus_ast.py +26 -1
- package/src/zexus/concurrency_system.py +79 -0
- package/src/zexus/config.py +54 -0
- package/src/zexus/crypto_bridge.py +244 -8
- package/src/zexus/dap/__init__.py +10 -0
- package/src/zexus/dap/__main__.py +4 -0
- package/src/zexus/dap/dap_server.py +391 -0
- package/src/zexus/dap/debug_engine.py +298 -0
- package/src/zexus/environment.py +112 -9
- package/src/zexus/evaluator/__pycache__/bytecode_compiler.cpython-312.pyc +0 -0
- package/src/zexus/evaluator/__pycache__/core.cpython-312.pyc +0 -0
- package/src/zexus/evaluator/__pycache__/expressions.cpython-312.pyc +0 -0
- package/src/zexus/evaluator/__pycache__/functions.cpython-312.pyc +0 -0
- package/src/zexus/evaluator/__pycache__/resource_limiter.cpython-312.pyc +0 -0
- package/src/zexus/evaluator/__pycache__/statements.cpython-312.pyc +0 -0
- package/src/zexus/evaluator/__pycache__/unified_execution.cpython-312.pyc +0 -0
- package/src/zexus/evaluator/__pycache__/utils.cpython-312.pyc +0 -0
- package/src/zexus/evaluator/bytecode_compiler.py +457 -37
- package/src/zexus/evaluator/core.py +644 -50
- package/src/zexus/evaluator/expressions.py +358 -62
- package/src/zexus/evaluator/functions.py +458 -20
- package/src/zexus/evaluator/resource_limiter.py +4 -4
- package/src/zexus/evaluator/statements.py +774 -122
- package/src/zexus/evaluator/unified_execution.py +573 -72
- package/src/zexus/evaluator/utils.py +14 -2
- package/src/zexus/evaluator_original.py +1 -1
- package/src/zexus/event_loop.py +186 -0
- package/src/zexus/lexer.py +742 -458
- package/src/zexus/lsp/__init__.py +1 -1
- package/src/zexus/lsp/definition_provider.py +163 -9
- package/src/zexus/lsp/server.py +22 -8
- package/src/zexus/lsp/symbol_provider.py +182 -9
- package/src/zexus/module_cache.py +239 -9
- package/src/zexus/module_manager.py +129 -1
- package/src/zexus/object.py +76 -6
- package/src/zexus/parser/__pycache__/parser.cpython-312.pyc +0 -0
- package/src/zexus/parser/__pycache__/strategy_context.cpython-312.pyc +0 -0
- package/src/zexus/parser/__pycache__/strategy_structural.cpython-312.pyc +0 -0
- package/src/zexus/parser/parser.py +1349 -408
- package/src/zexus/parser/strategy_context.py +755 -58
- package/src/zexus/parser/strategy_structural.py +121 -21
- package/src/zexus/persistence.py +15 -1
- package/src/zexus/renderer/__init__.py +61 -0
- package/src/zexus/renderer/__pycache__/__init__.cpython-312.pyc +0 -0
- package/src/zexus/renderer/__pycache__/backend.cpython-312.pyc +0 -0
- package/src/zexus/renderer/__pycache__/canvas.cpython-312.pyc +0 -0
- package/src/zexus/renderer/__pycache__/color_system.cpython-312.pyc +0 -0
- package/src/zexus/renderer/__pycache__/layout.cpython-312.pyc +0 -0
- package/src/zexus/renderer/__pycache__/main_renderer.cpython-312.pyc +0 -0
- package/src/zexus/renderer/__pycache__/painter.cpython-312.pyc +0 -0
- package/src/zexus/renderer/backend.py +261 -0
- package/src/zexus/renderer/canvas.py +78 -0
- package/src/zexus/renderer/color_system.py +201 -0
- package/src/zexus/renderer/graphics.py +31 -0
- package/src/zexus/renderer/layout.py +222 -0
- package/src/zexus/renderer/main_renderer.py +66 -0
- package/src/zexus/renderer/painter.py +30 -0
- package/src/zexus/renderer/tk_backend.py +208 -0
- package/src/zexus/renderer/web_backend.py +260 -0
- package/src/zexus/runtime/__init__.py +10 -2
- package/src/zexus/runtime/__pycache__/__init__.cpython-312.pyc +0 -0
- package/src/zexus/runtime/__pycache__/async_runtime.cpython-312.pyc +0 -0
- package/src/zexus/runtime/__pycache__/load_manager.cpython-312.pyc +0 -0
- package/src/zexus/runtime/file_flags.py +137 -0
- package/src/zexus/runtime/load_manager.py +368 -0
- package/src/zexus/safety/__pycache__/__init__.cpython-312.pyc +0 -0
- package/src/zexus/safety/__pycache__/memory_safety.cpython-312.pyc +0 -0
- package/src/zexus/security.py +424 -34
- package/src/zexus/stdlib/fs.py +23 -18
- package/src/zexus/stdlib/http.py +289 -186
- package/src/zexus/stdlib/sockets.py +207 -163
- package/src/zexus/stdlib/websockets.py +282 -0
- package/src/zexus/stdlib_integration.py +369 -2
- package/src/zexus/strategy_recovery.py +6 -3
- package/src/zexus/type_checker.py +423 -0
- package/src/zexus/virtual_filesystem.py +189 -2
- package/src/zexus/vm/__init__.py +113 -3
- package/src/zexus/vm/__pycache__/async_optimizer.cpython-312.pyc +0 -0
- package/src/zexus/vm/__pycache__/bytecode.cpython-312.pyc +0 -0
- package/src/zexus/vm/__pycache__/bytecode_converter.cpython-312.pyc +0 -0
- package/src/zexus/vm/__pycache__/cache.cpython-312.pyc +0 -0
- package/src/zexus/vm/__pycache__/compiler.cpython-312.pyc +0 -0
- package/src/zexus/vm/__pycache__/gas_metering.cpython-312.pyc +0 -0
- package/src/zexus/vm/__pycache__/jit.cpython-312.pyc +0 -0
- package/src/zexus/vm/__pycache__/parallel_vm.cpython-312.pyc +0 -0
- package/src/zexus/vm/__pycache__/vm.cpython-312.pyc +0 -0
- package/src/zexus/vm/async_optimizer.py +80 -6
- package/src/zexus/vm/binary_bytecode.py +659 -0
- package/src/zexus/vm/bytecode.py +59 -11
- package/src/zexus/vm/bytecode_converter.py +26 -12
- package/src/zexus/vm/cabi.c +1985 -0
- package/src/zexus/vm/cabi.cpython-312-x86_64-linux-gnu.so +0 -0
- package/src/zexus/vm/cabi.h +127 -0
- package/src/zexus/vm/cache.py +561 -17
- package/src/zexus/vm/compiler.py +818 -51
- package/src/zexus/vm/fastops.c +15743 -0
- package/src/zexus/vm/fastops.cpython-312-x86_64-linux-gnu.so +0 -0
- package/src/zexus/vm/fastops.pyx +288 -0
- package/src/zexus/vm/gas_metering.py +50 -9
- package/src/zexus/vm/jit.py +364 -20
- package/src/zexus/vm/native_jit_backend.py +1816 -0
- package/src/zexus/vm/native_runtime.cpp +1388 -0
- package/src/zexus/vm/native_runtime.cpython-312-x86_64-linux-gnu.so +0 -0
- package/src/zexus/vm/optimizer.py +161 -11
- package/src/zexus/vm/parallel_vm.py +140 -45
- package/src/zexus/vm/peephole_optimizer.py +82 -4
- package/src/zexus/vm/profiler.py +38 -18
- package/src/zexus/vm/register_allocator.py +16 -5
- package/src/zexus/vm/register_vm.py +8 -5
- package/src/zexus/vm/vm.py +3581 -531
- package/src/zexus/vm/wasm_compiler.py +658 -0
- package/src/zexus/zexus_ast.py +137 -11
- package/src/zexus/zexus_token.py +16 -5
- package/src/zexus/zpm/installer.py +55 -15
- package/src/zexus/zpm/package_manager.py +1 -1
- package/src/zexus/zpm/registry.py +257 -28
- package/src/zexus.egg-info/PKG-INFO +16 -6
- package/src/zexus.egg-info/SOURCES.txt +129 -17
- package/src/zexus.egg-info/entry_points.txt +1 -0
- package/src/zexus.egg-info/requires.txt +4 -0
|
@@ -5,7 +5,8 @@ Implements fine-grained access control through capability tokens.
|
|
|
5
5
|
Plugins declare required capabilities, and the evaluator enforces access.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
from typing import Set, Dict, List, Callable, Optional, Tuple
|
|
8
|
+
from typing import Set, Dict, List, Callable, Optional, Tuple, Any
|
|
9
|
+
import uuid
|
|
9
10
|
from dataclasses import dataclass, field
|
|
10
11
|
from enum import Enum
|
|
11
12
|
import time
|
|
@@ -173,6 +174,8 @@ class CapabilityManager:
|
|
|
173
174
|
self.audit_log = CapabilityAuditLog()
|
|
174
175
|
self.granted_capabilities: Dict[str, Set[str]] = {} # requester -> capabilities
|
|
175
176
|
self.required_capabilities: Dict[str, Set[str]] = {} # requester -> required caps
|
|
177
|
+
self._contexts: Dict[str, "CapabilityContext"] = {}
|
|
178
|
+
self._context_counter = 0
|
|
176
179
|
|
|
177
180
|
# Initialize with base capabilities
|
|
178
181
|
for cap in self.BASE_CAPABILITIES:
|
|
@@ -197,6 +200,19 @@ class CapabilityManager:
|
|
|
197
200
|
for cap in capabilities:
|
|
198
201
|
self.grant_capability(requester, cap)
|
|
199
202
|
|
|
203
|
+
def revoke_capability(self, requester: str, capability: str):
|
|
204
|
+
"""Revoke a specific capability from a requester."""
|
|
205
|
+
caps = self.granted_capabilities.get(requester)
|
|
206
|
+
if not caps:
|
|
207
|
+
return
|
|
208
|
+
caps.discard(capability)
|
|
209
|
+
if not caps:
|
|
210
|
+
self.granted_capabilities.pop(requester, None)
|
|
211
|
+
|
|
212
|
+
def revoke_all_capabilities(self, requester: str):
|
|
213
|
+
"""Remove all capabilities granted to a requester."""
|
|
214
|
+
self.granted_capabilities.pop(requester, None)
|
|
215
|
+
|
|
200
216
|
def check_capability(self, requester: str, capability: str,
|
|
201
217
|
context: Optional[Dict] = None) -> Tuple[bool, str]:
|
|
202
218
|
"""
|
|
@@ -210,29 +226,49 @@ class CapabilityManager:
|
|
|
210
226
|
requester=requester,
|
|
211
227
|
context=context or {}
|
|
212
228
|
)
|
|
213
|
-
|
|
214
|
-
|
|
229
|
+
|
|
230
|
+
context_obj = self._contexts.get(requester)
|
|
231
|
+
|
|
232
|
+
# 1. Context-specific policy enforcement (takes precedence)
|
|
233
|
+
if context_obj and context_obj.policy:
|
|
234
|
+
policy_level = context_obj.policy.check(capability)
|
|
235
|
+
if policy_level in (CapabilityLevel.ALLOWED, CapabilityLevel.UNRESTRICTED, CapabilityLevel.RESTRICTED):
|
|
236
|
+
reason = (
|
|
237
|
+
f"Capability {capability} allowed by context policy "
|
|
238
|
+
f"'{context_obj.policy.name}'"
|
|
239
|
+
)
|
|
240
|
+
self.audit_log.log_request(request, True, reason)
|
|
241
|
+
return True, reason
|
|
242
|
+
if policy_level == CapabilityLevel.DENY:
|
|
243
|
+
reason = (
|
|
244
|
+
f"Capability {capability} denied by context policy "
|
|
245
|
+
f"'{context_obj.policy.name}'"
|
|
246
|
+
)
|
|
247
|
+
self.audit_log.log_request(request, False, reason)
|
|
248
|
+
return False, reason
|
|
249
|
+
|
|
250
|
+
# 2. Check if policy allows all (AllowAllPolicy)
|
|
215
251
|
if isinstance(self.policy, AllowAllPolicy):
|
|
216
252
|
reason = f"Capability {capability} allowed by policy (allow-all)"
|
|
217
253
|
self.audit_log.log_request(request, True, reason)
|
|
218
254
|
return True, reason
|
|
219
|
-
|
|
220
|
-
#
|
|
255
|
+
|
|
256
|
+
# 3. Check if capability is base capability (always available)
|
|
221
257
|
if capability in self.BASE_CAPABILITIES:
|
|
222
258
|
reason = f"Base capability {capability} available"
|
|
223
259
|
self.audit_log.log_request(request, True, reason)
|
|
224
260
|
return True, reason
|
|
225
|
-
|
|
226
|
-
#
|
|
261
|
+
|
|
262
|
+
# 4. Check if requester has been explicitly granted this capability
|
|
227
263
|
if requester in self.granted_capabilities:
|
|
228
264
|
if capability in self.granted_capabilities[requester]:
|
|
229
265
|
reason = f"Capability {capability} granted to {requester}"
|
|
230
266
|
self.audit_log.log_request(request, True, reason)
|
|
231
267
|
return True, reason
|
|
232
268
|
|
|
233
|
-
#
|
|
269
|
+
# 5. Check if capability is allowed by policy
|
|
234
270
|
policy_level = self.policy.check(capability)
|
|
235
|
-
if policy_level
|
|
271
|
+
if policy_level in (CapabilityLevel.ALLOWED, CapabilityLevel.UNRESTRICTED, CapabilityLevel.RESTRICTED):
|
|
236
272
|
reason = f"Capability {capability} allowed by policy"
|
|
237
273
|
self.audit_log.log_request(request, True, reason)
|
|
238
274
|
return True, reason
|
|
@@ -291,6 +327,97 @@ class CapabilityManager:
|
|
|
291
327
|
"""Get audit statistics."""
|
|
292
328
|
return self.audit_log.get_statistics()
|
|
293
329
|
|
|
330
|
+
def create_context(
|
|
331
|
+
self,
|
|
332
|
+
*,
|
|
333
|
+
capabilities: Optional[List[str]] = None,
|
|
334
|
+
policy: Optional[CapabilityPolicy] = None,
|
|
335
|
+
name: Optional[str] = None,
|
|
336
|
+
inherit_base: bool = True,
|
|
337
|
+
) -> "CapabilityContext":
|
|
338
|
+
"""Create a scoped capability context."""
|
|
339
|
+
self._context_counter += 1
|
|
340
|
+
context_name = name or f"context::{self._context_counter}:{uuid.uuid4().hex[:8]}"
|
|
341
|
+
context = CapabilityContext(
|
|
342
|
+
manager=self,
|
|
343
|
+
name=context_name,
|
|
344
|
+
capabilities=capabilities or [],
|
|
345
|
+
policy=policy,
|
|
346
|
+
inherit_base=inherit_base,
|
|
347
|
+
)
|
|
348
|
+
self._contexts[context.name] = context
|
|
349
|
+
return context
|
|
350
|
+
|
|
351
|
+
def destroy_context(self, name: str) -> Optional["CapabilityContext"]:
|
|
352
|
+
"""Destroy a previously created context and revoke its grants."""
|
|
353
|
+
context = self._contexts.pop(name, None)
|
|
354
|
+
if context:
|
|
355
|
+
context.destroy()
|
|
356
|
+
return context
|
|
357
|
+
|
|
358
|
+
def get_context(self, name: str) -> Optional["CapabilityContext"]:
|
|
359
|
+
"""Retrieve a context by name, if it exists."""
|
|
360
|
+
return self._contexts.get(name)
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
class CapabilityContext:
|
|
364
|
+
"""Lightweight wrapper for scoped capability enforcement."""
|
|
365
|
+
|
|
366
|
+
def __init__(
|
|
367
|
+
self,
|
|
368
|
+
*,
|
|
369
|
+
manager: CapabilityManager,
|
|
370
|
+
name: str,
|
|
371
|
+
capabilities: Optional[List[str]] = None,
|
|
372
|
+
policy: Optional[CapabilityPolicy] = None,
|
|
373
|
+
inherit_base: bool = True,
|
|
374
|
+
) -> None:
|
|
375
|
+
self.manager = manager
|
|
376
|
+
self.name = name
|
|
377
|
+
self.policy = policy or SelectivePolicy(capabilities or [])
|
|
378
|
+
self.capabilities: Set[str] = set(capabilities or [])
|
|
379
|
+
self.inherit_base = inherit_base
|
|
380
|
+
self.created_at = time.time()
|
|
381
|
+
|
|
382
|
+
if self.capabilities:
|
|
383
|
+
self.manager.grant_capabilities(self.name, list(self.capabilities))
|
|
384
|
+
elif inherit_base:
|
|
385
|
+
# Ensure entry exists so future grants can be tracked cleanly
|
|
386
|
+
self.manager.granted_capabilities.setdefault(self.name, set())
|
|
387
|
+
|
|
388
|
+
def grant(self, capability: str) -> None:
|
|
389
|
+
"""Grant an additional capability to this context."""
|
|
390
|
+
self.manager.grant_capability(self.name, capability)
|
|
391
|
+
self.capabilities.add(capability)
|
|
392
|
+
|
|
393
|
+
def revoke(self, capability: str) -> None:
|
|
394
|
+
"""Revoke a capability from this context."""
|
|
395
|
+
self.manager.revoke_capability(self.name, capability)
|
|
396
|
+
self.capabilities.discard(capability)
|
|
397
|
+
|
|
398
|
+
def check(self, capability: str, *, context: Optional[Dict] = None) -> bool:
|
|
399
|
+
"""Check if the context can access a capability."""
|
|
400
|
+
allowed, _ = self.manager.check_capability(self.name, capability, context)
|
|
401
|
+
return allowed
|
|
402
|
+
|
|
403
|
+
def require(self, capability: str, *, context: Optional[Dict] = None) -> bool:
|
|
404
|
+
"""Require a capability, raising if unavailable."""
|
|
405
|
+
self.manager.require_capability(self.name, capability, context)
|
|
406
|
+
return True
|
|
407
|
+
|
|
408
|
+
def snapshot(self) -> Dict[str, Any]:
|
|
409
|
+
"""Return a serializable snapshot of the context state."""
|
|
410
|
+
return {
|
|
411
|
+
"name": self.name,
|
|
412
|
+
"capabilities": self.manager.get_granted_capabilities(self.name),
|
|
413
|
+
"policy": getattr(self.policy, "name", None),
|
|
414
|
+
"created_at": self.created_at,
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
def destroy(self) -> None:
|
|
418
|
+
"""Revoke all privileges associated with this context."""
|
|
419
|
+
self.manager.revoke_all_capabilities(self.name)
|
|
420
|
+
|
|
294
421
|
|
|
295
422
|
class CapabilityError(Exception):
|
|
296
423
|
"""Exception raised when capability check fails."""
|
|
@@ -370,3 +497,51 @@ CAPABILITY_SETS = {
|
|
|
370
497
|
"description": "Full system access (privileged code)"
|
|
371
498
|
}
|
|
372
499
|
}
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
_DEFAULT_MANAGER: CapabilityManager = CapabilityManager()
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
def get_capability_manager() -> CapabilityManager:
|
|
506
|
+
"""Return the global capability manager singleton."""
|
|
507
|
+
return _DEFAULT_MANAGER
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
def set_capability_manager(manager: CapabilityManager) -> None:
|
|
511
|
+
"""Replace the global capability manager (primarily for tests)."""
|
|
512
|
+
global _DEFAULT_MANAGER
|
|
513
|
+
_DEFAULT_MANAGER = manager
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
def reset_capability_manager(policy: Optional[CapabilityPolicy] = None) -> CapabilityManager:
|
|
517
|
+
"""Reset the global capability manager to a fresh instance."""
|
|
518
|
+
manager = CapabilityManager(default_policy=policy)
|
|
519
|
+
set_capability_manager(manager)
|
|
520
|
+
return manager
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
def check_capability(capability: str, requester: str, *, context: Optional[Dict] = None) -> bool:
|
|
524
|
+
"""Convenience wrapper around the global manager's check."""
|
|
525
|
+
manager = get_capability_manager()
|
|
526
|
+
allowed, _ = manager.check_capability(requester, capability, context)
|
|
527
|
+
return allowed
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
__all__ = [
|
|
531
|
+
"Capability",
|
|
532
|
+
"CapabilityLevel",
|
|
533
|
+
"CapabilityPolicy",
|
|
534
|
+
"CapabilityManager",
|
|
535
|
+
"CapabilityContext",
|
|
536
|
+
"CapabilityError",
|
|
537
|
+
"AllowAllPolicy",
|
|
538
|
+
"DenyAllPolicy",
|
|
539
|
+
"SelectivePolicy",
|
|
540
|
+
"CapabilityAuditLog",
|
|
541
|
+
"CapabilityRequest",
|
|
542
|
+
"CAPABILITY_SETS",
|
|
543
|
+
"get_capability_manager",
|
|
544
|
+
"set_capability_manager",
|
|
545
|
+
"reset_capability_manager",
|
|
546
|
+
"check_capability",
|
|
547
|
+
]
|
|
Binary file
|