ingress-nginx-helm/test/e2e
Christopher Larivière 65b8eeddec
Support cors-allow-origin with multiple origins (#7614)
* Add Initial support for multiple cors origins in nginx

- bump cluster version for `make dev-env`
- add buildOriginRegex function in nginx.tmpl
- add e2e 4 e2e tests for cors.go
- refers to feature request #5496

* add tests + use search to identify '*' origin

* add tests + use search to identify '*' origin

Signed-off-by: Christopher Larivière <lariviere.c@gmail.com>

* fix "should enable cors test" looking at improper values

* Modify tests and add some logic for origin validation

- add origin validation in cors ingress annotations
- add extra tests to validate regex
- properly escape regex using "QuoteMeta"
- fix some copy/paste errors

* add TrimSpace and length validation before adding a new origin

* modify documentation for cors and remove dangling comment

* add support for optional port mapping on origin

* support single-level wildcard subdomains + tests

* Remove automatic `*` fonctionality from incorrect origins

- use []string instead of basic string to avoid reparsing in template.go
- fix typo in docs
- modify template to properly enable only if the whole block is enabled
- modify cors parsing
- test properly by validating that the value returned is the proper
  origin
- update unit tests and annotation tests

* Re-add `*` when no cors origins are supplied + fix tests

- fix e2e tests to allow for `*`
- re-add `*` to cors parsing if trimmed cors-allow-origin is empty
(supplied but empty) and if it wasn't supplied at all.

* remove unecessary logic for building cors origin + remove comments

- add some edge cases in e2e tests
- rework logic for building cors origin

there was no need for logic in template.go for buildCorsOriginRegex
if there is a `*` it ill be short-circuited by first if.

if it's a wildcard domain or any domain (without a wildcard), it MUST
match the main/cors.go regex format.

if there's a star in a wildcard domain, it must be replaced with
`[A-Za-z0-9]+`

* add missing check in e2e tests
2021-11-02 12:31:42 -07:00
..
admission Release v1 (#7470) 2021-08-21 13:42:00 -07:00
annotations Support cors-allow-origin with multiple origins (#7614) 2021-11-02 12:31:42 -07:00
dbg Refactor e2e tests to use testify y httpexpect 2020-02-19 19:42:50 -03:00
defaultbackend Release v1 (#7470) 2021-08-21 13:42:00 -07:00
framework Update base nginx image to the corrected version (#7705) 2021-09-26 16:24:23 -07:00
gracefulshutdown Fix nilpointer in admission and remove failing test (#7255) 2021-06-21 12:32:51 -07:00
ingress Release v1 (#7470) 2021-08-21 13:42:00 -07:00
leaks Release v1 (#7470) 2021-08-21 13:42:00 -07:00
loadbalance End-to-end tests for canary affinity (#7529) 2021-08-24 05:05:14 -07:00
lua Release v1 (#7470) 2021-08-21 13:42:00 -07:00
security Use net.JoinHostPort to avoid IPV6 issues 2020-09-02 22:58:51 -04:00
servicebackend Trigger syncIngress on Service addition/deletion #7346 (#7374) 2021-09-07 10:47:16 -07:00
settings add brotli-min-length configuration option (#7854) 2021-11-02 04:52:59 -07:00
ssl Replace request_uri 2020-09-27 20:26:39 -03:00
status Release v1 (#7470) 2021-08-21 13:42:00 -07:00
tcpudp Remove unused variables and verbose e2e logs 2020-06-29 18:11:01 -04:00
e2e.go put modsecurity e2e tests into their own packages (#7560) 2021-09-07 10:35:22 -07:00
e2e_test.go Remove comment from e2e_test.go (#5094) 2020-02-17 06:55:38 -03:00
kind.yaml Improve e2e speed execution time 2020-09-30 14:42:15 -03:00
run-chart-test.sh Release v1 (#7470) 2021-08-21 13:42:00 -07:00
run.sh Release v1 (#7470) 2021-08-21 13:42:00 -07:00
wait-for-nginx.sh Release v1 (#7470) 2021-08-21 13:42:00 -07:00