Skip to content
Merged
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
26 changes: 19 additions & 7 deletions policy/v1beta1/cfg.pb.go

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

30 changes: 22 additions & 8 deletions policy/v1beta1/cfg.proto
Original file line number Diff line number Diff line change
Expand Up @@ -127,31 +127,45 @@ message Rule {
// Optional. The actions that will be executed when match evaluates to `true`.
repeated Action actions = 2;

// A template for an HTTP header manipulation.
// A template for an HTTP header manipulation. Values in the template are expressions
// that may reference action outputs by name. For example, if an action `x` produces an output
// with a field `f`, then the header value expressions may use attribute `x.output.f` to reference
// the field value:
// ```yaml
// request_header_operations:
// - name: x-istio-header
// values:
// - x.output.f
// ```
message HeaderOperationTemplate {

// Required. Header name.
// Required. Header name literal value.
string name = 1;

// Optional. Header values to replace or append.
// Optional. Header value expressions.
repeated string values = 2;

// Header operation type.
enum Operation {
REPLACE = 0; // replaces the header with the given name
REMOVE = 1; // removes the header with the given name (the value is ignored)
APPEND = 2; // appends the values to the existing values (preserving existing values)
// Replace a header by name.
REPLACE = 0;

// Remove a header by name. Values are ignored.
REMOVE = 1;

// Append values to the existing header values.
APPEND = 2;
}

// Optional. Header operation type. Default operation is to replace the value of the header by name.
Operation operation = 3;
}

// Optional. Templatized operations on the request headers using attributes produced by the
// Optional. Templatized operations on the request headers using values produced by the
// rule actions.
repeated HeaderOperationTemplate request_header_operations = 3;

// Optional. Templatized operations on the response headers using attributes produced by the
// Optional. Templatized operations on the response headers using values produced by the
// rule actions.
repeated HeaderOperationTemplate response_header_operations = 4;

Expand Down
25 changes: 17 additions & 8 deletions policy/v1beta1/istio.policy.v1beta1.pb.html
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ <h2 id="Rule">Rule</h2>
<td><code>requestHeaderOperations</code></td>
<td><code><a href="#Rule-HeaderOperationTemplate">Rule.HeaderOperationTemplate[]</a></code></td>
<td>
<p>Optional. Templatized operations on the request headers using attributes produced by the
<p>Optional. Templatized operations on the request headers using values produced by the
rule actions.</p>

</td>
Expand All @@ -642,7 +642,7 @@ <h2 id="Rule">Rule</h2>
<td><code>responseHeaderOperations</code></td>
<td><code><a href="#Rule-HeaderOperationTemplate">Rule.HeaderOperationTemplate[]</a></code></td>
<td>
<p>Optional. Templatized operations on the response headers using attributes produced by the
<p>Optional. Templatized operations on the response headers using values produced by the
rule actions.</p>

</td>
Expand All @@ -652,7 +652,16 @@ <h2 id="Rule">Rule</h2>
</section>
<h2 id="Rule-HeaderOperationTemplate">Rule.HeaderOperationTemplate</h2>
<section>
<p>A template for an HTTP header manipulation.</p>
<p>A template for an HTTP header manipulation. Values in the template are expressions
that may reference action outputs by name. For example, if an action <code>x</code> produces an output
with a field <code>f</code>, then the header value expressions may use attribute <code>x.output.f</code> to reference
the field value:</p>

<pre><code class="language-yaml">request_header_operations:
- name: x-istio-header
values:
- x.output.f
</code></pre>

<table class="message-fields">
<thead>
Expand All @@ -667,15 +676,15 @@ <h2 id="Rule-HeaderOperationTemplate">Rule.HeaderOperationTemplate</h2>
<td><code>name</code></td>
<td><code>string</code></td>
<td>
<p>Required. Header name.</p>
<p>Required. Header name literal value.</p>

</td>
</tr>
<tr id="Rule-HeaderOperationTemplate-values">
<td><code>values</code></td>
<td><code>string[]</code></td>
<td>
<p>Optional. Header values to replace or append.</p>
<p>Optional. Header value expressions.</p>

</td>
</tr>
Expand Down Expand Up @@ -705,21 +714,21 @@ <h2 id="Rule-HeaderOperationTemplate-Operation">Rule.HeaderOperationTemplate.Ope
<tr id="Rule-HeaderOperationTemplate-Operation-REPLACE">
<td><code>REPLACE</code></td>
<td>
<p>replaces the header with the given name</p>
<p>Replace a header by name.</p>

</td>
</tr>
<tr id="Rule-HeaderOperationTemplate-Operation-REMOVE">
<td><code>REMOVE</code></td>
<td>
<p>removes the header with the given name (the value is ignored)</p>
<p>Remove a header by name. Values are ignored.</p>

</td>
</tr>
<tr id="Rule-HeaderOperationTemplate-Operation-APPEND">
<td><code>APPEND</code></td>
<td>
<p>appends the values to the existing values (preserving existing values)</p>
<p>Append values to the existing header values.</p>

</td>
</tr>
Expand Down