知识卡片
安全方案与操作要求
components.securitySchemes 声明凭据如何传递,security 说明此处接受哪些方案。方案可以被多个操作引用。FarmStall 在 apiKey 方案中写 in: header 与 name: Authorization,运行时仍须由服务实际校验。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Adding authentication and authorization 7.3 Adding the Authorization header · 查看原书依据
This is how we declare security types within OpenAPI. We haven’t described which operations require it—we’ve only declared the security. We’ve chosen the simplest type of authorization, which is what FarmStall API uses, an HTTP header named Authorization. The name of the
参考来源
- 位置:《Designing APIs with Swagger and OpenAPI》第07章《Adding authentication and authorization》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch07.htm,阅读块 142)
- 结论依据:原文强调方案名须与操作要求引用一致。
- 原始内容:This is how we declare security types within OpenAPI. We haven’t described which operations require it—we’ve only declared the security. We’ve chosen the simplest type of authorization, which is what FarmStall API uses, an HTTP header named Authorization. The name of the