{
  "tags": [
    "CC 防护"
  ],
  "description": "按 ID 获取一条 CC 过滤器的原始配置记录。系统内置过滤器仅管理员身份可以读取；用户自定义过滤器仅允许其所属用户读取，管理员身份本身不会绕过自定义过滤器的所有者校验。返回的是 `cc_filter` 记录本身，不包含列表接口联表得到的任务状态、用户名或格式化时间字段；`extra` 为序列化后的扩展配置 JSON 字符串，使用前需要再次解析。",
  "operationId": "user_get_v1_cc_filters_filter_id",
  "security": [
    {
      "AccessToken": []
    },
    {
      "ApiKey": [],
      "ApiSecret": []
    }
  ],
  "responses": {
    "200": {
      "description": "业务结果通过 HTTP 200 返回。过滤器存在且当前身份有读取权限时返回完整原始配置；记录不存在、读取内置过滤器时不是管理员、读取其他用户的自定义过滤器或认证失效时返回字符串业务错误码。",
      "content": {
        "application/json": {
          "schema": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "integer",
                    "enum": [
                      0
                    ],
                    "description": "成功状态码，过滤器详情读取成功时固定为 0。"
                  },
                  "msg": {
                    "type": "string",
                    "enum": [
                      ""
                    ],
                    "description": "详情读取成功时没有附加提示，固定为空字符串。"
                  },
                  "data": {
                    "type": "object",
                    "required": [
                      "id",
                      "uid",
                      "name",
                      "des",
                      "type",
                      "within_second",
                      "max_req",
                      "max_req_per_uri",
                      "extra",
                      "create_at",
                      "update_at",
                      "internal",
                      "enable",
                      "task_id",
                      "version"
                    ],
                    "properties": {
                      "id": {
                        "type": "integer",
                        "format": "int64",
                        "description": "CC 过滤器的唯一 ID。"
                      },
                      "uid": {
                        "type": "integer",
                        "format": "int64",
                        "nullable": true,
                        "description": "过滤器所属用户的 ID；系统内置过滤器不归属于具体用户时为 null。"
                      },
                      "name": {
                        "type": "string",
                        "description": "过滤器名称，同一所属用户下不可重名。"
                      },
                      "des": {
                        "type": "string",
                        "description": "过滤器备注，可为空字符串。"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "easy_click_filter",
                          "easy_slide_filter",
                          "req_rate",
                          "302_challenge",
                          "browser_verify_auto",
                          "slide_filter",
                          "captcha_filter",
                          "click_filter",
                          "url_auth",
                          "delay_jump_filter",
                          "rotate_filter"
                        ],
                        "description": "过滤器实现类型，决定达到请求阈值后采用的防护行为。"
                      },
                      "within_second": {
                        "type": "integer",
                        "format": "int32",
                        "description": "请求统计窗口的秒数。"
                      },
                      "max_req": {
                        "type": "integer",
                        "format": "int32",
                        "description": "统计窗口内允许的最大请求数。"
                      },
                      "max_req_per_uri": {
                        "type": "integer",
                        "format": "int32",
                        "description": "`req_rate` 类型下同一 URI 在统计窗口内允许的最大请求数；其他类型通常为 0。"
                      },
                      "extra": {
                        "type": "string",
                        "description": "序列化后的扩展配置 JSON。`url_auth` 类型包含 URL 鉴权模式及签名参数，其他类型通常为 `{}`。"
                      },
                      "create_at": {
                        "type": "string",
                        "nullable": true,
                        "description": "数据库返回的过滤器创建时间；历史记录未保存时间时为 null。"
                      },
                      "update_at": {
                        "type": "string",
                        "nullable": true,
                        "description": "数据库返回的过滤器最后更新时间；历史记录未保存时间时为 null。"
                      },
                      "internal": {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ],
                        "description": "是否为系统内置过滤器：1 表示内置，0 表示用户自定义。"
                      },
                      "enable": {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ],
                        "description": "过滤器启用状态：1 表示启用，0 表示禁用。"
                      },
                      "task_id": {
                        "type": "integer",
                        "format": "int64",
                        "nullable": true,
                        "description": "最近一次过滤器同步或删除任务的 ID；没有关联任务时为 null。"
                      },
                      "version": {
                        "type": "integer",
                        "format": "int64",
                        "description": "过滤器配置版本号，每次更新时递增。"
                      }
                    },
                    "additionalProperties": false,
                    "description": "数据库中的 CC 过滤器原始配置记录。"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "cc_filter-31",
                      "cc_filter-32",
                      "cc_filter-58",
                      "login_required"
                    ],
                    "description": "业务错误码：`cc_filter-31` 表示过滤器不存在，`cc_filter-32` 表示当前用户不是自定义过滤器的所有者，`cc_filter-58` 表示非管理员尝试读取系统内置过滤器，`login_required` 表示认证无效。"
                  },
                  "msg": {
                    "type": "string",
                    "description": "与业务错误码对应的中文记录不存在、所有权、管理员权限或认证失败原因。"
                  },
                  "data": {
                    "type": "string",
                    "enum": [
                      ""
                    ],
                    "description": "业务错误时固定为空字符串。"
                  }
                },
                "additionalProperties": false
              }
            ]
          },
          "example": {
            "code": 0,
            "msg": "",
            "data": {
              "id": 10021,
              "uid": 2,
              "name": "请求频率限制",
              "des": "限制短时间内对同一 URI 的重复请求",
              "type": "req_rate",
              "within_second": 60,
              "max_req": 100,
              "max_req_per_uri": 20,
              "extra": "{}",
              "create_at": "Thu, 25 Nov 2021 14:36:29 GMT",
              "update_at": "Thu, 25 Nov 2021 14:36:29 GMT",
              "internal": 0,
              "enable": 1,
              "task_id": null,
              "version": 1
            }
          }
        }
      }
    }
  },
  "x-python-handler": "site.CCFilterAPI",
  "x-python-route-line": 399,
  "x-audience": "user",
  "x-auth": "user",
  "x-reviewed": true,
  "parameters": [
    {
      "name": "filter_id",
      "in": "path",
      "required": true,
      "description": "要查询的 CC 过滤器 ID；路由只接受十进制整数。",
      "schema": {
        "type": "integer",
        "format": "int64",
        "minimum": 1
      },
      "example": 10021
    }
  ],
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "site.CCFilterAPI"
    },
    {
      "key": "x-python-route-line",
      "value": 399
    },
    {
      "key": "x-audience",
      "value": "user"
    },
    {
      "key": "x-auth",
      "value": "user"
    },
    {
      "key": "x-reviewed",
      "value": true
    },
    {
      "key": "x-itecdn-source-reviewed",
      "value": true
    }
  ],
  "method": "get",
  "path": "/v1/cc-filters/{filter_id}",
  "servers": [
    {
      "url": "https://master.example.invalid",
      "description": "不可调用的示例地址；复制示例后替换为自己的主控域名。"
    }
  ],
  "securitySchemes": {
    "AccessToken": {
      "type": "apiKey",
      "in": "header",
      "name": "access-token",
      "description": "通过登录接口获得的短期访问令牌。"
    },
    "ApiKey": {
      "type": "apiKey",
      "in": "header",
      "name": "api-key",
      "description": "API Key；必须和 api-secret 同时发送。"
    },
    "ApiSecret": {
      "type": "apiKey",
      "in": "header",
      "name": "api-secret",
      "description": "API Secret；必须和 api-key 同时发送。"
    }
  },
  "info": {
    "title": "itecdn v5 用户 API",
    "version": "5.x",
    "description": "itecdn v5.x Python 主控用户 API。本文档不适用于 v6 或其它实现。"
  },
  "postman": {
    "name": "获取 CC 过滤器详情",
    "description": {
      "content": "按 ID 获取一条 CC 过滤器的原始配置记录。系统内置过滤器仅管理员身份可以读取；用户自定义过滤器仅允许其所属用户读取，管理员身份本身不会绕过自定义过滤器的所有者校验。返回的是 `cc_filter` 记录本身，不包含列表接口联表得到的任务状态、用户名或格式化时间字段；`extra` 为序列化后的扩展配置 JSON 字符串，使用前需要再次解析。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "cc-filters",
        ":filter_id"
      ],
      "host": [
        "{{baseUrl}}"
      ],
      "query": [],
      "variable": [
        {
          "disabled": false,
          "description": {
            "content": "(Required) 要查询的 CC 过滤器 ID；路由只接受十进制整数。",
            "type": "text/plain"
          },
          "type": "any",
          "value": "",
          "key": "filter_id"
        }
      ]
    },
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "method": "GET",
    "auth": {
      "type": "apikey",
      "apikey": [
        {
          "type": "any",
          "value": "access-token",
          "key": "key"
        },
        {
          "type": "any",
          "value": "{{apiKey}}",
          "key": "value"
        },
        {
          "type": "any",
          "value": "header",
          "key": "in"
        }
      ]
    }
  }
}