kotsikau/addRequestHeader

1.0.0
addRequestHeader mediation policy

This Ballerina mediation policy adds a configured HTTP header to every outbound backend request in a request flow.

What it does

  • Reads headerName and headerValue policy parameters.
  • Fails fast when headerName is missing or empty.
  • Overwrites any existing request header with the same name.
  • Does not log the header value.

Policy parameters

  • headerName
  • headerValue

Both parameters can be provided directly or through deploy-time variables or secrets, for example:

  • ${CUSTOM_HEADER_NAME}
  • ${CUSTOM_HEADER_VALUE}

Build and publish

From the project root:

Copy
bal pack
bal push

Attach in Bijira/API Platform Console

  1. Open the API proxy.
  2. Go to Develop -> Policies.
  3. Attach addRequestHeader to the Request flow.
  4. Configure headerName and headerValue.

Notes

  • This policy is request-flow only.
  • No Java mediator, Redis, or external service is required.

Import

import kotsikau/addRequestHeader;Copy

Other versions

1.0.0

Metadata

Released date: 15 days ago

Version: 1.0.0


Compatibility

Platform: any

Ballerina version: 2201.13.3

GraalVM compatible: Yes


Pull count

Total: 0

Current verison: 0


Weekly downloads



Keywords

choreo-apim-mediation-policy

choreo-apim-mediation-request-flow