From b124dee47305aa01433266d04ca4ab62f1f8970c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:32:31 +0400 Subject: [PATCH] [Backport 8.x] Add trace_redact to RedactProcessor (#2967) * Add trace_redact to RedactProcessor * Move availability annotation (cherry picked from commit 593ad71db4f18e4d9f11b4f8b829aacfb55007ef) Co-authored-by: Quentin Pradet --- output/openapi/elasticsearch-openapi.json | 20 ++++ .../elasticsearch-serverless-openapi.json | 20 ++++ output/schema/schema-serverless.json | 96 +++++++++++++++---- output/schema/schema.json | 96 +++++++++++++++---- output/typescript/types.ts | 6 ++ specification/ingest/_types/Processors.ts | 7 ++ specification/ingest/simulate/types.ts | 12 +++ 7 files changed, 219 insertions(+), 38 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index c9fdae3d50..f69b09e29d 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -70585,6 +70585,11 @@ "skip_if_unlicensed": { "description": "If `true` and the current license does not support running redact processors, then the processor quietly exits without modifying the document", "type": "boolean" + }, + "trace_redact": { + "description": "If `true` then ingest metadata `_ingest._redact._is_redacted` is set to `true` if the document has been redacted", + "x-available-since": "8.16.0", + "type": "boolean" } }, "required": [ @@ -71074,6 +71079,9 @@ "ingest.simulate:Ingest": { "type": "object", "properties": { + "_redact": { + "$ref": "#/components/schemas/ingest.simulate:Redact" + }, "timestamp": { "$ref": "#/components/schemas/_types:DateTime" }, @@ -71085,6 +71093,18 @@ "timestamp" ] }, + "ingest.simulate:Redact": { + "type": "object", + "properties": { + "_is_redacted": { + "description": "indicates if document has been redacted", + "type": "boolean" + } + }, + "required": [ + "_is_redacted" + ] + }, "_spec_utils:StringifiedVersionNumber": { "description": "Some APIs will return values such as numbers also as a string (notably epoch timestamps). This behavior\nis used to capture this behavior while keeping the semantics of the field type.\n\nDepending on the target language, code generators can keep the union or remove it and leniently parse\nstrings to the target type.", "oneOf": [ diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 99ccb83cca..1bca659a99 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -47123,6 +47123,11 @@ "skip_if_unlicensed": { "description": "If `true` and the current license does not support running redact processors, then the processor quietly exits without modifying the document", "type": "boolean" + }, + "trace_redact": { + "description": "If `true` then ingest metadata `_ingest._redact._is_redacted` is set to `true` if the document has been redacted", + "x-available-since": "8.16.0", + "type": "boolean" } }, "required": [ @@ -47612,6 +47617,9 @@ "ingest.simulate:Ingest": { "type": "object", "properties": { + "_redact": { + "$ref": "#/components/schemas/ingest.simulate:Redact" + }, "timestamp": { "$ref": "#/components/schemas/_types:DateTime" }, @@ -47623,6 +47631,18 @@ "timestamp" ] }, + "ingest.simulate:Redact": { + "type": "object", + "properties": { + "_is_redacted": { + "description": "indicates if document has been redacted", + "type": "boolean" + } + }, + "required": [ + "_is_redacted" + ] + }, "_spec_utils:StringifiedVersionNumber": { "description": "Some APIs will return values such as numbers also as a string (notably epoch timestamps). This behavior\nis used to capture this behavior while keeping the semantics of the field type.\n\nDepending on the target language, code generators can keep the union or remove it and leniently parse\nstrings to the target type.", "oneOf": [ diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 429fb79046..3033f8080e 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -94180,7 +94180,7 @@ "name": "ShapeType", "namespace": "ingest._types" }, - "specLocation": "ingest/_types/Processors.ts#L1225-L1228" + "specLocation": "ingest/_types/Processors.ts#L1232-L1235" }, { "kind": "enum", @@ -123531,9 +123531,28 @@ "namespace": "_builtins" } } + }, + { + "availability": { + "serverless": {}, + "stack": { + "since": "8.16.0" + } + }, + "description": "If `true` then ingest metadata `_ingest._redact._is_redacted` is set to `true` if the document has been redacted", + "name": "trace_redact", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ], - "specLocation": "ingest/_types/Processors.ts#L1056-L1090" + "specLocation": "ingest/_types/Processors.ts#L1056-L1097" }, { "inherits": { @@ -123586,7 +123605,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1092-L1106" + "specLocation": "ingest/_types/Processors.ts#L1099-L1113" }, { "inherits": { @@ -123639,7 +123658,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1108-L1124" + "specLocation": "ingest/_types/Processors.ts#L1115-L1131" }, { "inherits": { @@ -123721,7 +123740,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1126-L1154" + "specLocation": "ingest/_types/Processors.ts#L1133-L1161" }, { "inherits": { @@ -123793,7 +123812,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1156-L1176" + "specLocation": "ingest/_types/Processors.ts#L1163-L1183" }, { "inherits": { @@ -123879,7 +123898,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1178-L1212" + "specLocation": "ingest/_types/Processors.ts#L1185-L1219" }, { "inherits": { @@ -123922,7 +123941,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1214-L1223" + "specLocation": "ingest/_types/Processors.ts#L1221-L1230" }, { "inherits": { @@ -123975,7 +123994,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1230-L1246" + "specLocation": "ingest/_types/Processors.ts#L1237-L1253" }, { "inherits": { @@ -124054,7 +124073,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1248-L1273" + "specLocation": "ingest/_types/Processors.ts#L1255-L1280" }, { "inherits": { @@ -124108,7 +124127,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1275-L1291" + "specLocation": "ingest/_types/Processors.ts#L1282-L1298" }, { "inherits": { @@ -124162,7 +124181,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1293-L1309" + "specLocation": "ingest/_types/Processors.ts#L1300-L1316" }, { "inherits": { @@ -124216,7 +124235,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1311-L1327" + "specLocation": "ingest/_types/Processors.ts#L1318-L1334" }, { "inherits": { @@ -124296,7 +124315,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1329-L1355" + "specLocation": "ingest/_types/Processors.ts#L1336-L1362" }, { "inherits": { @@ -124451,7 +124470,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L50-L64" + "specLocation": "ingest/simulate/types.ts#L62-L76" }, { "kind": "interface", @@ -124497,7 +124516,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L34-L38" + "specLocation": "ingest/simulate/types.ts#L46-L50" }, { "attachedBehaviors": [ @@ -124637,7 +124656,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L66-L96" + "specLocation": "ingest/simulate/types.ts#L78-L108" }, { "kind": "interface", @@ -124646,6 +124665,23 @@ "namespace": "ingest.simulate" }, "properties": [ + { + "availability": { + "serverless": {}, + "stack": { + "since": "8.16.0" + } + }, + "name": "_redact", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Redact", + "namespace": "ingest.simulate" + } + } + }, { "name": "timestamp", "required": true, @@ -124669,7 +124705,29 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L29-L32" + "specLocation": "ingest/simulate/types.ts#L29-L37" + }, + { + "kind": "interface", + "name": { + "name": "Redact", + "namespace": "ingest.simulate" + }, + "properties": [ + { + "description": "indicates if document has been redacted", + "name": "_is_redacted", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "ingest/simulate/types.ts#L39-L44" }, { "kind": "interface", @@ -124756,7 +124814,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L40-L48" + "specLocation": "ingest/simulate/types.ts#L52-L60" }, { "kind": "interface", diff --git a/output/schema/schema.json b/output/schema/schema.json index ffd74d6c66..0f0ef7c955 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -143532,9 +143532,28 @@ "namespace": "_builtins" } } + }, + { + "availability": { + "serverless": {}, + "stack": { + "since": "8.16.0" + } + }, + "description": "If `true` then ingest metadata `_ingest._redact._is_redacted` is set to `true` if the document has been redacted", + "name": "trace_redact", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ], - "specLocation": "ingest/_types/Processors.ts#L1056-L1090" + "specLocation": "ingest/_types/Processors.ts#L1056-L1097" }, { "kind": "interface", @@ -143587,7 +143606,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1092-L1106" + "specLocation": "ingest/_types/Processors.ts#L1099-L1113" }, { "kind": "interface", @@ -143640,7 +143659,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1108-L1124" + "specLocation": "ingest/_types/Processors.ts#L1115-L1131" }, { "kind": "interface", @@ -143722,7 +143741,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1126-L1154" + "specLocation": "ingest/_types/Processors.ts#L1133-L1161" }, { "kind": "interface", @@ -143794,7 +143813,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1156-L1176" + "specLocation": "ingest/_types/Processors.ts#L1163-L1183" }, { "kind": "interface", @@ -143880,7 +143899,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1178-L1212" + "specLocation": "ingest/_types/Processors.ts#L1185-L1219" }, { "kind": "interface", @@ -143923,7 +143942,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1214-L1223" + "specLocation": "ingest/_types/Processors.ts#L1221-L1230" }, { "kind": "enum", @@ -143939,7 +143958,7 @@ "name": "ShapeType", "namespace": "ingest._types" }, - "specLocation": "ingest/_types/Processors.ts#L1225-L1228" + "specLocation": "ingest/_types/Processors.ts#L1232-L1235" }, { "kind": "interface", @@ -143992,7 +144011,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1230-L1246" + "specLocation": "ingest/_types/Processors.ts#L1237-L1253" }, { "kind": "interface", @@ -144071,7 +144090,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1248-L1273" + "specLocation": "ingest/_types/Processors.ts#L1255-L1280" }, { "kind": "interface", @@ -144125,7 +144144,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1275-L1291" + "specLocation": "ingest/_types/Processors.ts#L1282-L1298" }, { "kind": "interface", @@ -144179,7 +144198,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1293-L1309" + "specLocation": "ingest/_types/Processors.ts#L1300-L1316" }, { "kind": "interface", @@ -144259,7 +144278,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1329-L1355" + "specLocation": "ingest/_types/Processors.ts#L1336-L1362" }, { "kind": "interface", @@ -144313,7 +144332,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1311-L1327" + "specLocation": "ingest/_types/Processors.ts#L1318-L1334" }, { "kind": "interface", @@ -145451,7 +145470,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L50-L64" + "specLocation": "ingest/simulate/types.ts#L62-L76" }, { "kind": "interface", @@ -145591,7 +145610,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L66-L96" + "specLocation": "ingest/simulate/types.ts#L78-L108" }, { "kind": "interface", @@ -145600,6 +145619,23 @@ "namespace": "ingest.simulate" }, "properties": [ + { + "availability": { + "serverless": {}, + "stack": { + "since": "8.16.0" + } + }, + "name": "_redact", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Redact", + "namespace": "ingest.simulate" + } + } + }, { "name": "timestamp", "required": true, @@ -145623,7 +145659,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L29-L32" + "specLocation": "ingest/simulate/types.ts#L29-L37" }, { "kind": "interface", @@ -145710,7 +145746,29 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L40-L48" + "specLocation": "ingest/simulate/types.ts#L52-L60" + }, + { + "kind": "interface", + "name": { + "name": "Redact", + "namespace": "ingest.simulate" + }, + "properties": [ + { + "description": "indicates if document has been redacted", + "name": "_is_redacted", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "ingest/simulate/types.ts#L39-L44" }, { "kind": "request", @@ -145861,7 +145919,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L34-L38" + "specLocation": "ingest/simulate/types.ts#L46-L50" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index b557687905..837ca282c1 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -13063,6 +13063,7 @@ export interface IngestRedactProcessor extends IngestProcessorBase { suffix?: string ignore_missing?: boolean skip_if_unlicensed?: boolean + trace_redact?: boolean } export interface IngestRemoveProcessor extends IngestProcessorBase { @@ -13278,6 +13279,7 @@ export type IngestSimulateDocumentSimulation = IngestSimulateDocumentSimulationK & { [property: string]: string | Id | IndexName | IngestSimulateIngest | Record | SpecUtilsStringified | VersionType } export interface IngestSimulateIngest { + _redact?: IngestSimulateRedact timestamp: DateTime pipeline?: Name } @@ -13292,6 +13294,10 @@ export interface IngestSimulatePipelineSimulation { error?: ErrorCause } +export interface IngestSimulateRedact { + _is_redacted: boolean +} + export interface IngestSimulateRequest extends RequestBase { id?: Id verbose?: boolean diff --git a/specification/ingest/_types/Processors.ts b/specification/ingest/_types/Processors.ts index 33212aeaf9..27b0729437 100644 --- a/specification/ingest/_types/Processors.ts +++ b/specification/ingest/_types/Processors.ts @@ -1087,6 +1087,13 @@ export class RedactProcessor extends ProcessorBase { * @server_default false */ skip_if_unlicensed?: boolean + /** + * If `true` then ingest metadata `_ingest._redact._is_redacted` is set to `true` if the document has been redacted + * @availability stack since=8.16.0 + * @availability serverless + * @server_default false + */ + trace_redact?: boolean } export class RemoveProcessor extends ProcessorBase { diff --git a/specification/ingest/simulate/types.ts b/specification/ingest/simulate/types.ts index 50b113ff08..601377f7ac 100644 --- a/specification/ingest/simulate/types.ts +++ b/specification/ingest/simulate/types.ts @@ -27,10 +27,22 @@ import { ErrorCause } from '@_types/Errors' import { DateTime } from '@_types/Time' export class Ingest { + /** + * @availability stack since=8.16.0 + * @availability serverless + */ + _redact?: Redact timestamp: DateTime pipeline?: Name } +export class Redact { + /** + * indicates if document has been redacted + */ + _is_redacted: boolean +} + export class SimulateDocumentResult { doc?: DocumentSimulation error?: ErrorCause