From ca9d0fb919f5419197510a396eda1f68248e561c Mon Sep 17 00:00:00 2001 From: Pete Gillin Date: Mon, 6 Oct 2025 17:47:32 +0100 Subject: [PATCH 1/4] Add `api_key` param to remote reindex This reflects the change made in https://github.com/elastic/elasticsearch/pull/135949. --- output/openapi/elasticsearch-openapi.json | 9 +++++-- .../elasticsearch-serverless-openapi.json | 9 +++++-- output/schema/schema.json | 24 ++++++++++++++++--- output/typescript/types.ts | 1 + specification/_global/reindex/types.ts | 12 ++++++++-- 5 files changed, 46 insertions(+), 9 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index a416aedf9f..809bd01472 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -118830,7 +118830,7 @@ ] }, "username": { - "description": "The username to use for authentication with the remote host.", + "description": "The username to use for authentication with the remote host (required when using basic auth).", "allOf": [ { "$ref": "#/components/schemas/_types.Username" @@ -118838,13 +118838,18 @@ ] }, "password": { - "description": "The password to use for authentication with the remote host.", + "description": "The password to use for authentication with the remote host (required when using basic auth).", "allOf": [ { "$ref": "#/components/schemas/_types.Password" } ] }, + "api_key": { + "description": "The API key to use for authentication with the remote host (as an alternative to basic auth when the remote cluster is in Elastic Cloud).\n(It is not permitted to set this and also to set an Authorization header via {@link headers}.)", + "x-state": "Generally available; Added in 9.3.0", + "type": "string" + }, "socket_timeout": { "description": "The remote socket read timeout.", "default": "30s", diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 2431ed80ef..bf50443498 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -78057,7 +78057,7 @@ ] }, "username": { - "description": "The username to use for authentication with the remote host.", + "description": "The username to use for authentication with the remote host (required when using basic auth).", "allOf": [ { "$ref": "#/components/schemas/_types.Username" @@ -78065,13 +78065,18 @@ ] }, "password": { - "description": "The password to use for authentication with the remote host.", + "description": "The password to use for authentication with the remote host (required when using basic auth).", "allOf": [ { "$ref": "#/components/schemas/_types.Password" } ] }, + "api_key": { + "description": "The API key to use for authentication with the remote host (as an alternative to basic auth when the remote cluster is in Elastic Cloud).\n(It is not permitted to set this and also to set an Authorization header via {@link headers}.)", + "x-state": "Generally available", + "type": "string" + }, "socket_timeout": { "description": "The remote socket read timeout.", "default": "30s", diff --git a/output/schema/schema.json b/output/schema/schema.json index 75a2b0e795..ffc217cd4c 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -35969,7 +35969,7 @@ } }, { - "description": "The username to use for authentication with the remote host.", + "description": "The username to use for authentication with the remote host (required when using basic auth).", "name": "username", "required": false, "type": { @@ -35981,7 +35981,7 @@ } }, { - "description": "The password to use for authentication with the remote host.", + "description": "The password to use for authentication with the remote host (required when using basic auth).", "name": "password", "required": false, "type": { @@ -35992,6 +35992,24 @@ } } }, + { + "availability": { + "serverless": {}, + "stack": { + "since": "9.3.0" + } + }, + "description": "The API key to use for authentication with the remote host (as an alternative to basic auth when the remote cluster is in Elastic Cloud).\n(It is not permitted to set this and also to set an Authorization header via {@link headers}.)", + "name": "api_key", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, { "description": "The remote socket read timeout.", "name": "socket_timeout", @@ -36006,7 +36024,7 @@ } } ], - "specLocation": "_global/reindex/types.ts#L112-L140" + "specLocation": "_global/reindex/types.ts#L112-L148" }, { "kind": "request", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 04b2414291..ae06b8c6fd 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -996,6 +996,7 @@ export interface ReindexRemoteSource { host: Host username?: Username password?: Password + api_key?: string socket_timeout?: Duration } diff --git a/specification/_global/reindex/types.ts b/specification/_global/reindex/types.ts index af470551b8..8f944c956b 100644 --- a/specification/_global/reindex/types.ts +++ b/specification/_global/reindex/types.ts @@ -125,13 +125,21 @@ export class RemoteSource { */ host: Host /** - * The username to use for authentication with the remote host. + * The username to use for authentication with the remote host (required when using basic auth). */ username?: Username /** - * The password to use for authentication with the remote host. + * The password to use for authentication with the remote host (required when using basic auth). */ password?: Password + /** + * The API key to use for authentication with the remote host (as an alternative to basic auth when the remote cluster is in Elastic Cloud). + * (It is not permitted to set this and also to set an Authorization header via {@link headers}.) + * + * @availability stack since=9.3.0 + * @availability serverless + */ + api_key?: string /** * The remote socket read timeout. * @server_default 30s From b80297a81b55ec615a517d2d796fdc3534981faf Mon Sep 17 00:00:00 2001 From: Pete Gillin Date: Tue, 7 Oct 2025 09:46:48 +0100 Subject: [PATCH 2/4] Update specification/_global/reindex/types.ts Co-authored-by: Quentin Pradet --- specification/_global/reindex/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/_global/reindex/types.ts b/specification/_global/reindex/types.ts index 8f944c956b..afc7f4235c 100644 --- a/specification/_global/reindex/types.ts +++ b/specification/_global/reindex/types.ts @@ -134,7 +134,7 @@ export class RemoteSource { password?: Password /** * The API key to use for authentication with the remote host (as an alternative to basic auth when the remote cluster is in Elastic Cloud). - * (It is not permitted to set this and also to set an Authorization header via {@link headers}.) + * (It is not permitted to set this and also to set an Authorization header via `headers`.) * * @availability stack since=9.3.0 * @availability serverless From 4998ba5ae3979f3fb307d7dbe3bc5fdc1fc47156 Mon Sep 17 00:00:00 2001 From: Pete Gillin Date: Tue, 7 Oct 2025 09:47:38 +0100 Subject: [PATCH 3/4] Also code-font the `Authorization` header name --- specification/_global/reindex/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/_global/reindex/types.ts b/specification/_global/reindex/types.ts index afc7f4235c..133d916a8d 100644 --- a/specification/_global/reindex/types.ts +++ b/specification/_global/reindex/types.ts @@ -134,7 +134,7 @@ export class RemoteSource { password?: Password /** * The API key to use for authentication with the remote host (as an alternative to basic auth when the remote cluster is in Elastic Cloud). - * (It is not permitted to set this and also to set an Authorization header via `headers`.) + * (It is not permitted to set this and also to set an `Authorization` header via `headers`.) * * @availability stack since=9.3.0 * @availability serverless From 05eed8948d03cedbd8fcd74b3a73d0e8db8b77da Mon Sep 17 00:00:00 2001 From: Pete Gillin Date: Tue, 7 Oct 2025 09:49:48 +0100 Subject: [PATCH 4/4] make contrib --- output/openapi/elasticsearch-openapi.json | 2 +- output/openapi/elasticsearch-serverless-openapi.json | 2 +- output/schema/schema.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 809bd01472..48f7c3699d 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -118846,7 +118846,7 @@ ] }, "api_key": { - "description": "The API key to use for authentication with the remote host (as an alternative to basic auth when the remote cluster is in Elastic Cloud).\n(It is not permitted to set this and also to set an Authorization header via {@link headers}.)", + "description": "The API key to use for authentication with the remote host (as an alternative to basic auth when the remote cluster is in Elastic Cloud).\n(It is not permitted to set this and also to set an `Authorization` header via `headers`.)", "x-state": "Generally available; Added in 9.3.0", "type": "string" }, diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index bf50443498..1b81458a00 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -78073,7 +78073,7 @@ ] }, "api_key": { - "description": "The API key to use for authentication with the remote host (as an alternative to basic auth when the remote cluster is in Elastic Cloud).\n(It is not permitted to set this and also to set an Authorization header via {@link headers}.)", + "description": "The API key to use for authentication with the remote host (as an alternative to basic auth when the remote cluster is in Elastic Cloud).\n(It is not permitted to set this and also to set an `Authorization` header via `headers`.)", "x-state": "Generally available", "type": "string" }, diff --git a/output/schema/schema.json b/output/schema/schema.json index ffc217cd4c..bf940f6671 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -35999,7 +35999,7 @@ "since": "9.3.0" } }, - "description": "The API key to use for authentication with the remote host (as an alternative to basic auth when the remote cluster is in Elastic Cloud).\n(It is not permitted to set this and also to set an Authorization header via {@link headers}.)", + "description": "The API key to use for authentication with the remote host (as an alternative to basic auth when the remote cluster is in Elastic Cloud).\n(It is not permitted to set this and also to set an `Authorization` header via `headers`.)", "name": "api_key", "required": false, "type": {