Pre-compile HAR schema for validation
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- typescript
- 领域
- build-system, security
调研方向
从 src/helpers/har-validator.ts 开始,检查当前如何验证包含的 HAR schema。阅读 Ajv CLI 的 compile-schemas 指南以及仓库的 build 配置,以确定生成的验证代码应放在哪里。完成的标准是:验证不再需要运行时 Ajv 或 unsafe-eval,Ajv 仅作为可选的开发依赖,并且现有的验证测试通过。
由索引模型根据 Issue 内容生成。
描述
Ajv is currently used in httpsnippet for validating the HAR schema passed. Using complete Ajv dependency makes httpsnippet require 'unsafe-eval in the CSP policy, which is a security concern. (https://github.com/ajv-validator/ajv/blob/c3e203c2696e42ec107fe6a5a659fca54b2e4993/docs/security.md#content-security-policy).
As a workaround, since the schema for HAR is known (and already included), it can be pre-compiled into a validation function as part of the build. The Ajv Docs have details on the same.
This would move Ajv from a runtime dependency to a optional developer-dependency (as Ajv-cli) - only needed when har-schema is updated. This would bring a lot more benefits, including performance and bundle size improvements.
This request comes via the Stoplight Elements project, which uses httpsnippet internally. Since httpsnippet doesn't offer a way to pre-compile schemas, this ends up breaking Elements in configurations which limit unsafe-eval via CSP.
- 主要语言
- TypeScript
- 星标
- 1.2k
- 派生
- 245
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Kong/httpsnippet 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 62/100
Kong/httpsnippet#356 ·
-
难度 4/5 3-5 天 新手友好度 35/100
Kong/httpsnippet#397 ·
-
难度 3/5 1-2 天 新手友好度 35/100
Kong/httpsnippet#389 ·
-
难度 5/5 一周以上 新手友好度 25/100
Kong/httpsnippet#383 ·
-
Bug: R Code Generation Does Not Quote Parameters with Special Characters (e.g., `codes[]`)可能已有人在做 @abansal21 于 499 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 35/100
Kong/httpsnippet#379 ·
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
rel: fix
难度 2/5 1-3 小时 新手友好度 68/100
Deltares/fews-web-oc#2400 ·
维护者通常 1 天内回复
-
Command bar: Tab-to-search on claude.ai falls back to Google site: search instead of opening a prompt on Claude可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
ardia-browser/ardia#4426 ·
维护者通常 1 天内回复
-
Bug report: isValidISODateDashOnly accepts text before or after the date-time可能已有人在做 @bardrop 今天认领。 未关闭
难度 1/5 1-3 小时 新手友好度 88/100
pnp/cli-microsoft365#7713 ·
维护者通常 1 天内回复
-
Diagram: Journey Type: Bug / Error
难度 2/5 1-3 小时 新手友好度 62/100
mermaid-js/mermaid-v13#1293 ·
维护者通常 1 天内回复