Skip to content

Commit 15f335f

Browse files
authored
[OpenAPI] Add securitySchemes and security in overlays (#3198) (#3205)
1 parent e077a68 commit 15f335f

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

0 commit comments

Comments
 (0)