-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathoverriding-global-security.yaml
More file actions
62 lines (61 loc) · 1.7 KB
/
overriding-global-security.yaml
File metadata and controls
62 lines (61 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
openapi: 3.0.1
info:
title: "Overriding global security"
version: 1.0.0
components:
schemas:
Data:
description: "Data"
type: string
responses:
Data:
description: "Data"
content:
application/json:
schema:
$ref: "#/components/schemas/Data"
securitySchemes:
Token:
type: apiKey
in: header
name: X-API-Key
security:
- Token: []
paths:
"/api/protected":
get:
summary: Endpoint requiring token
description: Get secret data. Auth required!
operationId: GetProtectedData
responses:
200:
$ref: "#/components/responses/Data"
"/api/unprotected":
get:
summary: Unprotected endpoint to get data
description: Get some data. No auth required.
operationId: GetUnprotectedData
security: []
responses:
200:
$ref: "#/components/responses/Data"
post:
summary: Unprotected endpoint to store data
# Whoops! Security should be overridden here like for GET. Let's fix it
# with an override file; see ./overriding-global-security-override.yaml.
description: Store some data. No auth required.
operationId: PostUnprotectedData
responses:
200:
$ref: "#/components/responses/Data"
patch:
summary: Unprotected endpoint to store data (again)
# Whoops! This is supposed to be unprotected, like GET. Let's fix it
# with an override file; see ./overriding-global-security-override.yaml.
security:
- Token: []
description: Store some data. No auth required.
operationId: PatchUnprotectedData
responses:
200:
$ref: "#/components/responses/Data"