Skip to content

Commit

Permalink
[Response Ops][Actions] Remove deprecated HTTP APIs (#197510)
Browse files Browse the repository at this point in the history
Resolves #90382

## Summary

Removes legacy action APIs for 9.0 and updates all tests that still used
the legacy APIs to use the current APIs. Also did some renaming of
action -> connector in the files I had to touch.

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
ymao1 and elasticmachine authored Oct 29, 2024
1 parent c7b8ca0 commit dd90b67
Show file tree
Hide file tree
Showing 122 changed files with 677 additions and 4,841 deletions.
549 changes: 0 additions & 549 deletions oas_docs/bundle.json

Large diffs are not rendered by default.

549 changes: 0 additions & 549 deletions oas_docs/bundle.serverless.json

Large diffs are not rendered by default.

403 changes: 0 additions & 403 deletions oas_docs/output/kibana.serverless.yaml

Large diffs are not rendered by default.

403 changes: 0 additions & 403 deletions oas_docs/output/kibana.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { KibanaRequest, KibanaResponseFactory } from '@kbn/core/server';
import { identity } from 'lodash';
import type { MethodKeysOf } from '@kbn/utility-types';
import { httpServerMock } from '@kbn/core/server/mocks';
import { ActionsRequestHandlerContext } from '../../types';
import { actionsClientMock } from '../../mocks';
import { ActionsClientMock } from '../../actions_client/actions_client.mock';
import { ConnectorType } from '../../application/connector/types';
import { ActionsRequestHandlerContext } from '../types';
import { actionsClientMock } from '../mocks';
import { ActionsClientMock } from '../actions_client/actions_client.mock';
import { ConnectorType } from '../application/connector/types';

export function mockHandlerArguments(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { createConnectorRoute } from './create';
import { httpServiceMock } from '@kbn/core/server/mocks';
import { licenseStateMock } from '../../../lib/license_state.mock';
import { mockHandlerArguments } from '../../legacy/_mock_handler_arguments';
import { mockHandlerArguments } from '../../_mock_handler_arguments';
import { verifyAccessAndContext } from '../../verify_access_and_context';
import { omit } from 'lodash';
import { actionsClientMock } from '../../../actions_client/actions_client.mock';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { deleteConnectorRoute } from './delete';
import { httpServiceMock } from '@kbn/core/server/mocks';
import { licenseStateMock } from '../../../lib/license_state.mock';
import { mockHandlerArguments } from '../../legacy/_mock_handler_arguments';
import { mockHandlerArguments } from '../../_mock_handler_arguments';
import { actionsClientMock } from '../../../mocks';
import { verifyAccessAndContext } from '../../verify_access_and_context';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { executeConnectorRoute } from './execute';
import { httpServiceMock } from '@kbn/core/server/mocks';
import { licenseStateMock } from '../../../lib/license_state.mock';
import { mockHandlerArguments } from '../../legacy/_mock_handler_arguments';
import { mockHandlerArguments } from '../../_mock_handler_arguments';
import { asHttpRequestExecutionSource } from '../../../lib';
import { actionsClientMock } from '../../../actions_client/actions_client.mock';
import { ActionTypeExecutorResult } from '../../../types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { getConnectorRoute } from './get';
import { httpServiceMock } from '@kbn/core/server/mocks';
import { licenseStateMock } from '../../../lib/license_state.mock';
import { mockHandlerArguments } from '../../legacy/_mock_handler_arguments';
import { mockHandlerArguments } from '../../_mock_handler_arguments';
import { actionsClientMock } from '../../../actions_client/actions_client.mock';
import { verifyAccessAndContext } from '../../verify_access_and_context';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { getAllConnectorsRoute } from './get_all';
import { httpServiceMock } from '@kbn/core/server/mocks';
import { licenseStateMock } from '../../../lib/license_state.mock';
import { mockHandlerArguments } from '../../legacy/_mock_handler_arguments';
import { mockHandlerArguments } from '../../_mock_handler_arguments';
import { verifyAccessAndContext } from '../../verify_access_and_context';
import { actionsClientMock } from '../../../actions_client/actions_client.mock';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { getAllConnectorsIncludingSystemRoute } from './get_all_system';
import { httpServiceMock } from '@kbn/core/server/mocks';
import { licenseStateMock } from '../../../lib/license_state.mock';
import { mockHandlerArguments } from '../../legacy/_mock_handler_arguments';
import { mockHandlerArguments } from '../../_mock_handler_arguments';
import { verifyAccessAndContext } from '../../verify_access_and_context';
import { actionsClientMock } from '../../../actions_client/actions_client.mock';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { httpServiceMock } from '@kbn/core/server/mocks';
import { LicenseType } from '@kbn/licensing-plugin/server';
import { licenseStateMock } from '../../../lib/license_state.mock';
import { mockHandlerArguments } from '../../legacy/_mock_handler_arguments';
import { mockHandlerArguments } from '../../_mock_handler_arguments';
import { listTypesRoute } from './list_types';
import { verifyAccessAndContext } from '../../verify_access_and_context';
import { actionsClientMock } from '../../../mocks';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { httpServiceMock } from '@kbn/core/server/mocks';
import { LicenseType } from '@kbn/licensing-plugin/server';
import { licenseStateMock } from '../../../lib/license_state.mock';
import { mockHandlerArguments } from '../../legacy/_mock_handler_arguments';
import { mockHandlerArguments } from '../../_mock_handler_arguments';
import { listTypesWithSystemRoute } from './list_types_system';
import { verifyAccessAndContext } from '../../verify_access_and_context';
import { actionsClientMock } from '../../../mocks';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { updateConnectorRoute } from './update';
import { httpServiceMock } from '@kbn/core/server/mocks';
import { licenseStateMock } from '../../../lib/license_state.mock';
import { mockHandlerArguments } from '../../legacy/_mock_handler_arguments';
import { mockHandlerArguments } from '../../_mock_handler_arguments';
import { actionsClientMock } from '../../../actions_client/actions_client.mock';
import { verifyAccessAndContext } from '../../verify_access_and_context';
import { updateConnectorBodySchema } from '../../../../common/routes/connector/apis/update';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { httpServiceMock } from '@kbn/core/server/mocks';
import { licenseStateMock } from '../lib/license_state.mock';
import { mockHandlerArguments } from './legacy/_mock_handler_arguments';
import { mockHandlerArguments } from './_mock_handler_arguments';
import { actionsClientMock } from '../actions_client/actions_client.mock';
import { getGlobalExecutionKPIRoute } from './get_global_execution_kpi';
import { verifyAccessAndContext } from './verify_access_and_context';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { getGlobalExecutionLogRoute } from './get_global_execution_logs';
import { httpServiceMock } from '@kbn/core/server/mocks';
import { licenseStateMock } from '../lib/license_state.mock';
import { mockHandlerArguments } from './legacy/_mock_handler_arguments';
import { mockHandlerArguments } from './_mock_handler_arguments';
import { actionsClientMock } from '../actions_client/actions_client.mock';
import { IExecutionLogResult } from '../../common';
import { verifyAccessAndContext } from './verify_access_and_context';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { getOAuthAccessToken } from './get_oauth_access_token';
import { httpServiceMock } from '@kbn/core/server/mocks';
import { licenseStateMock } from '../lib/license_state.mock';
import { mockHandlerArguments } from './legacy/_mock_handler_arguments';
import { mockHandlerArguments } from './_mock_handler_arguments';
import { verifyAccessAndContext } from './verify_access_and_context';
import { actionsConfigMock } from '../actions_config.mock';
import { actionsClientMock } from '../actions_client/actions_client.mock';
Expand Down
5 changes: 1 addition & 4 deletions x-pack/plugins/actions/server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { executeConnectorRoute } from './connector/execute';
import { getConnectorRoute } from './connector/get';
import { updateConnectorRoute } from './connector/update';
import { getOAuthAccessToken } from './get_oauth_access_token';
import { defineLegacyRoutes } from './legacy';
import { ActionsConfigurationUtilities } from '../actions_config';
import { getGlobalExecutionLogRoute } from './get_global_execution_logs';
import { getGlobalExecutionKPIRoute } from './get_global_execution_kpi';
Expand All @@ -32,9 +31,7 @@ export interface RouteOptions {
}

export function defineRoutes(opts: RouteOptions) {
const { router, licenseState, actionsConfigUtils, usageCounter } = opts;

defineLegacyRoutes(router, licenseState, usageCounter);
const { router, licenseState, actionsConfigUtils } = opts;

createConnectorRoute(router, licenseState);
deleteConnectorRoute(router, licenseState);
Expand Down
158 changes: 0 additions & 158 deletions x-pack/plugins/actions/server/routes/legacy/create.test.ts

This file was deleted.

67 changes: 0 additions & 67 deletions x-pack/plugins/actions/server/routes/legacy/create.ts

This file was deleted.

Loading

0 comments on commit dd90b67

Please sign in to comment.