初始化99code签名插件商店
This commit is contained in:
@@ -1,3 +1,28 @@
|
|||||||
# 99code-plugins
|
# 99code Java 插件商店
|
||||||
|
|
||||||
99code 受签名 Java 供应商插件商店
|
当前目录是生产后台“插件中心”的默认 Gitea 商店。`registry.json` 使用严格白名单字段;发布插件时应先上传 JAR 与清单,再向索引加入条目。
|
||||||
|
|
||||||
|
## 信任策略
|
||||||
|
|
||||||
|
插件与主应用运行在同一 JVM,必须满足以下任一条件:
|
||||||
|
|
||||||
|
1. JAR 的 SHA-256 位于生产环境变量 `PLUGIN_TRUSTED_SHA256`;
|
||||||
|
2. 清单包含有效 Ed25519 签名,签名公钥通过 `PLUGIN_TRUSTED_ED25519_KEYS=keyId=X509Base64` 配置。
|
||||||
|
|
||||||
|
签名内容是 JAR 的 SHA-256 原始 32 字节,不是十六进制字符串。安装器还会校验清单大小、artifact 大小、JAR 条目数量、解压总量和路径穿越。
|
||||||
|
|
||||||
|
## registry.json 条目
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"id": "example-provider",
|
||||||
|
"name": "示例供应商插件",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "简短说明",
|
||||||
|
"manifest_url": "https://git.example/plugins/raw/branch/main/example-provider/manifest.json",
|
||||||
|
"platforms": ["openai"],
|
||||||
|
"sha256": "64 位小写 SHA-256"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
凭据同步响应支持 `auth-revision`(同时兼容 `auth_revision`)和 `credentials`。敏感 token 只能出现在同步响应或后台的加密 `secrets` 输入中,不得写入清单、registry、普通配置或日志。
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"schema_version": 1,
|
||||||
|
"id": "example-provider",
|
||||||
|
"name": "示例供应商插件",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "实现 ProviderPlugin SPI 的签名 Java 扩展。",
|
||||||
|
"entrypoint": "com.example.plugin.ExampleProviderPlugin",
|
||||||
|
"platforms": [
|
||||||
|
"openai"
|
||||||
|
],
|
||||||
|
"artifact": {
|
||||||
|
"url": "https://git.example/plugins/raw/branch/main/example-provider-1.0.0.jar",
|
||||||
|
"sha256": "替换为 64 位小写 SHA-256",
|
||||||
|
"signature": "替换为对 artifact SHA-256 原始 32 字节签名后的 Base64",
|
||||||
|
"key_id": "release-2026",
|
||||||
|
"size": 1
|
||||||
|
},
|
||||||
|
"credential_sync": {
|
||||||
|
"url": "https://home.example/api/plugin-credentials/example-provider",
|
||||||
|
"status_url": "https://home.example/api/plugin-credentials/example-provider/status",
|
||||||
|
"auth-revision": ""
|
||||||
|
},
|
||||||
|
"metadata": {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"schema_version": 1,
|
||||||
|
"plugins": []
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user