wso2 / apk

Official Repository for APK distribution
Apache License 2.0
148 stars 89 forks source link

Add support for HeaderModifier filter in Config Deployer #2381

Closed sgayangi closed 1 week ago

sgayangi commented 1 month ago

Purpose

This PR adds the config deployer level support for the HeaderModifier filter, as detailed in https://github.com/wso2/apk/issues/2378

Sample apk-conf file would be

id: "f7996dce4ac15e2af0f8ee14546c4f72988eddae"
name: "EmployeeServiceAPI"
basePath: "/test"
version: "3.14"
type: "REST"
defaultVersion: false
endpointConfigurations:
  production:
    endpoint: "https://httpbin.org/anything"
operations:
  - target: "/employee"
    verb: "GET"
    secured: false
    scopes: []
    operationPolicies:
      request:
        - policyName: AddHeaders
          policyVersion: v1
          parameters:
            headers:
              - name: "Test-Request-Header"
                value: "Test-Value"
        - policyName: SetHeaders
          policyVersion: v1
          parameters:
            headers:
              - name: "Set-Request-Header"
                value: "Test-Value"
        - policyName: RemoveHeaders
          policyVersion: v1
          parameters:
            headers:
              - "X-Test-Header"
  - target: "/employee"
    verb: "POST"
    secured: true
    scopes: []
  - target: "/employee/{employeeId}"
    verb: "PUT"
    secured: true
    scopes: []
  - target: "/employee/{employeeId}"
    verb: "DELETE"
    secured: true
    scopes: []