{
  "tags": [
    "CC 防护"
  ],
  "description": "分页查询当前身份可见的 CC 过滤器。普通用户始终只返回归属于自己的过滤器；管理员默认可查看全部用户及系统内置过滤器，并可按所属用户筛选。接口支持按过滤器 ID、名称、启用状态和是否为内置过滤器筛选，结果按过滤器 ID 倒序排列；系统保留的 10020 号过滤器始终不会出现在列表中。响应中的 `extra` 是序列化后的过滤器扩展配置 JSON 字符串，需要调用方再次解析。",
  "operationId": "user_get_v1_cc_filters",
  "security": [
    {
      "AccessToken": []
    },
    {
      "ApiKey": [],
      "ApiSecret": []
    }
  ],
  "responses": {
    "200": {
      "description": "请求通过 HTTP 200 返回。成功时给出匹配总数和当前页过滤器列表；页码或每页数量格式错误、普通用户筛选内置过滤器或认证失效时，通过字符串 `code` 和 `msg` 返回业务错误。",
      "content": {
        "application/json": {
          "schema": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "code",
                  "count",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "integer",
                    "enum": [
                      0
                    ],
                    "description": "成功状态码，列表查询成功时固定为 0。"
                  },
                  "count": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0,
                    "description": "符合身份范围及筛选条件的过滤器总数，不受当前页 `limit` 限制。"
                  },
                  "data": {
                    "type": "array",
                    "description": "当前页的 CC 过滤器记录，按过滤器 ID 从大到小排列。",
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "uid",
                        "c.uid",
                        "name",
                        "des",
                        "type",
                        "within_second",
                        "max_req",
                        "max_req_per_uri",
                        "extra",
                        "create_at",
                        "update_at",
                        "internal",
                        "enable",
                        "task_id",
                        "version",
                        "state",
                        "create_at2",
                        "update_at2",
                        "username"
                      ],
                      "properties": {
                        "id": {
                          "type": "integer",
                          "format": "int64",
                          "description": "CC 过滤器的唯一 ID。"
                        },
                        "uid": {
                          "type": "integer",
                          "format": "int64",
                          "nullable": true,
                          "description": "过滤器所属用户的 ID；不归属于具体用户的系统内置过滤器可为 null。"
                        },
                        "c.uid": {
                          "type": "integer",
                          "format": "int64",
                          "nullable": true,
                          "description": "查询结果中因再次选择所属用户列而生成的重复字段，值与 `uid` 相同；系统内置过滤器可为 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": "过滤器实现类型，决定触发后采用的限速、验证、跳转或 URL 鉴权行为。"
                        },
                        "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` 类型包含模式、密钥、签名参数名、时间容差及签名可用次数；其他类型通常为 `{}`。"
                        },
                        "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": "过滤器配置版本号，修改过滤器时递增。"
                        },
                        "state": {
                          "type": "string",
                          "nullable": true,
                          "description": "关联任务的当前状态；过滤器没有关联任务时为 null。"
                        },
                        "create_at2": {
                          "type": "string",
                          "nullable": true,
                          "description": "格式化为 `YYYY-MM-DD HH:mm:ss` 的创建时间；原始创建时间为 null 时也为 null。"
                        },
                        "update_at2": {
                          "type": "string",
                          "nullable": true,
                          "description": "格式化为 `YYYY-MM-DD HH:mm:ss` 的最后更新时间；原始更新时间为 null 时也为 null。"
                        },
                        "username": {
                          "type": "string",
                          "nullable": true,
                          "description": "过滤器所属用户的名称；不归属于具体用户的系统内置过滤器为 null。"
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "cc_filter-33",
                      "cc_filter-34",
                      "cc_filter-59",
                      "login_required"
                    ],
                    "description": "业务错误码：`cc_filter-33` 表示 page 不是数字，`cc_filter-34` 表示 limit 不是数字，`cc_filter-59` 表示当前身份无权筛选内置过滤器，`login_required` 表示认证无效。"
                  },
                  "msg": {
                    "type": "string",
                    "description": "与业务错误码对应的中文参数、权限或认证失败原因。"
                  },
                  "data": {
                    "type": "string",
                    "enum": [
                      ""
                    ],
                    "description": "业务错误时固定为空字符串。"
                  }
                },
                "additionalProperties": false
              }
            ]
          },
          "example": {
            "code": 0,
            "count": 1,
            "data": [
              {
                "id": 10021,
                "uid": 2,
                "c.uid": 2,
                "name": "请求频率限制",
                "des": "限制短时间内的重复请求",
                "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,
                "state": null,
                "create_at2": "2021-11-25 14:36:29",
                "update_at2": "2021-11-25 14:36:29",
                "username": "example-user"
              }
            ]
          }
        }
      }
    }
  },
  "x-python-handler": "site.CCFilterAPI",
  "x-python-route-line": 398,
  "x-audience": "user",
  "x-auth": "user",
  "x-reviewed": true,
  "parameters": [
    {
      "name": "page",
      "in": "query",
      "required": false,
      "description": "页码，从 1 开始；省略时为 1。只能传十进制非负整数字符串，非数字值返回 `cc_filter-33`；`limit=0` 时该参数不影响返回范围。",
      "schema": {
        "type": "integer",
        "format": "int32",
        "minimum": 1,
        "default": 1
      },
      "example": 1
    },
    {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "每页返回的过滤器数量，省略时为 10；传 0 表示不分页并返回全部匹配记录。非数字值返回 `cc_filter-34`。",
      "schema": {
        "type": "integer",
        "format": "int32",
        "minimum": 0,
        "default": 10
      },
      "example": 10
    },
    {
      "name": "uid",
      "in": "query",
      "required": false,
      "description": "按过滤器所属用户 ID 精确筛选，仅管理员身份生效；普通用户传入该参数时仍只返回自己的过滤器。",
      "schema": {
        "type": "integer",
        "format": "int64",
        "minimum": 1
      },
      "example": 2
    },
    {
      "name": "internal",
      "in": "query",
      "required": false,
      "description": "按是否为系统内置过滤器精确筛选：1 表示内置，0 表示用户自定义。使用该筛选条件要求管理员身份，普通用户传入时返回 `cc_filter-59`。",
      "schema": {
        "type": "integer",
        "enum": [
          0,
          1
        ]
      },
      "example": 1
    },
    {
      "name": "enable",
      "in": "query",
      "required": false,
      "description": "按启用状态精确筛选：1 表示已启用，0 表示已禁用。",
      "schema": {
        "type": "integer",
        "enum": [
          0,
          1
        ]
      },
      "example": 1
    },
    {
      "name": "id",
      "in": "query",
      "required": false,
      "description": "按 CC 过滤器 ID 精确筛选列表；系统保留的 10020 号过滤器即使匹配也不会返回。",
      "schema": {
        "type": "integer",
        "format": "int64",
        "minimum": 1
      },
      "example": 10021
    },
    {
      "name": "name",
      "in": "query",
      "required": false,
      "description": "按过滤器名称进行包含匹配。",
      "schema": {
        "type": "string"
      },
      "example": "请求频率限制"
    }
  ],
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "site.CCFilterAPI"
    },
    {
      "key": "x-python-route-line",
      "value": 398
    },
    {
      "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",
  "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": "分页查询当前身份可见的 CC 过滤器。普通用户始终只返回归属于自己的过滤器；管理员默认可查看全部用户及系统内置过滤器，并可按所属用户筛选。接口支持按过滤器 ID、名称、启用状态和是否为内置过滤器筛选，结果按过滤器 ID 倒序排列；系统保留的 10020 号过滤器始终不会出现在列表中。响应中的 `extra` 是序列化后的过滤器扩展配置 JSON 字符串，需要调用方再次解析。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "cc-filters"
      ],
      "host": [
        "{{baseUrl}}"
      ],
      "query": [
        {
          "disabled": false,
          "description": {
            "content": "页码，从 1 开始；省略时为 1。只能传十进制非负整数字符串，非数字值返回 `cc_filter-33`；`limit=0` 时该参数不影响返回范围。",
            "type": "text/plain"
          },
          "key": "page",
          "value": ""
        },
        {
          "disabled": false,
          "description": {
            "content": "每页返回的过滤器数量，省略时为 10；传 0 表示不分页并返回全部匹配记录。非数字值返回 `cc_filter-34`。",
            "type": "text/plain"
          },
          "key": "limit",
          "value": ""
        },
        {
          "disabled": false,
          "description": {
            "content": "按过滤器所属用户 ID 精确筛选，仅管理员身份生效；普通用户传入该参数时仍只返回自己的过滤器。",
            "type": "text/plain"
          },
          "key": "uid",
          "value": ""
        },
        {
          "disabled": false,
          "description": {
            "content": "按是否为系统内置过滤器精确筛选：1 表示内置，0 表示用户自定义。使用该筛选条件要求管理员身份，普通用户传入时返回 `cc_filter-59`。",
            "type": "text/plain"
          },
          "key": "internal",
          "value": ""
        },
        {
          "disabled": false,
          "description": {
            "content": "按启用状态精确筛选：1 表示已启用，0 表示已禁用。",
            "type": "text/plain"
          },
          "key": "enable",
          "value": ""
        },
        {
          "disabled": false,
          "description": {
            "content": "按 CC 过滤器 ID 精确筛选列表；系统保留的 10020 号过滤器即使匹配也不会返回。",
            "type": "text/plain"
          },
          "key": "id",
          "value": ""
        },
        {
          "disabled": false,
          "description": {
            "content": "按过滤器名称进行包含匹配。",
            "type": "text/plain"
          },
          "key": "name",
          "value": ""
        }
      ],
      "variable": []
    },
    "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"
        }
      ]
    }
  }
}