Skip to content

Commit 2679bdf

Browse files
authored
[OpenAPI] Add securitySchemes and security in overlays (#3198) (#3206)
1 parent 8c90e38 commit 2679bdf

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

docs/overlays/elasticsearch-openapi-overlays.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ info:
44
title: Overlays for the Elasticsearch OpenAPI document
55
version: 0.0.1
66
actions:
7+
# Add document info details
78
- target: '$.info'
89
description: Add a document description and feedback link
910
update:
@@ -21,6 +22,43 @@ actions:
2122
x-feedbackLink:
2223
label: Feedback
2324
url: https://github.com/elastic/docs-content/issues/new?assignees=&labels=feedback%2Ccommunity&projects=&template=api-feedback.yaml&title=%5BFeedback%5D%3A+
25+
# Add security details
26+
- target: '$.components'
27+
description: Add securitySchemes
28+
update:
29+
securitySchemes:
30+
apiKeyAuth:
31+
in: header
32+
name: Authorization
33+
type: apiKey
34+
description: |
35+
Elasticsearch APIs support key-based authentication.
36+
You must create an API key and use the encoded value in the request header.
37+
For example:
38+
39+
40+
```
41+
curl -X GET "${ES_URL}/_cat/indices?v=true" \
42+
-H "Authorization: ApiKey ${API_KEY}"
43+
```
44+
45+
To get API keys, use the `/_security/api_key` APIs.
46+
basicAuth:
47+
scheme: basic
48+
type: http
49+
bearerAuth:
50+
scheme: bearer
51+
type: http
52+
description: |
53+
Elasticsearch APIs support the use of bearer tokens in the `Authorization` HTTP header to authenticate with the API.
54+
For examples, refer to [Token-based authentication services](https://www.elastic.co/guide/en/elasticsearch/reference/current/token-authentication-services.html)
55+
- target: '$'
56+
description: Add document security
57+
update:
58+
security:
59+
- apiKeyAuth: []
60+
- basicAuth: []
61+
- bearerAuth: []
2462
# Examples that apply only to the Elasticsearch OpenAPI document
2563
- target: "$.paths['/_features']['get']"
2664
description: "Add examples for get features operation"

0 commit comments

Comments
 (0)