nonebot-plugin-onebot-luckperms 0.1.1__tar.gz → 0.2.3__tar.gz
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.
- nonebot_plugin_onebot_luckperms-0.2.3/.env.example +227 -0
- nonebot_plugin_onebot_luckperms-0.2.3/MANIFEST.in +9 -0
- nonebot_plugin_onebot_luckperms-0.2.3/PKG-INFO +240 -0
- nonebot_plugin_onebot_luckperms-0.2.3/README.md +216 -0
- nonebot_plugin_onebot_luckperms-0.2.3/README_EN.md +131 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/README.md +80 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/build.ps1 +110 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/pom.xml +24 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/src/main/java/org/oblp/editorbridge/BridgeError.java +55 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/src/main/java/org/oblp/editorbridge/BridgeServer.java +119 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/src/main/java/org/oblp/editorbridge/EditorBridgeExtension.java +27 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/src/main/java/org/oblp/editorbridge/OfficialEditorEngine.java +286 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/src/main/java/org/oblp/editorbridge/RateLimit.java +160 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/src/main/java/org/oblp/editorbridge/RealtimeEditor.java +147 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/src/main/java/org/oblp/editorbridge/StrictJson.java +24 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/src/main/resources/extension.json +1 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/src/profile/5.5.15/java/org/oblp/editorbridge/LpProfile.java +22 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/src/profile/5.5.93/java/org/oblp/editorbridge/LpProfile.java +22 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/src/test/java/org/oblp/editorbridge/AbiLinkageTests.java +42 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/src/test/java/org/oblp/editorbridge/BridgeTests.java +282 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/src/test/java/org/oblp/editorbridge/LifecycleTests.java +82 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/src/test/java/org/oblp/editorbridge/ProfileTests.java +80 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/src/test/java/org/oblp/editorbridge/RealtimeSafetyTests.java +121 -0
- nonebot_plugin_onebot_luckperms-0.2.3/java-editor-bridge/src/test/java/org/oblp/editorbridge/StorageOutcomeTests.java +54 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/__init__.py +279 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/adapter/__init__.py +13 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/adapter/context.py +111 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/adapter/identity.py +81 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/adapter/permission.py +175 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/backend/__init__.py +15 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/backend/client.py +371 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/backend/models.py +183 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/backend/runtime.py +16 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/bootstrap.py +133 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/commands/admin.py +703 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/commands/editor.py +59 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/config.py +61 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/core/__init__.py +9 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/core/context_provider.py +123 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/core/models.py +4 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/core/registry.py +50 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/editor/__init__.py +4 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/editor/bridge.py +821 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/editor/policy.py +395 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/editor/sessions.py +620 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/faults.py +120 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/message.py +292 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/standalone/__init__.py +4 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/standalone/cache.py +233 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/standalone/download.py +440 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/standalone/loader.py +470 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/standalone/process.py +271 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/standalone/retry.py +292 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/standalone/runtime.py +451 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms/standalone/versions.py +132 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms.egg-info/PKG-INFO +240 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms.egg-info/SOURCES.txt +152 -0
- nonebot_plugin_onebot_luckperms-0.2.3/nonebot_plugin_onebot_luckperms.egg-info/requires.txt +15 -0
- {nonebot_plugin_onebot_luckperms-0.1.1 → nonebot_plugin_onebot_luckperms-0.2.3}/pyproject.toml +13 -10
- nonebot_plugin_onebot_luckperms-0.2.3/requirements/ci-inputs.txt +7 -0
- nonebot_plugin_onebot_luckperms-0.2.3/requirements/ci-probe-inputs.txt +3 -0
- nonebot_plugin_onebot_luckperms-0.2.3/requirements/ci-probe.txt +942 -0
- nonebot_plugin_onebot_luckperms-0.2.3/requirements/ci-pydantic1-constraints.txt +2 -0
- nonebot_plugin_onebot_luckperms-0.2.3/requirements/ci-pydantic1.txt +1897 -0
- nonebot_plugin_onebot_luckperms-0.2.3/requirements/ci-pydantic2-constraints.txt +2 -0
- nonebot_plugin_onebot_luckperms-0.2.3/requirements/ci-pydantic2.txt +2014 -0
- nonebot_plugin_onebot_luckperms-0.2.3/scripts/check-upstream.py +358 -0
- nonebot_plugin_onebot_luckperms-0.2.3/scripts/ci-candidate.py +450 -0
- nonebot_plugin_onebot_luckperms-0.2.3/scripts/ci-compatibility.py +809 -0
- nonebot_plugin_onebot_luckperms-0.2.3/scripts/prepare-bridge-resources.ps1 +20 -0
- nonebot_plugin_onebot_luckperms-0.2.3/scripts/prepare-test-bridges.py +96 -0
- nonebot_plugin_onebot_luckperms-0.2.3/scripts/public-cooldown.py +411 -0
- nonebot_plugin_onebot_luckperms-0.2.3/scripts/release-gate.py +379 -0
- nonebot_plugin_onebot_luckperms-0.2.3/scripts/startup-diagnostics.py +220 -0
- nonebot_plugin_onebot_luckperms-0.2.3/scripts/stress-managed.py +591 -0
- nonebot_plugin_onebot_luckperms-0.2.3/scripts/summarize-integration.py +261 -0
- nonebot_plugin_onebot_luckperms-0.2.3/scripts/summarize-tests.py +215 -0
- nonebot_plugin_onebot_luckperms-0.2.3/scripts/test-installed.py +87 -0
- nonebot_plugin_onebot_luckperms-0.2.3/scripts/test-managed.py +781 -0
- nonebot_plugin_onebot_luckperms-0.2.3/scripts/test-official.ps1 +31 -0
- nonebot_plugin_onebot_luckperms-0.2.3/scripts/test-only-bridge.py +180 -0
- nonebot_plugin_onebot_luckperms-0.2.3/scripts/test-required-integration.py +852 -0
- nonebot_plugin_onebot_luckperms-0.2.3/scripts/verify-bridge-assets.py +230 -0
- nonebot_plugin_onebot_luckperms-0.2.3/scripts/verify-release-packages.py +127 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/__init__.py +0 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/cancellation.py +32 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/conftest.py +25 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/official/__init__.py +1 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/official/builtin.py +63 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/official/harness.py +196 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/package_smoke.py +172 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_adapter.py +444 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_backend.py +438 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_bootstrap.py +82 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_bridge_release_download.py +1012 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_cancellation_observation.py +72 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_ci_aggregate_gate.py +68 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_ci_candidate.py +344 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_ci_compatibility.py +601 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_ci_workflow_contract.py +381 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_commands.py +291 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_context.py +149 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_dependency_contract.py +171 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_editor_bridge.py +972 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_editor_chat_integration.py +68 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_editor_commands.py +76 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_editor_official_integration.py +40 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_editor_official_safety.py +225 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_editor_official_security.py +50 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_editor_policy.py +295 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_editor_sessions.py +465 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_envsuperusers.py +165 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_fault_commands.py +530 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_fault_editor.py +525 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_fault_integration.py +282 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_fault_lifecycle.py +475 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_faults.py +103 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_integration_summary.py +298 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_java_probe.py +149 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_managed_config.py +156 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_managed_diagnostics.py +331 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_managed_official_integration.py +93 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_managed_stress.py +498 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_manual_release_workflow.py +1332 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_messages.py +214 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_official_harness.py +229 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_official_integration.py +327 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_only_bridge_helpers.py +290 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_plugin_lifecycle.py +521 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_public_cooldown.py +625 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_public_service_blocked.py +186 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_public_warning_gate.py +393 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_python_workflow.py +75 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_read_retry.py +775 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_realtime_official_integration.py +38 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_realtime_safety.py +174 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_release_gate.py +742 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_required_integration_gate.py +322 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_reserved_group.py +56 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_standalone_cache.py +358 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_standalone_download.py +412 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_standalone_process.py +415 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_standalone_runtime.py +830 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_standalone_versions.py +129 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_startup_diagnostics.py +229 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_test_summary.py +190 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_upstream_candidate.py +330 -0
- nonebot_plugin_onebot_luckperms-0.2.3/tests/test_ux_commands.py +31 -0
- nonebot_plugin_onebot_luckperms-0.1.1/PKG-INFO +0 -510
- nonebot_plugin_onebot_luckperms-0.1.1/README.md +0 -484
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/__init__.py +0 -125
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/adapter/__init__.py +0 -17
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/adapter/context.py +0 -31
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/adapter/identity.py +0 -62
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/adapter/permission.py +0 -157
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/commands/admin.py +0 -854
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/config.py +0 -12
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/core/__init__.py +0 -20
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/core/cache.py +0 -48
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/core/context_provider.py +0 -72
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/core/engine.py +0 -162
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/core/exceptions.py +0 -6
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/core/models.py +0 -123
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/core/registry.py +0 -71
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/message.py +0 -124
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/storage/__init__.py +0 -29
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/storage/memory.py +0 -46
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/storage/protocol.py +0 -21
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/storage/redis.py +0 -161
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/storage/sqlite.py +0 -188
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/webeditor/__init__.py +0 -9
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/webeditor/bytebin.py +0 -70
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/webeditor/manager.py +0 -227
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/webeditor/session.py +0 -108
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms/webeditor/websocket.py +0 -179
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms.egg-info/PKG-INFO +0 -510
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms.egg-info/SOURCES.txt +0 -40
- nonebot_plugin_onebot_luckperms-0.1.1/nonebot_plugin_onebot_luckperms.egg-info/requires.txt +0 -18
- nonebot_plugin_onebot_luckperms-0.1.1/tests/test_borderline.py +0 -125
- nonebot_plugin_onebot_luckperms-0.1.1/tests/test_context.py +0 -189
- nonebot_plugin_onebot_luckperms-0.1.1/tests/test_models.py +0 -205
- nonebot_plugin_onebot_luckperms-0.1.1/tests/test_storage.py +0 -99
- nonebot_plugin_onebot_luckperms-0.1.1/tests/test_webeditor.py +0 -180
- {nonebot_plugin_onebot_luckperms-0.1.1 → nonebot_plugin_onebot_luckperms-0.2.3}/LICENSE +0 -0
- {nonebot_plugin_onebot_luckperms-0.1.1 → nonebot_plugin_onebot_luckperms-0.2.3}/nonebot_plugin_onebot_luckperms/commands/__init__.py +0 -0
- {nonebot_plugin_onebot_luckperms-0.1.1 → nonebot_plugin_onebot_luckperms-0.2.3}/nonebot_plugin_onebot_luckperms/py.typed +0 -0
- {nonebot_plugin_onebot_luckperms-0.1.1 → nonebot_plugin_onebot_luckperms-0.2.3}/nonebot_plugin_onebot_luckperms.egg-info/dependency_links.txt +0 -0
- {nonebot_plugin_onebot_luckperms-0.1.1 → nonebot_plugin_onebot_luckperms-0.2.3}/nonebot_plugin_onebot_luckperms.egg-info/top_level.txt +0 -0
- {nonebot_plugin_onebot_luckperms-0.1.1 → nonebot_plugin_onebot_luckperms-0.2.3}/setup.cfg +0 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# 配置样例 / Configuration example
|
|
2
|
+
# 警告:禁止提交真实账号或服务凭据。
|
|
3
|
+
# Warning: never commit real account IDs or service credentials.
|
|
4
|
+
# 配置赋值均使用默认值。未配置的测试项保留空值。
|
|
5
|
+
# 1. 将所需配置复制到 NoneBot 私有环境文件。
|
|
6
|
+
# 2. 填写管理员账号。
|
|
7
|
+
# 3. 如果后端启用鉴权,填写服务凭据。
|
|
8
|
+
# Assignments use defaults. Copy required settings to your private NoneBot env file.
|
|
9
|
+
# Set administrator IDs and supply credentials when backend authentication is enabled.
|
|
10
|
+
|
|
11
|
+
# 初始管理员 / Initial administrators
|
|
12
|
+
# `SUPERUSERS` 是 NoneBot 官方字段,值为 JSON 数组。
|
|
13
|
+
# 支持裸 QQ 号和 `onebot:` 前缀。默认值是空名单。
|
|
14
|
+
# 在私有配置中填写管理员账号。
|
|
15
|
+
# Official NoneBot field: a JSON array of QQ IDs, optionally prefixed with onebot:.
|
|
16
|
+
# Default: an empty list. Set administrator IDs in private configuration.
|
|
17
|
+
|
|
18
|
+
# 插件在每次启动时重建保留组 `_oblp_builtin_envsuperusers`。
|
|
19
|
+
# 插件给保留组设置 `luckperms.*`,仅为当前名单添加继承。
|
|
20
|
+
# 继承无上下文限制。继承无到期时间。原版显式拒绝仍有效。
|
|
21
|
+
# Startup rebuilds the reserved group with luckperms.* for the current list.
|
|
22
|
+
# Membership has no contexts or expiry. Official explicit denials still apply.
|
|
23
|
+
|
|
24
|
+
# 名单变更在下一次启动生效。插件保留其他手动授权。
|
|
25
|
+
# 如果保留组重建失败,插件停止初始化。
|
|
26
|
+
# List changes take effect on restart. Other manual grants remain.
|
|
27
|
+
# A failed rebuild aborts initialization.
|
|
28
|
+
|
|
29
|
+
# 共享后端的实例必须使用同一名单。
|
|
30
|
+
# 警告:禁止手动使用或修改保留组。
|
|
31
|
+
# 警告:共享后端的实例必须避免并发启动。
|
|
32
|
+
# Shared instances require the same list and must avoid concurrent startup.
|
|
33
|
+
# Do not use or edit the reserved group manually.
|
|
34
|
+
# SUPERUSERS=["123456","onebot:987654"]
|
|
35
|
+
SUPERUSERS=[]
|
|
36
|
+
|
|
37
|
+
# 服务连接 / Service connection
|
|
38
|
+
# 默认 `external`:插件连接已运行的官方 LuckPerms 服务。
|
|
39
|
+
# 后端必须包含 Standalone 和 REST 扩展。
|
|
40
|
+
# 插件不下载外部服务。插件不启动外部服务。插件不关闭外部服务。
|
|
41
|
+
|
|
42
|
+
# `managed`:插件下载经校验的制品,并托管本机 Java 进程。
|
|
43
|
+
# `managed` 的配置见“托管配置”段。
|
|
44
|
+
# external connects to existing official Standalone and REST services without provisioning or stopping them.
|
|
45
|
+
# managed provisions verified artifacts and owns a local JVM. See managed configuration below.
|
|
46
|
+
# 后端部署文档 / Backend deployment guide:
|
|
47
|
+
# https://github.com/LuckPerms/rest-api
|
|
48
|
+
OBLP_BACKEND_MODE=external
|
|
49
|
+
|
|
50
|
+
# REST 服务根地址,默认值如下。地址支持反向代理路径前缀。
|
|
51
|
+
# 跨网络连接必须使用 HTTPS 和鉴权。
|
|
52
|
+
# `managed` 使用自动生成的本机地址,忽略本项。
|
|
53
|
+
# REST base URL, default below. Proxy path prefixes are supported.
|
|
54
|
+
# Use HTTPS and authentication across networks. Managed mode ignores this setting.
|
|
55
|
+
OBLP_REST_URL=http://127.0.0.1:8080
|
|
56
|
+
|
|
57
|
+
# 默认空值:插件不发送 `Authorization` 请求头。
|
|
58
|
+
# 只有后端允许无鉴权访问时,空值才适用。
|
|
59
|
+
# 如果后端启用鉴权,填写后端接受的 Bearer 凭据。
|
|
60
|
+
# 凭据必须具备查询和管理写权限,包括重建保留组。
|
|
61
|
+
# 服务凭据不是聊天用户的权限。`managed` 自动生成凭据,忽略本项。
|
|
62
|
+
# Empty sends no Authorization header and requires a backend allowing unauthenticated access.
|
|
63
|
+
# Otherwise, supply an accepted Bearer credential with read and management-write access.
|
|
64
|
+
# This is not a chat-user grant. Managed mode generates its own credential.
|
|
65
|
+
OBLP_REST_API_KEY=
|
|
66
|
+
|
|
67
|
+
# 单次 REST 请求的超时时间,默认 `10` 秒。
|
|
68
|
+
# 取值必须大于 0 秒,且不超过 120 秒。
|
|
69
|
+
# Per-request REST timeout: 10 seconds; greater than 0 and at most 120.
|
|
70
|
+
OBLP_REQUEST_TIMEOUT=10
|
|
71
|
+
|
|
72
|
+
# 身份解析和上下文收集的总超时时间,默认 `5` 秒。
|
|
73
|
+
# 取值必须大于 0 秒,且不超过 120 秒。
|
|
74
|
+
# 本项不限制后续 REST 查询的总用时。
|
|
75
|
+
# Total identity/context timeout: 5 seconds; greater than 0 and at most 120.
|
|
76
|
+
# This does not bound the combined duration of subsequent REST checks.
|
|
77
|
+
OBLP_CONTEXT_TIMEOUT=5
|
|
78
|
+
|
|
79
|
+
# 编辑桥 / Editor bridge
|
|
80
|
+
# `external` 的编辑桥可选。未配置时,普通 REST 功能仍可用。
|
|
81
|
+
# 安装匹配版本的 Java 扩展后,填写连接配置。
|
|
82
|
+
# Optional in external mode. Ordinary REST operations work without a bridge.
|
|
83
|
+
# Install a matching Java extension before configuring its connection.
|
|
84
|
+
# 安装与扩展配置文档 / Extension installation and configuration:
|
|
85
|
+
# https://github.com/XChen446/nonebot-plugin-onebot-luckperms/tree/master/java-editor-bridge
|
|
86
|
+
# 地址默认空值。地址支持反向代理路径前缀。
|
|
87
|
+
# `managed` 自动生成地址,忽略本项。
|
|
88
|
+
# Empty by default. Proxy path prefixes are supported. Managed mode ignores this setting.
|
|
89
|
+
OBLP_EDITOR_BRIDGE_URL=
|
|
90
|
+
|
|
91
|
+
# 凭据默认空值。填写与 Java 扩展相同的私密 Bearer 凭据。
|
|
92
|
+
# `managed` 自动生成凭据,忽略本项。
|
|
93
|
+
# 警告:禁止向聊天用户发送服务凭据。
|
|
94
|
+
# Empty by default. Supply the same private Bearer credential as the Java extension.
|
|
95
|
+
# Managed mode generates its own credential. Never send service credentials in chat.
|
|
96
|
+
OBLP_EDITOR_BRIDGE_KEY=
|
|
97
|
+
|
|
98
|
+
# 编辑桥请求的超时时间,默认 `30` 秒。
|
|
99
|
+
# 取值必须大于 0 秒,且不超过 120 秒。
|
|
100
|
+
# Bridge request timeout: 30 seconds; greater than 0 and at most 120.
|
|
101
|
+
OBLP_EDITOR_TIMEOUT=30
|
|
102
|
+
|
|
103
|
+
# 外部扩展默认监听 `127.0.0.1:8081`。
|
|
104
|
+
# 容器需要监听全部接口时,在 Java 进程环境中设置:
|
|
105
|
+
# `OBLP_EDITOR_BRIDGE_LISTEN=0.0.0.0`。
|
|
106
|
+
# 警告:宿主端口只能映射到回环地址。
|
|
107
|
+
# 跨网络连接必须使用传输层安全协议(TLS)、鉴权和网络限制。
|
|
108
|
+
# External default: 127.0.0.1:8081. For container-wide listening, set
|
|
109
|
+
# OBLP_EDITOR_BRIDGE_LISTEN=0.0.0.0 in the JVM environment.
|
|
110
|
+
# Bind the host mapping to loopback. Remote access requires TLS, auth and network controls.
|
|
111
|
+
|
|
112
|
+
# 托管配置 / Managed configuration
|
|
113
|
+
# 版本、Java、目录和启动关闭配置仅用于 `managed`。
|
|
114
|
+
# 本机 Java 版本必须不小于 21。
|
|
115
|
+
# 插件不安装 Java。插件不修改系统 `PATH`。
|
|
116
|
+
# These settings apply only to managed mode. A local Java version of at least 21 is required.
|
|
117
|
+
# The plugin does not install Java or modify the system PATH.
|
|
118
|
+
|
|
119
|
+
# 支持的精确版本是 `5.5.15` 和 `5.5.93`。默认版本是 `5.5.93`。
|
|
120
|
+
# 空值或 `latest-compatible` 选择插件最新已验证版本。
|
|
121
|
+
# 插件不跟踪上游 `latest`。插件在下载前拒绝未知版本。
|
|
122
|
+
# 如果升级版本,使用新数据目录并核验迁移结果。
|
|
123
|
+
# Supported exact versions: 5.5.15 and 5.5.93. Default: 5.5.93.
|
|
124
|
+
# Empty or latest-compatible selects the latest reviewed version, not upstream latest.
|
|
125
|
+
# Unknown versions fail before download. Use a new directory and verify migration on upgrades.
|
|
126
|
+
OBLP_STANDALONE_VERSION=5.5.93
|
|
127
|
+
|
|
128
|
+
# Java 可执行文件名或完整路径,默认 `java`。
|
|
129
|
+
# 如果路径包含空格,使用引号包围路径。
|
|
130
|
+
# Java executable name or full path. Default: java. Quote paths containing spaces.
|
|
131
|
+
OBLP_JAVA_COMMAND=java
|
|
132
|
+
|
|
133
|
+
# 默认空值:插件使用 localstore 的插件缓存目录。
|
|
134
|
+
# 插件按内容哈希存储缓存,并在读取时重新校验。
|
|
135
|
+
# Empty selects the localstore plugin cache. Entries are content-addressed and reverified.
|
|
136
|
+
OBLP_STANDALONE_CACHE_DIR=
|
|
137
|
+
|
|
138
|
+
# 默认空值:插件使用 localstore 插件数据目录下的 `standalone`。
|
|
139
|
+
# 目录包含版本标记和排他租约。版本标记不表示启动成功。
|
|
140
|
+
# 插件拒绝已有未标记数据。插件拒绝未知扩展。
|
|
141
|
+
# 插件不自动迁移数据库。
|
|
142
|
+
# Empty selects standalone under the localstore plugin data directory.
|
|
143
|
+
# A version marker records ownership, not readiness. The directory uses an exclusive lease.
|
|
144
|
+
# Existing unmarked data and unknown extensions are rejected. No automatic database migration.
|
|
145
|
+
OBLP_STANDALONE_DATA_DIR=
|
|
146
|
+
|
|
147
|
+
# 租约等待、进程启动及健康检查的超时时间,默认 `60` 秒。
|
|
148
|
+
# 取值必须大于 0 秒,且不超过 300 秒。
|
|
149
|
+
# 下载和 Java 属性查询不计入启动超时时间。
|
|
150
|
+
# Lease wait and spawn/readiness timeout: 60 seconds; greater than 0 and at most 300.
|
|
151
|
+
# Downloads and the Java property query are outside this timeout.
|
|
152
|
+
OBLP_STANDALONE_STARTUP_TIMEOUT=60
|
|
153
|
+
|
|
154
|
+
# 前台关闭的超时时间,默认 `10` 秒。
|
|
155
|
+
# 取值必须大于 0 秒,且不超过 60 秒。
|
|
156
|
+
# 如果关闭超时,插件继续观察清理结果。
|
|
157
|
+
# 插件确认进程退出后才释放租约。插件只关闭自有进程。
|
|
158
|
+
# Foreground shutdown timeout: 10 seconds; greater than 0 and at most 60.
|
|
159
|
+
# Cleanup remains observed after timeout. Release the lease only after confirmed exit.
|
|
160
|
+
# Only plugin-owned processes are stopped.
|
|
161
|
+
OBLP_STANDALONE_SHUTDOWN_TIMEOUT=10
|
|
162
|
+
|
|
163
|
+
# 制品获取 / Artifact acquisition
|
|
164
|
+
# 插件包不内嵌 Java 制品。
|
|
165
|
+
# 托管模式校验 GitHub Container Registry(GHCR)的固定制品。
|
|
166
|
+
# 校验内容包括开放容器标准(OCI)层和 Java 归档(JAR)的哈希。
|
|
167
|
+
# No Java artifacts are bundled. Managed mode verifies pinned official GHCR layers and JARs.
|
|
168
|
+
|
|
169
|
+
# 编辑桥取自安装版本对应的正式 GitHub Release。
|
|
170
|
+
# 编辑桥按 `5.5.15` 和 `5.5.93` 两个精确版本分别发布。
|
|
171
|
+
# GitHub HTTPS API 提供制品摘要和大小。
|
|
172
|
+
# 缓存命中时,插件仍查询 API 并重新校验。
|
|
173
|
+
# The bridge comes from the installed package version's stable GitHub Release.
|
|
174
|
+
# Profiles target the two exact LP versions. Cache hits require fresh API digest/size metadata.
|
|
175
|
+
|
|
176
|
+
# 信任来源是 GitHub 和仓库维护者。
|
|
177
|
+
# 编辑桥没有独立签名。插件包不固定编辑桥哈希。
|
|
178
|
+
|
|
179
|
+
# 如果正式资产或摘要缺失,插件停止启动。
|
|
180
|
+
# 如果制品校验失败,插件停止启动。
|
|
181
|
+
# 插件不切换备用版本。插件不使用内嵌备用文件。
|
|
182
|
+
# This trusts GitHub and repository maintainers, not an independent bridge signature or package pin.
|
|
183
|
+
# Missing assets/digests or failed validation abort startup. No version or embedded fallback.
|
|
184
|
+
|
|
185
|
+
# 插件优先从 `gh-proxy.org` 镜像下载编辑桥字节。
|
|
186
|
+
# 如果镜像下载失败,插件从官方源下载。
|
|
187
|
+
# 镜像不提供摘要校验依据。
|
|
188
|
+
# Bridge bytes use gh-proxy.org first, then the official source. The API remains authoritative.
|
|
189
|
+
|
|
190
|
+
# 下载不设总超时时间。暂态断连和连接重置(RST)触发有限重试。
|
|
191
|
+
# 桥 GET 请求遇到 `403` 或 `429` 时,最多重试 3 次。
|
|
192
|
+
# 重试等待时间依次为 20 秒、40 秒、60 秒。
|
|
193
|
+
# 如果 `Retry-After` 更长,插件使用更长的等待时间。
|
|
194
|
+
|
|
195
|
+
# 每个操作最多尝试 4 次。整条获取链最多发送 32 次请求。
|
|
196
|
+
# 警告:禁止重放结果未知的写入请求。
|
|
197
|
+
# Downloads have no elapsed-time cap. Transient disconnects and RST have bounded retries.
|
|
198
|
+
# Bridge GET 403/429: at most 3 retries, waiting 20/40/60 seconds or longer Retry-After.
|
|
199
|
+
# At most 4 attempts per operation and 32 requests per chain. Never replay unknown writes.
|
|
200
|
+
|
|
201
|
+
# GitHub 个人访问令牌(PAT)不是必需项。
|
|
202
|
+
# 持续集成(CI)下载请求支持私下配置 `GH_TOKEN`。
|
|
203
|
+
# 插件仅向固定 GitHub API 发送 GitHub 凭据。
|
|
204
|
+
# Java 进程、镜像和资产下载域名不会收到 GitHub 凭据。
|
|
205
|
+
# No PAT is required. CI may privately set GH_TOKEN; only the fixed API receives it.
|
|
206
|
+
# GitHub credentials are not forwarded to Java, mirrors or asset download hosts.
|
|
207
|
+
|
|
208
|
+
# 隔离测试 / Isolated tests
|
|
209
|
+
# 警告:测试配置禁止指向生产后端。
|
|
210
|
+
# 以下配置仅用于测试。测试后端必须独立且支持写入。
|
|
211
|
+
# 未准备好测试后端时,保留配置项前的注释标记。
|
|
212
|
+
# Warning: never target production. These settings are test-only.
|
|
213
|
+
# Keep the settings commented until a separate writable backend is ready.
|
|
214
|
+
# OBLP_INTEGRATION_URL=
|
|
215
|
+
# OBLP_INTEGRATION_API_KEY=
|
|
216
|
+
# OBLP_INTEGRATION_ALLOW_WRITES=
|
|
217
|
+
|
|
218
|
+
# 测试配置默认未设置。测试不会获得写入许可。
|
|
219
|
+
|
|
220
|
+
# `OBLP_INTEGRATION_URL` 是隔离 REST 地址。
|
|
221
|
+
# `OBLP_INTEGRATION_API_KEY` 是测试后端的私密凭据。
|
|
222
|
+
# 如果允许隔离测试写入,设置 `OBLP_INTEGRATION_ALLOW_WRITES=1`。
|
|
223
|
+
# 测试后端必须使用空 `default` 组、默认计算器和 H2/SQL 存储。
|
|
224
|
+
# 测试只写入随机主体。测试必须完整清理随机主体。
|
|
225
|
+
# URL targets isolated REST; API_KEY is its private credential; ALLOW_WRITES=1 authorizes writes.
|
|
226
|
+
# Tests require an empty default group, default calculators and H2/SQL storage.
|
|
227
|
+
# Tests write to random subjects and must clean them completely.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
include README.md README_EN.md
|
|
2
|
+
recursive-include java-editor-bridge/src *.java *.json
|
|
3
|
+
include java-editor-bridge/pom.xml java-editor-bridge/build.ps1 java-editor-bridge/README.md
|
|
4
|
+
include .env.example
|
|
5
|
+
recursive-include tests *.py
|
|
6
|
+
recursive-include scripts *.ps1 *.py
|
|
7
|
+
recursive-include requirements *.txt
|
|
8
|
+
prune nonebot_plugin_onebot_luckperms/standalone/resources
|
|
9
|
+
global-exclude *.jar *.class
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nonebot-plugin-onebot-luckperms
|
|
3
|
+
Version: 0.2.3
|
|
4
|
+
Summary: Official LuckPerms REST integration for NoneBot2 + OneBot
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/XChen446/nonebot-plugin-onebot-luckperms
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: nonebot2<3,>=2.5.0
|
|
11
|
+
Requires-Dist: nonebot-adapter-onebot<3,>=2.4.6
|
|
12
|
+
Requires-Dist: nonebot-plugin-localstore>=0.6.0
|
|
13
|
+
Requires-Dist: pydantic<3,>=1.10.0
|
|
14
|
+
Requires-Dist: aiohttp<4,>=3.14.1
|
|
15
|
+
Requires-Dist: pyyaml>=6.0
|
|
16
|
+
Requires-Dist: java-utilities<1,>=0.3.0
|
|
17
|
+
Provides-Extra: test
|
|
18
|
+
Requires-Dist: pytest>=9.0; extra == "test"
|
|
19
|
+
Requires-Dist: pytest-asyncio>=1.4; extra == "test"
|
|
20
|
+
Requires-Dist: build>=1.2; extra == "test"
|
|
21
|
+
Provides-Extra: all
|
|
22
|
+
Requires-Dist: nonebot-plugin-onebot-luckperms[test]; extra == "all"
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
|
|
25
|
+
# nonebot-plugin-onebot-luckperms(OBLP)
|
|
26
|
+
|
|
27
|
+
[](https://pepy.tech/projects/nonebot-plugin-onebot-luckperms)
|
|
28
|
+
|
|
29
|
+
NoneBot2 + OneBot v11 的 **官方 LuckPerms REST 适配插件**。权限解析、继承、上下文匹配、临时节点和持久化由官方 Standalone 完成,Python 不实现另一套权限引擎。
|
|
30
|
+
|
|
31
|
+
> **0.2 是破坏性重构。** 不再提供 memory/SQLite/Redis 权限后端、`get_store`、`User/Group` 本地求值或默认角色授权。旧数据不会自动读取、删除或迁移。先备份旧数据,再在隔离环境核对原版语义。
|
|
32
|
+
>
|
|
33
|
+
> 初始管理员与服务连接配置见[配置样例](<.env.example>)。
|
|
34
|
+
|
|
35
|
+
English: [README_EN.md](./README_EN.md)
|
|
36
|
+
|
|
37
|
+
## 快速开始
|
|
38
|
+
|
|
39
|
+
默认连接已运行的官方 LuckPerms 服务。
|
|
40
|
+
后端部署参考[官方 REST 文档](https://github.com/LuckPerms/rest-api)。
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install nonebot-plugin-onebot-luckperms
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```toml
|
|
47
|
+
[tool.nonebot]
|
|
48
|
+
plugins = ["nonebot_plugin_onebot_luckperms"]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
1. 打开[配置样例](<.env.example>)。
|
|
52
|
+
2. 将所需配置复制到私有环境文件。
|
|
53
|
+
3. 替换示例账号和服务凭据。
|
|
54
|
+
4. 启动 NoneBot。
|
|
55
|
+
|
|
56
|
+
配置样例说明全部运行环境变量、默认值和适用条件。
|
|
57
|
+
样例也包含初始管理员、编辑桥和可选托管配置。
|
|
58
|
+
|
|
59
|
+
插件将 OneBot 账号映射为稳定 UUID。
|
|
60
|
+
群聊和私聊使用同一主体,群号和角色作为上下文。
|
|
61
|
+
使用 `/lp whoami` 查看自己的主体。
|
|
62
|
+
官方控制台使用映射 UUID,不能直接使用 QQ 号。
|
|
63
|
+
|
|
64
|
+
远程服务使用 HTTPS 和鉴权。
|
|
65
|
+
启动健康检查失败会阻止初始化。
|
|
66
|
+
未定义权限或检查故障会拒绝访问。
|
|
67
|
+
插件不缓存授权结果,也不重放未知写入。
|
|
68
|
+
跨实例同步参考[官方同步文档](https://github.com/LuckPerms/wiki/blob/master/pages/Syncing-data-between-servers.md)。
|
|
69
|
+
|
|
70
|
+
## 使用权限入口
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
from nonebot import on_command
|
|
74
|
+
from nonebot_plugin_onebot_luckperms import register_node, require
|
|
75
|
+
|
|
76
|
+
register_node("demo.ban", "禁言命令", default=False)
|
|
77
|
+
ban = on_command("ban", permission=require("demo.ban"))
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`QueryOptions`采用原版五个默认标志。当前固定REST不能接收空flags数组;关闭继承时只移除 `resolve_inheritance`,保留其他四个标志。健康响应按实际 `healthy` 字段验证,用户创建outcomes保留原版大写枚举,不按有误的OpenAPI示例转换。
|
|
81
|
+
|
|
82
|
+
注册仅保存发现元数据,不授予权限。`default=True` 会报错;默认授权应在原版 `default` 组配置,可带上下文。旧版普通前缀允许、父键拒绝、任意位置通配符等规则不再作为兼容保证,以原版配置及计算器结果为准。
|
|
83
|
+
|
|
84
|
+
`require_any("node.a", "node.b")` 与 `require_all(...)` 组合原版单节点结果,不自行解析继承。空节点集合是配置错误。使用 `require(...) | GROUP_ADMIN` 等原生OR组合会显式引入另一条授权路径,不再是只由LuckPerms控制。
|
|
85
|
+
|
|
86
|
+
### 可信上下文
|
|
87
|
+
|
|
88
|
+
| 键 | 来源 |
|
|
89
|
+
|---|---|
|
|
90
|
+
| `platform` | 身份解析器 |
|
|
91
|
+
| `user_id` | 外部用户ID |
|
|
92
|
+
| `group_id` | 群号,仅群聊 |
|
|
93
|
+
| `role` | 实际群角色 owner/admin/member;私聊为member |
|
|
94
|
+
| `bot_id` | 当前机器人ID |
|
|
95
|
+
|
|
96
|
+
自定义provider必须声明非空键集合,不能覆写保留键或其他provider的键,返回键必须已声明。失败或超时拒绝本次授权,不忽略异常后继续grant。
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
from nonebot_plugin_onebot_luckperms import register_context_provider
|
|
100
|
+
|
|
101
|
+
class BindProvider:
|
|
102
|
+
context_keys = {"bind"}
|
|
103
|
+
|
|
104
|
+
async def __call__(self, bot, event, current_ctx):
|
|
105
|
+
return {"bind": "true"}
|
|
106
|
+
|
|
107
|
+
register_context_provider(BindProvider())
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`ContextSet.from_pairs` / `to_pairs`保留同键多值。`to_dict`遇多值拒绝转换,不能悄悄取第一个值。自定义provider是受信代码,应根据可信业务来源产生上下文,不能照抄聊天者自报角色。
|
|
111
|
+
|
|
112
|
+
### 获取检查证据
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
from nonebot_plugin_onebot_luckperms import get_context
|
|
116
|
+
|
|
117
|
+
ctx = get_context()
|
|
118
|
+
if ctx:
|
|
119
|
+
print(ctx.subject_id)
|
|
120
|
+
print(ctx.identity.role)
|
|
121
|
+
print(ctx.decisions)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
`LPContext.decisions`只包含本次实际查询的节点与原版三态结果,不是全部有效权限快照。旧 `ctx.user` 和 `ctx.resolved_nodes` 已删除。
|
|
125
|
+
|
|
126
|
+
权限封装显式将 NoneBot 子任务证据传回当前 matcher 任务,并校验当前机器人、事件和权限作用域。多个独立 OBLP checker 的 OR 组合没有唯一快照时返回 `None`;仅由原生权限放行时也不提供 OBLP 命中证据。不要手动拆出 checker 重新构造原生 `Permission`,那会丢失证据传递封装。
|
|
127
|
+
|
|
128
|
+
## 聊天管理边界
|
|
129
|
+
|
|
130
|
+
`/lp`是对官方REST的受限封装,不是任意原版控制台命令执行器。每次管理授权检查具体操作权限节点,没有本地 `luckperms.*` 兜底;通配符是否匹配由原版决定。
|
|
131
|
+
|
|
132
|
+
常用操作包括用户/组节点、带上下文的继承节点、临时节点、组权重与显示名、轨道及原版权限检查。具体语法以 `/lp help` 当前实现为准。针对平台用户的目标为裸ID(默认v11)、`platform:<平台>:<id>`或`uuid:<UUID>`。
|
|
133
|
+
|
|
134
|
+
```text
|
|
135
|
+
/lp createuser 123456
|
|
136
|
+
/lp user 123456 permission set demo.ban true group_id=987654
|
|
137
|
+
/lp user 123456 permission settemp demo.kick false 30m
|
|
138
|
+
/lp user 123456 parent add admin group_id=987654
|
|
139
|
+
/lp check 123456 demo.ban group_id=987654
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
重复context键表示多值,不会覆盖早先的值。继承使用原版 `group.<name>` 节点,保留其上下文与到期时间。晋升/降级通过原版track端点,不再把轨道名当组名。
|
|
143
|
+
|
|
144
|
+
需要先删再加的操作不具备跨请求原子性;请求失败后不能宣称整体成功或自动回滚。精确删除保留官方节点属性,空匹配不会触发全量清空。用户列表来自官方unique users,不能当作全量平台注册表。
|
|
145
|
+
|
|
146
|
+
### 编辑器与不支持的操作
|
|
147
|
+
|
|
148
|
+
官方REST本身没有editor接口,本项目通过明确版本 **LuckPerms5.5.15/5.5.93 Java扩展桥**调用原版编辑数据生成、bytebin会话登记与应用。支持:
|
|
149
|
+
|
|
150
|
+
```text
|
|
151
|
+
/lp editor
|
|
152
|
+
/lp user 123456 editor
|
|
153
|
+
/lp group staff editor
|
|
154
|
+
/lp trusteditor <页面/聊天提示的 xxxx-xxxx 确认码>
|
|
155
|
+
/lp applyedits <官方页面生成的应用码>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
已在真实官网完成添加节点、保存应用码、Java应用和官方REST读回;global/user/group三种聊天入口也已实际验证。第一阶段只编辑会话中已有用户/组的权限、永久继承、组权重/显示名;不支持创建/删除持有者、track编辑、修改meta/prefix/suffix、临时或false继承/权重/显示名。未变的特殊节点原样保留。**支持原版trust与实时应用**:打开页面后,当前聊天会收到信任确认提示;确认这是本人打开的浏览器,再执行 `trusteditor`。连接建立后网页保存自动经同一受控终审应用并生成后续会话,结果回显当前聊天,可连续编辑。手动 `applyedits` 仍可使用;不是打开默认绕过预检的socket处理器。
|
|
159
|
+
|
|
160
|
+
### 安装编辑桥
|
|
161
|
+
|
|
162
|
+
按[Java 扩展指南](<java-editor-bridge/README.md>)安装匹配版本的扩展。
|
|
163
|
+
连接配置和凭据说明见[配置样例](<.env.example>)。
|
|
164
|
+
未启用编辑桥时,普通 REST 命令仍可用。
|
|
165
|
+
|
|
166
|
+
### 会话与应用边界
|
|
167
|
+
|
|
168
|
+
创建和应用均重新查官方权限,逐项参数/上下文/目标组检查;绑定owner UUID+bot。手动应用使用当次聊天上下文;实时连接没有新聊天event,使用创建时固定可信上下文并每次刷新官方权限,不宣称角色/群状态会自动更新。15分钟到期、未知/他人会话、重放、scope扩大、快照变化与保留组/继承变更拒绝。混合批次在写前完整预检。失败或超时结果未知,不盲重试;跨实体应用不是事务,部分应用如实提示。
|
|
169
|
+
|
|
170
|
+
链接会回显当前聊天,不保证私聊发送,请不要转发。持服务key可委派身份,key必须保密。官网自有服务首页公告不代表上传API停服,实际POST与页面均已验证。
|
|
171
|
+
|
|
172
|
+
**单写者边界:**编辑应用期间不要从官方控制台、其他REST客户端或其他实例并发修改同一数据。桥接锁不覆盖这些入口,不承诺全局CAS或外部改写原子隔离。配置开启argument-based与组成员限制时也已进行真实拒绝验收。
|
|
173
|
+
|
|
174
|
+
没有安全直接契约的重命名级联、克隆等也不伪装支持。不要依靠旧版文档中的命令存在性推断此版本能力。
|
|
175
|
+
|
|
176
|
+
## 从旧版迁移
|
|
177
|
+
|
|
178
|
+
1. 备份旧SQLite/Redis数据,不在生产环境直接试迁移。
|
|
179
|
+
2. 映射用户ID到UUID;将parents/groups转换为原版继承节点。
|
|
180
|
+
3. 将权限、否定、上下文和expiry导入隔离官方后端。
|
|
181
|
+
4. 核对显式拒绝、通配符、组冲突、临时到期与撤权。不要保留旧默认管理授权错误。
|
|
182
|
+
5. 更新依赖旧 `get_store/User/Group/resolved_nodes` 的插件,再切换。
|
|
183
|
+
|
|
184
|
+
本次不提供静默自动迁移。语义不同的节点必须人工审查,不能按字段相似度宣称无损。
|
|
185
|
+
|
|
186
|
+
## 开发与验收
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
pip install -e ".[test]"
|
|
190
|
+
python -m pytest tests -v
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
协议测试和平台测试可以在不运行官方后端时执行,但mock通过不能证明原版语义已经实测。真实集成测试使用单独可写后端和显式写入许可;未配置时会跳过,交付需区分跳过与通过。
|
|
194
|
+
|
|
195
|
+
真实验收使用空 default 组、默认计算器配置与 H2/SQL 存储的隔离后端。仅测试随机主体与组,并精确清理,不允许指向生产服务。
|
|
196
|
+
|
|
197
|
+
测试环境变量和隔离前提见[配置样例](<.env.example>)的隔离测试段。
|
|
198
|
+
准备好隔离后端后,执行:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
python -m pytest tests/test_official_integration.py -v
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
测试结果以对应提交的 CI 作业为准;外部集成未运行或跳过不算通过。
|
|
205
|
+
|
|
206
|
+
参考:[官方规格](https://github.com/LuckPerms/rest-api/blob/main/src/main/resources/luckperms-openapi.yml)。
|
|
207
|
+
|
|
208
|
+
## CI兼容矩阵与隔离压力检查
|
|
209
|
+
|
|
210
|
+
[统一测试工作流](<.github/workflows/test.yml>)在每次 push、pull_request 触发,不设置分支、标签或路径过滤。GitHub 平台仍会识别 `[skip ci]` 等跳过标记;工作流不能绕过平台规则。Python矩阵通过独立可复用[python-tests工作流](<.github/workflows/python-tests.yml>)分组:3.10/Pydantic1及3.10–3.15/Pydantic2,共七格;与LuckPerms矩阵并列。各格都执行完整源码测试和独立安装检查。CI 不自动发布。
|
|
211
|
+
|
|
212
|
+
LP5.5.15、5.5.93、真实上游latest与Java21/25组成六格矩阵,聚合测试必须源码、安装轮子及全部格成功。latest每次解析官方快照后实际构建/ABI/运行,未兼容可在CI失败但不会自动扩大生产清单;独立只读探测继续保留。压力定时/all按同三通道运行,只测试自有隔离REST与bridgehealth,不压测官网编辑服务。
|
|
213
|
+
|
|
214
|
+
CI 使用精确哈希依赖锁,构建和 wheel 安装不二次解析依赖。完整兼容结果以对应提交的 Actions 作业为准,不以工作流配置代替实际执行。托管启动先严格验证桥的官方整体就绪状态,再检查 REST,避免探测尚在注册中的服务;就绪后出现的 500、鉴权失败或畸形健康响应仍立即失败。
|
|
215
|
+
|
|
216
|
+
全量源码步骤直接生成收集/通过/失败/错误/跳过摘要,Java兼容阶段显示prepare、六suite+ABI、真实运行与finalize。额外required本地集成为9项无公网门禁,完整28项公网功能套件仅低频显式/每周有预算运行;缺环境、skip、cleanup不确认都不能通过。直接确认的官方公网429/502/503/504阻塞会发出 Python warning,并记录为 `WARN`/未验证,不算测试通过;遇阻塞停止后续请求,不重试写入。普通集成允许以告警结束,正式发布使用 `--require-complete`,仍要求完整28项通过。断言失败、权限错误、未知写入结果及清理失败始终阻断。
|
|
217
|
+
|
|
218
|
+
运行时下载的只读 GET 对暂态网络错误(包括 RST)使用有限次数退避,不设总下载截止;每操作最多4尝试、整链最多32请求,校验哈希和大小不放宽。独立只读上游探测仍有自己的120秒探测窗口,不限制运行时下载。功能集成跨子进程共享请求预算/冷却,但未确认拒绝语义的上传、apply、trust及未知写入不重试;压测保持429停止。
|
|
219
|
+
|
|
220
|
+
## 手动发布
|
|
221
|
+
|
|
222
|
+
在 Actions 中从可信 `master` 工作流运行 [release-and-publish](<.github/workflows/publish.yml>),选择 `publish_target` 即可。`target_branch` 默认 `master`;`release_tag` 留空时,程序固定该分支 HEAD,沿所有提交父边寻找距离最近的合法版本标签,不按标签创建日期或版本号大小选择。不需要填写 SHA。可填写已有祖先标签作为覆盖;无标签或最近位置存在多个候选时失败。
|
|
223
|
+
|
|
224
|
+
- `none`:只验证和构建,不创建 GitHub Release 或上传 PyPI;**仍会执行一次有预算的公网28项集成**。
|
|
225
|
+
- `PYPI`:验证通过后发布完整 GitHub Release 桥资产,再上传正式 PyPI。
|
|
226
|
+
- `testPYPI`:发布完整 GitHub Release 桥资产,再上传 TestPyPI。
|
|
227
|
+
|
|
228
|
+
发现后冻结标签及其 SHA:即使目标分支 HEAD 在标签之后,也只发布标签对应的代码,不把后续未标记代码冒充该版本。整个过程不创建或移动标签。可信发布工具仍来自默认分支,与待发布源码分离。
|
|
229
|
+
|
|
230
|
+
同一次运行会重新执行冻结 SHA 的七组 Python、六组 LP/Java、本地真实集成和完整公网集成。无发布权限的构建与 CI 并行,检查包元数据及 SHA-256;发布仍需所有验收、清理和构建成功。发布前再次核对标签;不创建或移动标签,不复用无关提交的 CI 绿灯。构建没有发布权限,发布任务只执行可信默认分支的校验工具与制品上传,不执行标签源码。
|
|
231
|
+
|
|
232
|
+
需预先配置对应 `pypi` / `testpypi` environment 和 Trusted Publisher,工作流文件名保持 `publish.yml`。GitHub Release 先以草稿上传并校验两个桥 JAR、两个 Python 包和两份制品清单,资产完整可下载后才公开,再允许 PyPI 上传,避免安装时缺桥。发布前的 CI 使用同一源码构建并校验的桥资产,不依赖尚未发布的 Release;这些测试入口不向生产加载器开放任意本地 JAR。
|
|
233
|
+
|
|
234
|
+
警告:工作流不会覆盖或删除已有 Release。GitHub 支持同标签多个草稿,重跑可能创建新草稿。工作流只校验并公开本次创建输出对应的 Release ID。保留失败草稿,核对原运行的标签、制品摘要和验收结果后单独恢复。
|
|
235
|
+
|
|
236
|
+
PyPI 与 GitHub Release 不是原子事务。Release 公开后,如果 PyPI 上传失败,保留可用资产并人工恢复。禁止盲目覆盖版本或标签。
|
|
237
|
+
|
|
238
|
+
## License
|
|
239
|
+
|
|
240
|
+
MIT
|