Kuadrant / wasm-shim

A Proxy-Wasm module allowing communication to Authorino and Limitador.
Apache License 2.0
5 stars 4 forks source link

Wasm configuration v2 #37

Closed eguzki closed 1 year ago

eguzki commented 1 year ago

What

Fixes #35 Depends on https://github.com/Kuadrant/wasm-test-framework/pull/1 for e2e tests to pass

Example to illustrate the new wasm shim configuration struct

failureMode: deny
rateLimitPolicies:
  - name: rlp-ns-A/rlp-name-A
    domain: rlp-ns-A/rlp-name-A
    service: rate-limit-cluster
    hostnames: ["*.toystore.com"]
    rules:   
      - conditions:      
        - allOf:
          - selector: <value>
            operator: <value>
            value: <value>
          - selector: <value>
            operator: <value>
            value: <value>
        - allOf:
          - selector: <value>
            operator: <value>
            value: <value>
          - selector: <value>
            operator: <value>
            value: <value>
        data:
        - selector:
            selector: <value>       # Any attribute from a well-known specification TBD ([ref](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/advanced/attributes#arch-overview-request-attributes))
            key: <value>             # Optional. If not set it defaults to `selector` field value as the descriptor key.
            default: <value>        # Optional. An optional value to use if metadata_key is empty. If not set and no value is present under the metadata_key then no descriptor is generated.
        - static:   
            key: <value>             # Required
            value: <value>          # Required

TODO:

guicassolato commented 1 year ago

LGTM so far, @eguzki. Nice job!

eguzki commented 1 year ago

@guicassolato ready for another review as you requested changes

eguzki commented 1 year ago

green :partying_face: