Files
a27d735b9d feat(common): restructure traefik/ingress middlewares (#31171)
**Description**

moves the middlewares around and adds unit tests

**⚙️ Type of change**

- [x] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [x] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [x] 🔃 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
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [ ] ⚖️ My code follows the style guidelines of this project
- [ ] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made corresponding changes to the documentation
- [ ] ⚠️ My changes generate no new warnings
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [ ] ⬆️ I increased versions for any altered app according to semantic
versioning
- [ ] I made sure the title starts with `feat(chart-name):`,
`fix(chart-name):` or `chore(chart-name):`

** App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🖼️ 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: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
Signed-off-by: Kjeld Schouten <info@kjeldschouten.nl>
Co-authored-by: Stavros Kois <s.kois@outlook.com>
Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
2025-02-01 21:49:53 +01:00

121 lines
4.1 KiB
YAML

suite: headers middleware test
templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with all set
set:
ingressMiddlewares:
traefik:
my-middleware1:
enabled: true
type: headers
data:
customRequestHeaders:
some-name: some-value
some-other-name: some-other-value
customResponseHeaders:
some-name: some-value
some-other-name: some-other-value
accessControlAllowCredentials: true
accessControlAllowHeaders:
- some-header
- some-other-header
accessControlAllowMethods:
- GET
- DELETE
accessControlAllowOriginList:
- some-origin
- some-other-origin
accessControlAllowOriginListRegex:
- some-origin-regex
- some-other-origin-regex
accessControlExposeHeaders:
- some-header
- some-other-header
accessControlMaxAge: 1000
addVaryHeader: true
allowedHosts:
- some-host
- some-other-host
hostsProxyHeaders:
- some-header
- some-other-header
sslProxyHeaders:
some-header: some-value
some-other-header: some-other-value
stsSeconds: 1000
stsIncludeSubdomains: true
stsPreload: true
forceSTSHeader: true
frameDeny: true
customFrameOptionsValue: some-value
contentTypeNosniff: true
browserXssFilter: true
customBrowserXSSValue: some-value
contentSecurityPolicy: some-value
contentSecurityPolicyReportOnly: true
publicKey: some-public-key
referrerPolicy: some-referrer-policy
permissionsPolicy: some-permissions-policy
isDevelopment: true
asserts:
- documentIndex: &middlewareDoc 0
isKind:
of: Middleware
- documentIndex: *middlewareDoc
equal:
path: spec
value:
headers:
customRequestHeaders:
some-name: some-value
some-other-name: some-other-value
customResponseHeaders:
some-name: some-value
some-other-name: some-other-value
accessControlAllowCredentials: true
accessControlAllowHeaders:
- some-header
- some-other-header
accessControlAllowMethods:
- GET
- DELETE
accessControlAllowOriginList:
- some-origin
- some-other-origin
accessControlAllowOriginListRegex:
- some-origin-regex
- some-other-origin-regex
accessControlExposeHeaders:
- some-header
- some-other-header
accessControlMaxAge: 1000
addVaryHeader: true
allowedHosts:
- some-host
- some-other-host
hostsProxyHeaders:
- some-header
- some-other-header
sslProxyHeaders:
some-header: some-value
some-other-header: some-other-value
stsSeconds: 1000
stsIncludeSubdomains: true
stsPreload: true
forceSTSHeader: true
frameDeny: true
customFrameOptionsValue: some-value
contentTypeNosniff: true
browserXssFilter: true
customBrowserXSSValue: some-value
contentSecurityPolicy: some-value
contentSecurityPolicyReportOnly: true
publicKey: some-public-key
referrerPolicy: some-referrer-policy
permissionsPolicy: some-permissions-policy
isDevelopment: true