Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: add metadata and attribute options for ext-proc #3247

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions api/v1alpha1/ext_proc_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,43 @@ type ExtProcProcessingMode struct {
Response *ProcessingModeOptions `json:"response,omitempty"`
}

// ExtProcAttributes defines which envoy attributes are sent for requests and responses to the external processor
type ExtProcAttributes struct {
// defines attributes to send for Request processing
//
// +optional
Request []string `json:"request,omitempty"`

// defines attributes to send for Response processing
//
// +optional
Response []string `json:"response,omitempty"`
}

// MetadataNamespaces defines metadata namespaces that can be used to forward or receive dynamic metadata from the
// external processor
type MetadataNamespaces struct {
// Specifies a list of metadata namespaces whose values, if present, will be passed to the ext_proc service
// as an opaque protobuf::Struct.
//
// +optional
Untyped []string `json:"untyped,omitempty"`
}

// ExtProcMetadataOptions defines options related to the sending and receiving of dynamic metadata to and from the
// external processor service
type ExtProcMetadataOptions struct {
// metadata namespaces forwarded to external processor
//
// +optional
ForwardingNamespaces *MetadataNamespaces `json:"forwardingNamespaces,omitempty"`

// metadata namespaces updatable by external processor
//
// +optional
ReceivingNamespaces *MetadataNamespaces `json:"receivingNamespaces,omitempty"`
}

// ExtProc defines the configuration for External Processing filter.
type ExtProc struct {
// BackendRefs defines the configuration of the external processing service
Expand Down Expand Up @@ -73,4 +110,16 @@ type ExtProc struct {
//
// +optional
ProcessingMode *ExtProcProcessingMode `json:"processingMode,omitempty"`

// Attributes defines which envoy request and response attributes are provided as context to external processor
// Default: no attributes are sent
//
// +optional
Attributes *ExtProcAttributes `json:"attributes,omitempty"`

// MetadataOptions defines options related to the sending and receiving of dynamic metadata
// Default: no metadata context is sent or received
//
// +optional
MetadataOptions *ExtProcMetadataOptions `json:"metadataOptions,omitempty"`
}
80 changes: 80 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ spec:
description: ExtProc defines the configuration for External Processing
filter.
properties:
attributes:
description: |-
Attributes defines which envoy request and response attributes are provided as context to external processor
Default: no attributes are sent
properties:
request:
description: defines attributes to send for Request processing
items:
type: string
type: array
response:
description: defines attributes to send for Response processing
items:
type: string
type: array
type: object
backendRefs:
description: BackendRefs defines the configuration of the external
processing service
Expand Down Expand Up @@ -154,6 +170,34 @@ spec:
Default: 200ms
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
type: string
metadataOptions:
description: |-
MetadataOptions defines options related to the sending and receiving of dynamic metadata
Default: no metadata context is sent or received
properties:
forwardingNamespaces:
description: metadata namespaces forwarded to external processor
properties:
untyped:
description: |-
Specifies a list of metadata namespaces whose values, if present, will be passed to the ext_proc service
as an opaque protobuf::Struct.
items:
type: string
type: array
type: object
receivingNamespaces:
description: metadata namespaces updatable by external processor
properties:
untyped:
description: |-
Specifies a list of metadata namespaces whose values, if present, will be passed to the ext_proc service
as an opaque protobuf::Struct.
items:
type: string
type: array
type: object
type: object
processingMode:
description: |-
ProcessingMode defines how request and response body is processed
Expand Down
48 changes: 48 additions & 0 deletions site/content/en/latest/api/extension_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,23 @@ _Appears in:_
| `messageTimeout` | _[Duration](#duration)_ | false | MessageTimeout is the timeout for a response to be returned from the external processor<br />Default: 200ms |
| `failOpen` | _boolean_ | false | FailOpen defines if requests or responses that cannot be processed due to connectivity to the<br />external processor are terminated or passed-through.<br />Default: false |
| `processingMode` | _[ExtProcProcessingMode](#extprocprocessingmode)_ | false | ProcessingMode defines how request and response body is processed<br />Default: header and body are not sent to the external processor |
| `attributes` | _[ExtProcAttributes](#extprocattributes)_ | false | Attributes defines which envoy request and response attributes are provided as context to external processor<br />Default: no attributes are sent |
| `metadataOptions` | _[ExtProcMetadataOptions](#extprocmetadataoptions)_ | false | MetadataOptions defines options related to the sending and receiving of dynamic metadata<br />Default: no metadata context is sent or received |


#### ExtProcAttributes



ExtProcAttributes defines which envoy attributes are sent for requests and responses to the external processor

_Appears in:_
- [ExtProc](#extproc)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `request` | _string array_ | false | defines attributes to send for Request processing |
| `response` | _string array_ | false | defines attributes to send for Response processing |


#### ExtProcBodyProcessingMode
Expand All @@ -1233,6 +1250,22 @@ _Appears in:_
| `BufferedPartial` | BufferedPartialExtBodyHeaderProcessingMode will buffer the message body in memory and send the entire body in one chunk. If the body exceeds the configured buffer limit, then the body contents up to the buffer limit will be sent.<br /> |


#### ExtProcMetadataOptions



ExtProcMetadataOptions defines options related to the sending and receiving of dynamic metadata to and from the
external processor service

_Appears in:_
- [ExtProc](#extproc)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `forwardingNamespaces` | _[MetadataNamespaces](#metadatanamespaces)_ | false | metadata namespaces forwarded to external processor |
| `receivingNamespaces` | _[MetadataNamespaces](#metadatanamespaces)_ | false | metadata namespaces updatable by external processor |


#### ExtProcProcessingMode


Expand Down Expand Up @@ -2074,6 +2107,21 @@ _Appears in:_



#### MetadataNamespaces



MetadataNamespaces defines metadata namespaces that can be used to forward or receive dynamic metadata from the
external processor

_Appears in:_
- [ExtProcMetadataOptions](#extprocmetadataoptions)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `untyped` | _string array_ | false | Specifies a list of metadata namespaces whose values, if present, will be passed to the ext_proc service<br />as an opaque protobuf::Struct. |


#### MetricSinkType

_Underlying type:_ _string_
Expand Down
Loading