diff --git a/docs/migration/migrate_7_0.asciidoc b/docs/migration/migrate_7_0.asciidoc index 254ca720ad38c95..60272acc8ad2852 100644 --- a/docs/migration/migrate_7_0.asciidoc +++ b/docs/migration/migrate_7_0.asciidoc @@ -49,4 +49,10 @@ to Kibana's advanced setting. *Impact:* This setting is no longer necessary. If you enable {monitoring} across the Elastic Stack, a monitoring agent runs on each Elasticsearch node, Logstash node, Kibana instance, and Beat to collect and index metrics. Each node and instance is -considered unique based on its persistent UUID, which is written to the path.data directory when the node or instance starts. \ No newline at end of file +considered unique based on its persistent UUID, which is written to the path.data directory when the node or instance starts. + +[float] +=== Deprecated API `/shorten` has been removed +*Details:* The `/shorten` API has been deprecated since 6.5, when it was replaced by the `/api/shorten_url` API. + +*Impact:* The '/shorten' API has been removed. Use the '/api/shorten_url' API instead. diff --git a/src/server/url_shortening/routes/create_routes.js b/src/server/url_shortening/routes/create_routes.js index 938a154b953b68b..e5596cacd85d0c3 100644 --- a/src/server/url_shortening/routes/create_routes.js +++ b/src/server/url_shortening/routes/create_routes.js @@ -17,8 +17,6 @@ * under the License. */ -import { handleShortUrlError } from './lib/short_url_error'; -import { shortUrlAssertValid } from './lib/short_url_assert_valid'; import { shortUrlLookupProvider } from './lib/short_url_lookup'; import { createGotoRoute } from './goto'; import { createShortenUrlRoute } from './shorten_url'; @@ -29,22 +27,4 @@ export function createRoutes(server, config) { server.route(createGotoRoute({ server, config, shortUrlLookup })); server.route(createShortenUrlRoute({ shortUrlLookup })); - - // TODO remove deprecated '/shorten' API in master (7.0) - server.route({ - method: 'POST', - path: '/shorten', - handler: async function (request, reply) { - server.log( - ['warning', 'deprecation'], - `'/shorten' API has been deprecated and will be removed in 7.0, use the '/api/shorten_url' API instead`); - try { - shortUrlAssertValid(request.payload.url); - const urlId = await shortUrlLookup.generateUrlId(request.payload.url, request); - reply(urlId); - } catch (err) { - reply(handleShortUrlError(err)); - } - } - }); } diff --git a/test/api_integration/apis/shorten/index.js b/test/api_integration/apis/shorten/index.js index 6c2118cbb9eb984..fdd5421b7774f16 100644 --- a/test/api_integration/apis/shorten/index.js +++ b/test/api_integration/apis/shorten/index.js @@ -27,18 +27,6 @@ export default function ({ getService }) { before(() => esArchiver.load('saved_objects/basic')); after(() => esArchiver.unload('saved_objects/basic')); - // TODO remove deprecated '/shorten' API in master (7.0) - it('generates shortened urls with deprecated URL', async () => { - const resp = await supertest - .post('/shorten') - .set('content-type', 'application/json') - .send({ url: '/app/kibana#/visualize/create' }) - .expect(200); - - expect(typeof resp.text).to.be('string'); - expect(resp.text.length > 0).to.be(true); - }); - it('generates shortened urls', async () => { const resp = await supertest .post('/api/shorten_url')