TrueChartsClone/templates/questions/traefik/rewriteResponseHeadersMiddl...

50 lines
2.1 KiB
YAML
Raw Normal View History

feat(traefik): Add traefik-plugin-rewrite-headers (#13961) **Description** <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> ⚒️ Fixes # <!--(issue)--> Adding a simple plugin that allows for editing/rewriting response headers. It can be used to rewrite any response header. In the chart values, I have given a (perhaps not very exciting) example with the `Location` header. **⚙️ Type of change** - [X] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** <!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration --> Tested with native helm - deployed Traefik, added an ingress in front of a simple custom-app that returns an HTTP301 on every request. With this plugin, I was able to rewrite the Location (or any other) header in the returned response. **📃 Notes:** <!-- Please enter any other relevant information here --> Plugin: https://plugins.traefik.io/plugins/628c9eb5108ecc83915d7758/rewrite-header Corresponding container changes PR: https://github.com/truecharts/containers/pull/33731 **✔️ Checklist:** - [X] ⚖️ My code follows the style guidelines of this project - [X] 👀 I have performed a self-review of my own code - [X] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [X] ⚠️ My changes generate no new warnings - [X] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [X] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [X] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: sdimovv <36302090+sdimovv@users.noreply.github.com>
2023-10-27 18:15:37 +00:00
- variable: rewriteResponseHeaders
label: Rewrite Response Headers
schema:
type: list
default: []
items:
- variable: rewriteResponseHeadersEntry
label: ""
schema:
additional_attrs: true
type: dict
attrs:
- variable: name
label: Name
schema:
type: string
required: true
- variable: headers
label: Headers To Rewrite
schema:
type: list
default: []
items:
- variable: headersEntry
label: ""
schema:
additional_attrs: true
type: dict
attrs:
- variable: name
label: Header Name
description: Name of a header to modified in responses, eg. X-Custom-Header
schema:
valid_chars: ^[a-zA-Z0-9_\-]*$
type: string
required: true
default: ""
- variable: regex
label: Regex
description: The value of the header to match. Accepts regex expression.
schema:
type: string
default: ""
- variable: replacement
label: Replacement Regex
description: The new value of the header. Accepts regex expression.
schema:
type: string
default: ""