proxy-wasm-http-cookie-header-convert

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 2 Imported by: 0

README

A proxy-wasm compliant WebAssembly module for making proxies convert an HTTP Cookie to a Header.

Overview

This proxy-wasm compliant WebAssembly module makes proxies convert a HTTP Cookie to a Header.

Usage

  1. Download the latest WebAssembly module binary from the release page.

  2. Configure the proxy to use the WebAssembly module like below (this assumes Envoy as the proxy):

listeners:
  - name: example
    filter_chains:
      - filters:
          - name: envoy.filters.network.http_connection_manager
            typed_config:
              # ...
              http_filters:
                - name: envoy.filters.http.wasm
                  typed_config:
                    '@type': type.googleapis.com/udpa.type.v1.TypedStruct
                    type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm
                    value:
                      config:
                        vm_config:
                          runtime: envoy.wasm.runtime.v8
                          code:
                            local:
                              filename: /etc/envoy/proxy-wasm-http-cookie-header-convert.wasm
                        configuration:
                          "@type": type.googleapis.com/google.protobuf.StringValue
                          value: |
                            {
                              "cookie_name": "access_token",
                              "header_name": "authorization",
                              "header_value_prefix": "bearer "
                            }
                - name: envoy.filters.http.router
                  typed_config:
                    '@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router

We can also configure this WebAssembly module for the per Route basis by using the Composite Filter. See the example envoy.yaml for more details.

Plugin Configurations
  • cookie_name (Required)
    • The name of a HTTP Cookie you want to convert to a Header.
  • header_name (Required)
    • The name of a destination HTTP Header.
  • header_value_prefix (Optional)
    • The prefix of a destination HTTP Header.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL