知识卡片
默认保护与显式例外
在 OpenAPI 根声明普遍适用的安全要求;确需匿名的操作明确写 security: []。新增操作继承默认要求,可减少无意遗漏。服务端仍要验证凭据和资源权限,契约声明只说明如何要求它。[[安全方案与操作要求]]
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Integrating and releasing the web application 14.2 Implementing authorization · 查看原书依据
A global security declaration is an OpenAPI feature that allows us to make a statement like this: “Unless the operation’s definition says something else, use the following security scheme everywhere.” With 12 operations having a security requirement and 2 operations not having
参考来源
- 位置:《Designing APIs with Swagger and OpenAPI》第14章《Integrating and releasing the web application》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch14.htm,阅读块 94)
- 结论依据:示例用全局安全覆盖大多数操作,通过操作层空列表豁免公开入口。
- 原始内容:A global security declaration is an OpenAPI feature that allows us to make a statement like this: “Unless the operation’s definition says something else, use the following security scheme everywhere.” With 12 operations having a security requirement and 2 operations not having