diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index 912e5cc62fe5d..5b0e7fd2c1667 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -5883,18 +5883,6 @@ "description": "This 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.", "operationId": "get-dashboards-dashboard", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "The page number to return. Default is \"1\".", "in": "query", @@ -5921,7 +5909,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -6070,18 +6058,6 @@ "description": "This 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.", "operationId": "delete-dashboards-dashboard-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -6113,18 +6089,6 @@ "description": "This 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.", "operationId": "get-dashboards-dashboard-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A unique identifier for the dashboard.", "in": "path", @@ -6138,7 +6102,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -6773,18 +6737,6 @@ "description": "This 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.", "operationId": "post-dashboards-dashboard-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -6807,7 +6759,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -7342,7 +7294,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -7949,18 +7901,6 @@ "description": "This 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.", "operationId": "put-dashboards-dashboard-id", "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, { "description": "A required header to protect against CSRF attacks", "in": "header", @@ -7983,7 +7923,7 @@ ], "requestBody": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { @@ -8512,7 +8452,7 @@ "responses": { "200": { "content": { - "application/json; Elastic-Api-Version=2023-10-31": { + "application/json": { "schema": { "additionalProperties": false, "properties": { diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index 9c8184b972e6a..f2d7906b1089e 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -7638,14 +7638,6 @@ paths: description: This 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. operationId: get-dashboards-dashboard parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: The page number to return. Default is "1". in: query name: page @@ -7768,14 +7760,6 @@ paths: description: This 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. operationId: delete-dashboards-dashboard-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -7798,14 +7782,6 @@ paths: description: This 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. operationId: get-dashboards-dashboard-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A unique identifier for the dashboard. in: path name: id @@ -8269,14 +8245,6 @@ paths: description: This 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. operationId: post-dashboards-dashboard-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -9110,14 +9078,6 @@ paths: description: This 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. operationId: put-dashboards-dashboard-id parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - description: A required header to protect against CSRF attacks in: header name: kbn-xsrf diff --git a/x-pack/test_serverless/functional/page_objects/svl_api_keys.ts b/x-pack/test_serverless/functional/page_objects/svl_api_keys.ts index 217a17263b1f8..4b4ae367fea17 100644 --- a/x-pack/test_serverless/functional/page_objects/svl_api_keys.ts +++ b/x-pack/test_serverless/functional/page_objects/svl_api_keys.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { SecurityApiKey } from '@elastic/elasticsearch/lib/api/types'; import { FtrProviderContext } from '../ftr_provider_context'; const APIKEY_MASK = '•'.repeat(60); @@ -27,6 +28,10 @@ export function SvlApiKeysProvider({ getService, getPageObjects }: FtrProviderCo await browser.clearSessionStorage(); }, + async expectAPIKeyExists() { + await testSubjects.existOrFail('apiKeyFormAPIKey', { timeout: 1000 }); + }, + async expectAPIKeyAvailable() { await testSubjects.existOrFail('apiKeyFormAPIKey'); await retry.try(async () => { @@ -84,8 +89,19 @@ export function SvlApiKeysProvider({ getService, getPageObjects }: FtrProviderCo }, async deleteAPIKeys() { + const filterInvalid = (key: SecurityApiKey) => !key.invalidated; + const { api_keys: apiKeys } = await es.security.getApiKey(); - await es.security.invalidateApiKey({ ids: apiKeys.map((key) => key.id) }); + + const validKeys = apiKeys.filter(filterInvalid); + + if (validKeys.length === 0) { + return; + } + + await es.security.invalidateApiKey({ + ids: validKeys.map((key) => key.id), + }); }, async expectCreateApiKeyAction() { diff --git a/x-pack/test_serverless/functional/test_suites/search/elasticsearch_start.ts b/x-pack/test_serverless/functional/test_suites/search/elasticsearch_start.ts index 39228137cf7d7..da966b21185c5 100644 --- a/x-pack/test_serverless/functional/test_suites/search/elasticsearch_start.ts +++ b/x-pack/test_serverless/functional/test_suites/search/elasticsearch_start.ts @@ -21,6 +21,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const esDeleteAllIndices = getService('esDeleteAllIndices'); const es = getService('es'); const browser = getService('browser'); + const retry = getService('retry'); const deleteAllTestIndices = async () => { await esDeleteAllIndices(['search-*', 'test-*']); @@ -95,7 +96,20 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('should show the api key in code view', async () => { await pageObjects.svlSearchElasticsearchStartPage.expectToBeOnStartPage(); await pageObjects.svlSearchElasticsearchStartPage.clickCodeViewButton(); + // sometimes the API key exists in the cluster and its lost in sessionStorage + // if fails we retry to delete the API key and refresh the browser + await retry.try( + async () => { + await pageObjects.svlApiKeys.expectAPIKeyExists(); + }, + async () => { + await pageObjects.svlApiKeys.deleteAPIKeys(); + await browser.refresh(); + await pageObjects.svlSearchElasticsearchStartPage.clickCodeViewButton(); + } + ); await pageObjects.svlApiKeys.expectAPIKeyAvailable(); + const apiKeyUI = await pageObjects.svlApiKeys.getAPIKeyFromUI(); const apiKeySession = await pageObjects.svlApiKeys.getAPIKeyFromSessionStorage(); diff --git a/x-pack/test_serverless/functional/test_suites/search/search_index_detail.ts b/x-pack/test_serverless/functional/test_suites/search/search_index_detail.ts index eab050cc25d3e..5f4a08b0ebdf5 100644 --- a/x-pack/test_serverless/functional/test_suites/search/search_index_detail.ts +++ b/x-pack/test_serverless/functional/test_suites/search/search_index_detail.ts @@ -20,6 +20,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const svlSearchNavigation = getService('svlSearchNavigation'); const es = getService('es'); const security = getService('security'); + const browser = getService('browser'); + const retry = getService('retry'); const esDeleteAllIndices = getService('esDeleteAllIndices'); const indexName = 'test-my-index'; @@ -89,6 +91,27 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await svlSearchNavigation.navigateToIndexDetailPage(indexName); }); + describe('API key details', () => { + it('should show api key', async () => { + await pageObjects.svlApiKeys.deleteAPIKeys(); + await svlSearchNavigation.navigateToIndexDetailPage(indexName); + // sometimes the API key exists in the cluster and its lost in sessionStorage + // if fails we retry to delete the API key and refresh the browser + await retry.try( + async () => { + await pageObjects.svlApiKeys.expectAPIKeyExists(); + }, + async () => { + await pageObjects.svlApiKeys.deleteAPIKeys(); + await browser.refresh(); + } + ); + await pageObjects.svlApiKeys.expectAPIKeyAvailable(); + const apiKey = await pageObjects.svlApiKeys.getAPIKeyFromUI(); + await pageObjects.svlSearchIndexDetailPage.expectAPIKeyToBeVisibleInCodeBlock(apiKey); + }); + }); + it('should show code examples for adding documents', async () => { await pageObjects.svlSearchIndexDetailPage.expectAddDocumentCodeExamples(); await pageObjects.svlSearchIndexDetailPage.expectSelectedLanguage('python');