From 73db6826a0be23b2226dd7def86b56dc3968bc9f Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 30 Sep 2024 13:59:12 +0400 Subject: [PATCH] Add trace_redact to RedactProcessor (#2965) * Add trace_redact to RedactProcessor * Move availability annotation (cherry picked from commit 593ad71db4f18e4d9f11b4f8b829aacfb55007ef) --- 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 ac66ec3f87..5ab9153de3 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -70579,6 +70579,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": [ @@ -71068,6 +71073,9 @@ "ingest.simulate:Ingest": { "type": "object", "properties": { + "_redact": { + "$ref": "#/components/schemas/ingest.simulate:Redact" + }, "timestamp": { "$ref": "#/components/schemas/_types:DateTime" }, @@ -71079,6 +71087,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 82950b5273..4b87ec3d78 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -47117,6 +47117,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": [ @@ -47606,6 +47611,9 @@ "ingest.simulate:Ingest": { "type": "object", "properties": { + "_redact": { + "$ref": "#/components/schemas/ingest.simulate:Redact" + }, "timestamp": { "$ref": "#/components/schemas/_types:DateTime" }, @@ -47617,6 +47625,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 9c0340cb2e..a180ca4ee1 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -94167,7 +94167,7 @@ "name": "ShapeType", "namespace": "ingest._types" }, - "specLocation": "ingest/_types/Processors.ts#L1225-L1228" + "specLocation": "ingest/_types/Processors.ts#L1232-L1235" }, { "kind": "enum", @@ -123518,9 +123518,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": { @@ -123573,7 +123592,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1092-L1106" + "specLocation": "ingest/_types/Processors.ts#L1099-L1113" }, { "inherits": { @@ -123626,7 +123645,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1108-L1124" + "specLocation": "ingest/_types/Processors.ts#L1115-L1131" }, { "inherits": { @@ -123708,7 +123727,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1126-L1154" + "specLocation": "ingest/_types/Processors.ts#L1133-L1161" }, { "inherits": { @@ -123780,7 +123799,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1156-L1176" + "specLocation": "ingest/_types/Processors.ts#L1163-L1183" }, { "inherits": { @@ -123866,7 +123885,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1178-L1212" + "specLocation": "ingest/_types/Processors.ts#L1185-L1219" }, { "inherits": { @@ -123909,7 +123928,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1214-L1223" + "specLocation": "ingest/_types/Processors.ts#L1221-L1230" }, { "inherits": { @@ -123962,7 +123981,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1230-L1246" + "specLocation": "ingest/_types/Processors.ts#L1237-L1253" }, { "inherits": { @@ -124041,7 +124060,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1248-L1273" + "specLocation": "ingest/_types/Processors.ts#L1255-L1280" }, { "inherits": { @@ -124095,7 +124114,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1275-L1291" + "specLocation": "ingest/_types/Processors.ts#L1282-L1298" }, { "inherits": { @@ -124149,7 +124168,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1293-L1309" + "specLocation": "ingest/_types/Processors.ts#L1300-L1316" }, { "inherits": { @@ -124203,7 +124222,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1311-L1327" + "specLocation": "ingest/_types/Processors.ts#L1318-L1334" }, { "inherits": { @@ -124283,7 +124302,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1329-L1355" + "specLocation": "ingest/_types/Processors.ts#L1336-L1362" }, { "inherits": { @@ -124438,7 +124457,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L50-L64" + "specLocation": "ingest/simulate/types.ts#L62-L76" }, { "kind": "interface", @@ -124484,7 +124503,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L34-L38" + "specLocation": "ingest/simulate/types.ts#L46-L50" }, { "attachedBehaviors": [ @@ -124624,7 +124643,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L66-L96" + "specLocation": "ingest/simulate/types.ts#L78-L108" }, { "kind": "interface", @@ -124633,6 +124652,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, @@ -124656,7 +124692,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", @@ -124743,7 +124801,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 adc529ce21..b0472757a2 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -143519,9 +143519,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", @@ -143574,7 +143593,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1092-L1106" + "specLocation": "ingest/_types/Processors.ts#L1099-L1113" }, { "kind": "interface", @@ -143627,7 +143646,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1108-L1124" + "specLocation": "ingest/_types/Processors.ts#L1115-L1131" }, { "kind": "interface", @@ -143709,7 +143728,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1126-L1154" + "specLocation": "ingest/_types/Processors.ts#L1133-L1161" }, { "kind": "interface", @@ -143781,7 +143800,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1156-L1176" + "specLocation": "ingest/_types/Processors.ts#L1163-L1183" }, { "kind": "interface", @@ -143867,7 +143886,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1178-L1212" + "specLocation": "ingest/_types/Processors.ts#L1185-L1219" }, { "kind": "interface", @@ -143910,7 +143929,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1214-L1223" + "specLocation": "ingest/_types/Processors.ts#L1221-L1230" }, { "kind": "enum", @@ -143926,7 +143945,7 @@ "name": "ShapeType", "namespace": "ingest._types" }, - "specLocation": "ingest/_types/Processors.ts#L1225-L1228" + "specLocation": "ingest/_types/Processors.ts#L1232-L1235" }, { "kind": "interface", @@ -143979,7 +143998,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1230-L1246" + "specLocation": "ingest/_types/Processors.ts#L1237-L1253" }, { "kind": "interface", @@ -144058,7 +144077,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1248-L1273" + "specLocation": "ingest/_types/Processors.ts#L1255-L1280" }, { "kind": "interface", @@ -144112,7 +144131,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1275-L1291" + "specLocation": "ingest/_types/Processors.ts#L1282-L1298" }, { "kind": "interface", @@ -144166,7 +144185,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1293-L1309" + "specLocation": "ingest/_types/Processors.ts#L1300-L1316" }, { "kind": "interface", @@ -144246,7 +144265,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1329-L1355" + "specLocation": "ingest/_types/Processors.ts#L1336-L1362" }, { "kind": "interface", @@ -144300,7 +144319,7 @@ } } ], - "specLocation": "ingest/_types/Processors.ts#L1311-L1327" + "specLocation": "ingest/_types/Processors.ts#L1318-L1334" }, { "kind": "interface", @@ -145438,7 +145457,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L50-L64" + "specLocation": "ingest/simulate/types.ts#L62-L76" }, { "kind": "interface", @@ -145578,7 +145597,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L66-L96" + "specLocation": "ingest/simulate/types.ts#L78-L108" }, { "kind": "interface", @@ -145587,6 +145606,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, @@ -145610,7 +145646,7 @@ } } ], - "specLocation": "ingest/simulate/types.ts#L29-L32" + "specLocation": "ingest/simulate/types.ts#L29-L37" }, { "kind": "interface", @@ -145697,7 +145733,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", @@ -145848,7 +145906,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 424ad8a4b3..9ff1df683c 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