SuperAPI AI 工具集

create-hec-event-integration

编程与开发

查看项目

更新于 10-15 17:26

技能介绍

用途:在 Bitwarden Web 客户端中新增一个 HEC(HTTP Event Collector)事件集成,实现基于令牌(Bearer token)的认证方式。

主要能力:以分步引导方式完成集成接入,包括确认服务名称、认证方式与 logo 资源,并生成对应的常量、特性开关、集成卡片与测试代码。该技能明确仅支持 Token 认证,其他认证方式暂不支持,遇到非 Token 认证时应停止并告知用户。

用法:依次响应提示——服务名(如 Splunk、CrowdStrike、Panther)、认证方式、logo 是否就绪。若提供 logo,按命名约定 logo-<service-name-kebab>-color.svg 与 logo-<service-name-kebab>-darkmode.svg 复制到 apps/web/src/images/integrations/;若未提供,则使用占位路径并加 TODO 注释。随后在 organization-integration-service-type.ts 的 OrganizationIntegrationServiceName 中添加服务名常量,在 feature-flag.enum.ts 中添加枚举项及默认值 FALSE,在 organization-integrations.resolver.ts 中以特性开关注册卡片(name 必须与常量严格一致,integrationType 使用 OrganizationIntegrationType.Hec)。无需修改 IntegrationCardComponent,也无需新增配置/模板类,HEC 服务共用 HecConfiguration 与 HecTemplate。最后在 integration-builder.spec.ts 中为 buildHecConfiguration 与 buildHecTemplate 各添加一个 it 块,并运行 npx jest bitwarden_license/bit-common/src/dirt/organization-integrations/models/integration-builder.spec.ts,确认全部通过。

适用场景:为 Bitwarden 新增或扩展 HEC 类型的事件集成服务。

限制:仅支持 Token 认证;卡片名称与常量值必须完全一致;特性开关默认须设为 FALSE;logo 路径需先复制文件,未就绪则保留 TODO 注释。