From 4eb61fea62c16c2c4a45fb5c22a30c7d893e3cf8 Mon Sep 17 00:00:00 2001 From: Andrea De Pirro Date: Tue, 17 Nov 2026 16:51:04 +0100 Subject: [PATCH] Stop documenting the docs API cookie gate The team is dropping the feature_search_or_askai_enabled cookie that the CDN required for the docs API in production (edge, staging and demo already run without it). The OpenAPI description, the REST API page and the spec copy no longer mention it, and a test keeps the description from naming one. Co-Authored-By: Claude Opus 5.5 --- docs/data/api.md | 4 ++-- docs/docs-api.json | 2 +- src/api/Elastic.Documentation.Api/ServicesExtension.cs | 3 +-- tests/Elastic.Documentation.Api.Tests/OpenApiDocumentTests.cs | 3 ++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/data/api.md b/docs/data/api.md index 6ea38fa27a..ccd6234372 100644 --- a/docs/data/api.md +++ b/docs/data/api.md @@ -6,7 +6,7 @@ navigation_title: REST API {{dbuild}} includes a REST API server (`Elastic.Documentation.Api`) that powers search, AI assistance, and content change feeds for the documentation site. -The server describes itself in an OpenAPI document at `/docs/_api/v1/openapi.json`, generated from its endpoints. It lists every endpoint with its parameters, request bodies, responses, and error codes. Requests through `www.elastic.co` need the cookie `feature_search_or_askai_enabled=true`; without it, the CDN answers `403`. +The server describes itself in an OpenAPI document at `/docs/_api/v1/openapi.json`, generated from its endpoints. It lists every endpoint with its parameters, request bodies, responses, and error codes. ## Endpoints @@ -88,7 +88,7 @@ Every error is an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem, se - `detail` explains this occurrence, for people. - `traceId` names the request's trace. Quote it when you report a problem. -Errors from the CDN, such as the `403` for a missing cookie, aren't problems and aren't JSON. +Errors from the CDN, such as a `403` from its firewall, aren't problems and aren't JSON. ### Invalid arguments [invalid-arguments] diff --git a/docs/docs-api.json b/docs/docs-api.json index f5f207909d..88733d6353 100644 --- a/docs/docs-api.json +++ b/docs/docs-api.json @@ -2,7 +2,7 @@ "openapi": "3.2.0", "info": { "title": "Elastic Docs API", - "description": "Search, Ask AI, change feeds, feedback and the API reference behind elastic.co/docs. Requests through www.elastic.co need the cookie feature_search_or_askai_enabled=true; without it the CDN answers 403.", + "description": "Search, Ask AI, change feeds, feedback and the API reference behind elastic.co/docs.", "version": "v1" }, "servers": [ diff --git a/src/api/Elastic.Documentation.Api/ServicesExtension.cs b/src/api/Elastic.Documentation.Api/ServicesExtension.cs index 7d29a728b1..c95de73172 100644 --- a/src/api/Elastic.Documentation.Api/ServicesExtension.cs +++ b/src/api/Elastic.Documentation.Api/ServicesExtension.cs @@ -71,8 +71,7 @@ private static void AddElasticDocsApiServices(this IServiceCollection services, { Title = "Elastic Docs API", Version = "v1", - Description = "Search, Ask AI, change feeds, feedback and the API reference behind elastic.co/docs. " - + "Requests through www.elastic.co need the cookie feature_search_or_askai_enabled=true; without it the CDN answers 403." + Description = "Search, Ask AI, change feeds, feedback and the API reference behind elastic.co/docs." }; document.Servers = [new OpenApiServer { Url = "https://www.elastic.co" }]; return Task.CompletedTask; diff --git a/tests/Elastic.Documentation.Api.Tests/OpenApiDocumentTests.cs b/tests/Elastic.Documentation.Api.Tests/OpenApiDocumentTests.cs index 3cc492a413..0124cb9ea9 100644 --- a/tests/Elastic.Documentation.Api.Tests/OpenApiDocumentTests.cs +++ b/tests/Elastic.Documentation.Api.Tests/OpenApiDocumentTests.cs @@ -120,7 +120,8 @@ public async Task Document_NamesTheApiAndThePublicServer() var document = await Document(); document.GetProperty("info").GetProperty("title").GetString().Should().Be("Elastic Docs API"); - document.GetProperty("info").GetProperty("description").GetString().Should().Contain("feature_search_or_askai_enabled=true"); + // The CDN no longer gates the API behind a cookie, so the description names none. + document.GetProperty("info").GetProperty("description").GetString().Should().NotContainEquivalentOf("cookie"); document.GetProperty("servers")[0].GetProperty("url").GetString().Should().Be("https://www.elastic.co"); } }