ApiKey auth should be set in the Authorization header (#171496)

## Summary

Updates the openapi specs that I could find to correctly use the
`Authorization` header when using API Key authentication. Currently,
generated clients are specifying the incorrect (`ApiKey`) header and
failing to auth using and API Key.
This commit is contained in:
Toby Brain 2023-11-23 04:15:37 +11:00 committed by GitHub
parent a8f203931f
commit 543e8659d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 47 additions and 26 deletions

View file

@ -757,7 +757,7 @@
"post": {
"summary": "Resolve errors from the Import objects API.",
"operationId": "resolveImportErrors",
"description": "To resolve errors, you can: \n\n* Retry certain saved objects\n* Overwrite specific saved objects\n* Change references to different saved objects\n\nThis functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.\n",
"description": "To resolve errors, you can:\n\n* Retry certain saved objects\n* Overwrite specific saved objects\n* Change references to different saved objects\n\nThis functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.\n",
"tags": [
"saved objects"
],
@ -1210,7 +1210,8 @@
"apiKeyAuth": {
"type": "apiKey",
"in": "header",
"name": "ApiKey"
"name": "Authorization",
"description": "e.g. Authorization: ApiKey base64AccessApiKey"
}
},
"examples": {

View file

@ -208,7 +208,7 @@ paths:
responses:
'200':
description: |
Indicates a successful call. NOTE: This HTTP response code indicates that the bulk operation succeeded. Errors pertaining to individual objects will be returned in the response body.
Indicates a successful call. NOTE: This HTTP response code indicates that the bulk operation succeeded. Errors pertaining to individual objects will be returned in the response body.
content:
application/json:
schema:
@ -239,7 +239,7 @@ paths:
responses:
'200':
description: |
Indicates a successful call. NOTE: This HTTP response code indicates that the bulk operation succeeded. Errors pertaining to individual objects will be returned in the response body.
Indicates a successful call. NOTE: This HTTP response code indicates that the bulk operation succeeded. Errors pertaining to individual objects will be returned in the response body.
content:
application/json:
schema:
@ -798,7 +798,8 @@ components:
apiKeyAuth:
type: apiKey
in: header
name: ApiKey
name: Authorization
description: 'e.g. Authorization: ApiKey base64AccessApiKey'
examples:
key_rotation_response:
summary: Encryption key rotation using default parameters.

View file

@ -49,7 +49,8 @@ components:
apiKeyAuth:
type: apiKey
in: header
name: ApiKey
name: Authorization
description: 'e.g. Authorization: ApiKey base64AccessApiKey'
security:
- basicAuth: []
- apiKeyAuth: []
- apiKeyAuth: []

View file

@ -740,7 +740,8 @@
"apiKeyAuth": {
"type": "apiKey",
"in": "header",
"name": "ApiKey"
"name": "Authorization",
"description": "e.g. Authorization: ApiKey base64AccessApiKey"
}
},
"examples": {

View file

@ -474,7 +474,8 @@ components:
apiKeyAuth:
type: apiKey
in: header
name: ApiKey
name: Authorization
description: 'e.g. Authorization: ApiKey base64AccessApiKey'
examples:
get_data_views_response:
summary: The get all data views API returns a list of data views.

View file

@ -52,7 +52,8 @@ components:
apiKeyAuth:
type: apiKey
in: header
name: ApiKey
name: Authorization
description: 'e.g. Authorization: ApiKey base64AccessApiKey'
security:
- basicAuth: []
- apiKeyAuth: []

View file

@ -1,6 +1,6 @@
# OpenAPI (Experimental)
The current self-contained spec file is [as JSON](https://raw.githubusercontent.com/elastic/kibana/master/x-pack/plugins/cases/common/openapi/bundled.json) or [as YAML](https://raw.githubusercontent.com/elastic/kibana/master/x-pack/plugins/cases/common/openapi/bundled.yaml) and can be used for online tools like those found at https://openapi.tools/.
The current self-contained spec file is [as JSON](https://raw.githubusercontent.com/elastic/kibana/master/x-pack/plugins/cases/common/openapi/bundled.json) or [as YAML](https://raw.githubusercontent.com/elastic/kibana/master/x-pack/plugins/cases/common/openapi/bundled.yaml) and can be used for online tools like those found at https://openapi.tools/.
This spec is experimental and may be incomplete or change later.
A guide about the openApi specification can be found at [https://swagger.io/docs/specification/about/](https://swagger.io/docs/specification/about/).

View file

@ -1362,7 +1362,8 @@
"apiKeyAuth": {
"type": "apiKey",
"in": "header",
"name": "ApiKey"
"name": "Authorization",
"description": "e.g. Authorization: ApiKey base64AccessApiKey"
}
},
"parameters": {

View file

@ -859,7 +859,8 @@ components:
apiKeyAuth:
type: apiKey
in: header
name: ApiKey
name: Authorization
description: 'e.g. Authorization: ApiKey base64AccessApiKey'
parameters:
kbn_xsrf:
schema:

View file

@ -400,7 +400,8 @@
"apiKeyAuth": {
"type": "apiKey",
"in": "header",
"name": "ApiKey"
"name": "Authorization",
"description": "e.g. Authorization: ApiKey base64AccessApiKey"
}
},
"parameters": {

View file

@ -251,7 +251,8 @@ components:
apiKeyAuth:
type: apiKey
in: header
name: ApiKey
name: Authorization
description: 'e.g. Authorization: ApiKey base64AccessApiKey'
parameters:
kbn_xsrf:
schema:

View file

@ -51,7 +51,8 @@ components:
apiKeyAuth:
type: apiKey
in: header
name: ApiKey
name: Authorization
description: 'e.g. Authorization: ApiKey base64AccessApiKey'
security:
- basicAuth: []
- apiKeyAuth: []

View file

@ -30,6 +30,7 @@ components:
apiKeyAuth:
type: apiKey
in: header
name: ApiKey
name: Authorization
description: 'e.g. Authorization: ApiKey base64AccessApiKey'
security:
- apiKeyAuth: []

View file

@ -2373,7 +2373,8 @@
"apiKeyAuth": {
"type": "apiKey",
"in": "header",
"name": "ApiKey"
"name": "Authorization",
"description": "e.g. Authorization: ApiKey base64AccessApiKey"
}
},
"parameters": {

View file

@ -1537,7 +1537,8 @@ components:
apiKeyAuth:
type: apiKey
in: header
name: ApiKey
name: Authorization
description: 'e.g. Authorization: ApiKey base64AccessApiKey'
parameters:
kbn_xsrf:
schema:

View file

@ -68,7 +68,8 @@ components:
apiKeyAuth:
type: apiKey
in: header
name: ApiKey
name: Authorization
description: 'e.g. Authorization: ApiKey base64AccessApiKey'
security:
- basicAuth: []
- apiKeyAuth: []

View file

@ -3679,7 +3679,8 @@
"apiKeyAuth": {
"type": "apiKey",
"in": "header",
"name": "ApiKey"
"name": "Authorization",
"description": "e.g. Authorization: ApiKey base64AccessApiKey"
}
},
"parameters": {

View file

@ -2365,7 +2365,8 @@ components:
apiKeyAuth:
type: apiKey
in: header
name: ApiKey
name: Authorization
description: 'e.g. Authorization: ApiKey base64AccessApiKey'
parameters:
kbn_xsrf:
schema:

View file

@ -90,7 +90,8 @@ components:
apiKeyAuth:
type: apiKey
in: header
name: ApiKey
name: Authorization
description: 'e.g. Authorization: ApiKey base64AccessApiKey'
security:
- basicAuth: []
- apiKeyAuth: []

View file

@ -753,7 +753,8 @@
"apiKeyAuth": {
"type": "apiKey",
"in": "header",
"name": "ApiKey"
"name": "Authorization",
"description": "e.g. Authorization: ApiKey base64AccessApiKey"
}
},
"parameters": {

View file

@ -455,7 +455,8 @@ components:
apiKeyAuth:
type: apiKey
in: header
name: ApiKey
name: Authorization
description: 'e.g. Authorization: ApiKey base64AccessApiKey'
parameters:
kbn_xsrf:
schema:

View file

@ -35,7 +35,8 @@ components:
apiKeyAuth:
type: apiKey
in: header
name: ApiKey
name: Authorization
description: 'e.g. Authorization: ApiKey base64AccessApiKey'
security:
- basicAuth: []
- apiKeyAuth: []