Request headers and body asvaialble as properties

Hi,

We are working on a Mixer adapter (soon to be announced as an open source) and we hit the wall regarding the following:

a) request.headers

Right now, the only way we managed to get an header (apater.yaml: spec > params > subject > properties) is by specifying its name. e.g.

 params:
   subject:
     properties:
       request_header_accept: request.headers["accept"] | ""
       request_header_accept_charset: request.headers["accept-charset"] | ""
       request_header_accept_encoding: request.headers["accept-encoding"] | ""

While he far better approach would be

 params:
   subject:
     properties:
       request_headers: request.headers

While the documentation refers to this as a valid option, we could not get it work (property as map[string]string).

b) Request Body
As of now, we could not find a hint in the documentation how to rebuild a mixer with a templtate that sends the request body, although it should be avaialble if we look at Envoy attributes context proto

We cane across this TBD https://github.com/istio/istio/wiki/Mixer-Template-Dev-Guide#adding-a-template-to-mixer and got stuck since.

Any help is appreciated!

1 Like

What does the template look like for your intended use of request_headers ?

Request body has never been available through Mixer. The Envoy attributes context is distinct from the attributes and protocol used by Mixer (though there is some confusing overlap). The attributes vocab page you list is the full set supported by Mixer.

Stepping back a bit: is this for a custom policy extension? Is that why you desire access to the body?

Thanks Douglas.

It is indeed for a custom policy purposes.

As it seems , we will either go with a custom version of the platform (adding this capability) or move our business logic to the Envoy layer.