【新增】自定义HTTP(S)接口:多步请求引擎与变量公式,签发/部署/告警统一复用 - #545
Open
baiuu wants to merge 9 commits into
Open
Conversation
- 引擎 backend/internal/customapi:多步HTTP请求、{{变量}}插值、公式解释器(摘要/签名/加解密/国密/编码/字符串/逻辑/时间运算)、响应预处理变量(raw可写替换响应体)、成功条件、路径提取、过程/输出变量隔离、JSON只解析一次+纯函数记忆化
- 证书签发:apply 节点新增申请方式 ACME/自定义API(apply_type),access 表 type=custom_api 提供方,cert/key/issuer_cert 输出约定
- 证书部署:deploy 分发器新增 custom_api,注入 cert/key/issuer_cert/domains
- 通知:custom_api 渠道支持内联或引用授权API
- 授权API管理:新增自定义HTTP(S)类型(customApiEditor 公共组件、用途 cert/host/notify、表单内测试按钮+分步结果展示)
# Conflicts: # static/build/index.html # static/build/static/js/Alert-Cf589thE.js # static/build/static/js/Flex-DVww-PpZ.js # static/build/static/js/business-DsNqzX0F.js # static/build/static/js/ca-CMOT8ewm.js # static/build/static/js/ca-CQe6yOnD.js # static/build/static/js/ca-D3iokU27.js # static/build/static/js/data-BT4cyPhJ.js # static/build/static/js/data-DmTOial5.js # static/build/static/js/data-DtlgEkvf.js # static/build/static/js/date-3ggVl0Gc.js # static/build/static/js/esAR-DEUpBT2_.js # static/build/static/js/index-BX-4l-e4.js # static/build/static/js/index-C_7xaCTB.js # static/build/static/js/index-DFCMAzN5.js # static/build/static/js/index-DiXOhavr.js # static/build/static/js/index-p3xydYTo.js # static/build/static/js/monitor-BRvJEJt2.js # static/build/static/js/monitor-CMTlBPN4.js # static/build/static/js/monitor-CuQ_3Y1R.js # static/build/static/js/public-DHd0xZ38.js # static/build/static/js/ruRU-DEXct4zX.js # static/build/static/js/setting-CcD0pBBq.js # static/build/static/js/setting-XPhqR5HY.js # static/build/static/js/setting-hiRo0fjG.js # static/build/static/js/text-BVLn9o7-.js # static/build/static/js/throttle-ChxXn89T.js # static/build/static/js/useStore-BRyiQiLq.js
Author
|
追加DNS 01 认证用api自定义 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
新增通用「自定义HTTP(S)」能力:在授权API管理中维护一种多步 HTTP 请求配置(变量 + 公式 + 多步请求 + 响应处理),同一套配置可被证书签发、证书部署、消息告警三个场景复用。用于对接任意带签名/加解密要求的私有 API(私有 CA、政企、内部通知网关)。
做了什么
多步 HTTP 请求:GET/POST、头部/参数/Cookie/Body(原样发送不重序列化)、忽略 SSL 校验
公式引擎(自研解释器,非动态编译):md5/sha1/sha256/sha512、hmac 系列、rsa_sign/rsa_enc/rsa_dec、aes_cbc/ecb、国密 sm2/sm3/sm4、base64/hex/url/json_escape、/逻辑/时间/随机/整数运算
变量体系:步骤变量(请求前求值)、提取变量(跨步传递)、输出/过程隔离(过程仅公式可见、不进请求、执行完即弃)、延后求值、记忆化、JSON 只解析一次
响应处理:预处理变量链({{raw}} 可读可写、{{headers.X-Auth[0]}} 路径直取)、JSON/XML 解析、成功条件(状态 + 字段比较)
2. 三个使用方
签发:申请节点「ACME / 自定义API」选择,输出 cert/key(/issuer_cert) 入库,复用判定用 ARI 新写法
部署deploy 新增 custom_api,注入 cert/key/issuer_cert/domains(SAN 解析)
告警:通知渠道支持内联或引用授权API,注入 subject/body/domains
3. 管理与测试
授权API管理类型:用途三选一(证书/主机/告警提供商,按用途过滤)、专属图标、公共编辑器
公式助手:快捷标签 + 可搜索分类选择器,光标处插入可嵌套
表单内测试按钮:免保存、按用途注入测试数据真实执行,分步展示状态码/响应体/提取变量
测试
Go 38 个测试函数全部通过(已知向量/密码学往返/深嵌套对照/端到端/记忆化基准 ≈1.6ms)
前端 vue-tsc 无新增报错,vite build ,static/build 已随 PR 重建
兼容性
已并入 dev 的 ARI 协议兼容,复用证书判定采用 FindMatchedCert/certResult 新写法
存量 report 表_api 通知配置结构不变