set-header name="Content-Type" value should not be redacted by extractor

未关闭 适合新手
#350 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
71/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
azure, node.js, typescript
领域
cli, security

调研方向

首先找到用于遮蔽 API 策略中 set-header 元素值的提取器逻辑,然后检查它如何处理标头名称,以及现有的值遮蔽测试。使用提供的 Content-Type 示例添加或更新测试;当提取结果保留 application/x-www-form-urlencoded,同时机密值仍被遮蔽时,即为完成。

由索引模型根据 Issue 内容生成。

描述

type:bug
Command that triggered the bug

apiops extract

Expected behavior

When extracting an API the value in the a set-header name="Content-Type" should not be redacted as this is a standard header and holds no secret information that needs redacting.

Actual behavior

When extracting an API the extractor replaces the value in set-header name="Content-Type" with "*** REDACTED ***".

Original policy:

<send-request mode="new" response-variable-name="tokenResponseVar" timeout="20" ignore-error="false">
    <set-url>{{base-url}}/authenticate</set-url>
    <set-method>POST</set-method>
    <set-header name="Content-Type" exists-action="override">
        <value>application/x-www-form-urlencoded</value>
    </set-header>
    <set-body>@{
        return $"apikey={{api-password}}";
    }</set-body>
</send-request>

Extracted policy:

<send-request mode="new" response-variable-name="tokenResponseVar" timeout="20" ignore-error="false">
    <set-url>{{base-url}}/authenticate</set-url>
    <set-method>POST</set-method>
    <set-header name="Content-Type" exists-action="override">
        <value>*** REDACTED ***</value>
    </set-header>
    <set-body>@{
        return $"apikey={{api-password}}";
    }</set-body>
</send-request>
apiops CLI version

1.0.5

Environment details

node 22.21.1 x64

CI/CD environment

Azure DevOps

Is this bug blocking you?

Yes

主要语言
TypeScript
星标
44
派生
14
PR 合并指标
30 天内没有已合并 PR

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Azure/apiops-cli 的其他 Issue

查看 Azure/apiops-cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。