HeaderOperation support value in map type?

Hi all
I have an output template.

package ingresstoken;
import "mixer/adapter/model/v1beta1/extensions.proto";
option (istio.mixer.adapter.model.v1beta1.template_variety) = TEMPLATE_VARIETY_CHECK_WITH_OUTPUT;
message Template {
  string token = 1;
  string path  = 2;
  string host  = 3;
}

message OutputTemplate {
  string appid = 1;
  string userid = 2;
  string role = 3;
  string username = 4;
  map<string, string> extends = 5;
}

When I create rule as below.
I want to replace the the header “ext” with “ext” which is in “extends” map, but not effect

---
apiVersion: config.istio.io/v1alpha2
kind: rule
metadata:
  name: r2
  namespace: istio-system
spec:
  match: context.reporter.kind == "outbound" && source.labels["istio"] == "ingressgateway" 
  actions:
  - handler: h1.istio-system
    instances: ["i1"]
    name: a1
  responseHeaderOperations:
  - name: ext
    values:
    - a1.output.extends["ext"]

So, HeaderOperation support value in map type?

The Istio version is 1.1.3

Hi!

Yes, it should support top-level maps in the output template. The support is the same as for the attribute-producing adapters (e.g. kubernetes metadata).

There is an integration test that exercises this behavior:

Can you make sure you supply the value for the map key? Perhaps, use something like a1.output.extends["ext"] | "" to provide a default value. Do you see anything in the istio-policy logs that could indicate an issue?

Best,
–kuat

Thanks kuat, by checking policy log, I found my config’s wrong.