← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 10296.b.1.c.1.c.4.a.1 · 生成模型:未记录

字段权限须分读写

理解等级:中级

对象级授权通过后,还要分别核对这次操作可以读哪些字段、能写哪些字段。显式 schema 与敏感字段清单支撑 lint,再让实现按权限过滤和校验。additionalProperties 约束未知字段会影响向后兼容和组合 schema,选择关闭或受控扩展时需考虑接口演进。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 自定义 Lint 与安全检查 10.2.3 API2:2023 - Broken Authentication · 查看原书依据

      What about APIs that already return fields users should not have access to? These can be sensitive fields that have personally identifiable information (PII). The owasp:api3 :2023-no-default-additionalProperties rule won’t catch that. Instead, you can mark such fields as sensitive and get the linting rule to notify you of where those sensitive fields are being returned in the response.

    参考来源

    - 位置:《Automating API Delivery APIOps with OpenAPI》《第 10 章 自定义 Lint 与安全检查》(10.2.3 API2:2023 - Broken Authentication;来源项目 book-source,extracted/Automating API Delivery APIOps with OpenAPI/_epub-src/OEBPS/Text/chapter-10.xhtml#p129) - 结论依据:原文指出封闭 schema 无法辨识已声明的敏感字段,需额外分类和规则。 - 原始内容:What about APIs that already return fields users should not have access to? These can be sensitive fields that have personally identifiable information (PII). The owasp:api3 :2023-no-default-additionalProperties rule won’t catch that. Instead, you can mark such fields as sensitive and get the linting rule to notify you of where those sensitive fields are being returned in the response.