ingress-nginx-helm/test/e2e/annotations
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
..
modsecurity Change enable-snippet to allow-snippet-annotation (#7670) 2021-09-20 16:52:23 -07:00
affinity.go Add e2e tests for secure cookie annotations (#7575) (#7619) 2021-09-12 13:10:07 -07:00
affinitymode.go Migrate to structured logging (klog) 2020-09-27 18:59:57 -03:00
alias.go Fix condition in server-alias annotation 2020-04-01 08:37:14 -03:00
approot.go Redirect for app-root should preserve current scheme (#5266) 2020-03-19 15:49:18 -03:00
auth.go Release v1 (#7470) 2021-08-21 13:42:00 -07:00
authtls.go Additional AuthTLS assertions and doc change to demonstrate auth-tls-secret enables the other AuthTLS annotations (#7202) 2021-09-07 10:35:16 -07:00
backendprotocol.go auto backend protocol for HTTP/HTTPS (#6985) 2021-07-29 12:49:19 -07:00
canary.go Updates E2E test images registry (#7704) 2021-09-27 09:42:18 -03:00
clientbodybuffersize.go added checks to verify backend works with the given configs (#7415) 2021-08-02 12:18:20 -07:00
connection.go Refactor e2e tests to use testify y httpexpect 2020-02-19 19:42:50 -03:00
cors.go Support cors-allow-origin with multiple origins (#7614) 2021-11-02 12:31:42 -07:00
customhttperrors.go Release v1 (#7470) 2021-08-21 13:42:00 -07:00
default_backend.go Refactor e2e tests to use testify y httpexpect 2020-02-19 19:42:50 -03:00
disableaccesslog.go Improved disableaccesslog tests (#7463) 2021-08-12 11:07:50 -07:00
fastcgi.go Refactor e2e tests to use testify y httpexpect 2020-02-19 19:42:50 -03:00
forcesslredirect.go Replace request_uri 2020-09-27 20:26:39 -03:00
fromtowwwredirect.go Replace request_uri 2020-09-27 20:26:39 -03:00
globalratelimit.go Add Global Rate Limiting support 2021-01-04 17:47:07 -05:00
grpc.go Fix forwarding of auth-response-headers to gRPC backends (#7331) 2021-08-10 11:24:39 -07:00
http2pushpreload.go Refactor e2e tests to use testify y httpexpect 2020-02-19 19:42:50 -03:00
influxdb.go Spelling 2020-12-15 16:10:48 -05:00
ipwhitelist.go Refactor e2e tests to use testify y httpexpect 2020-02-19 19:42:50 -03:00
limitconnections.go Add GinkgoRecover in goroutines 2020-08-19 23:15:02 -04:00
limitrate.go Added limit-rate annotation test 2020-02-24 13:31:02 +01:00
log.go Refactor e2e tests to use testify y httpexpect 2020-02-19 19:42:50 -03:00
mirror.go Refactor e2e tests to use testify y httpexpect 2020-02-19 19:42:50 -03:00
preservetrailingslash.go Allow preservation of trailing slashes on TLS redirects via annotation. (#7144) 2021-05-23 08:51:38 -07:00
proxy.go Spelling 2020-12-15 16:10:48 -05:00
proxyssl.go Fix proxy ssl e2e test 2020-07-06 18:41:42 -04:00
redirect.go Fixed typo "permanen" 2020-08-04 14:14:55 -04:00
rewrite.go Refactor handling of path Prefix and Exact 2020-11-10 07:21:34 -03:00
satisfy.go Release v1 (#7470) 2021-08-21 13:42:00 -07:00
serversnippet.go Change enable-snippet to allow-snippet-annotation (#7670) 2021-09-20 16:52:23 -07:00
serviceupstream.go Allow the usage of Services as Upstream on a global level (#7469) 2021-09-07 12:47:15 -07:00
snippet.go Change enable-snippet to allow-snippet-annotation (#7670) 2021-09-20 16:52:23 -07:00
sslciphers.go Add http request test to annotaion ssl cipher test (#7431) 2021-08-05 05:05:22 -07:00
upstreamhashby.go Remove unused variables and verbose e2e logs 2020-06-29 18:11:01 -04:00
upstreamvhost.go Refactor e2e tests to use testify y httpexpect 2020-02-19 19:42:50 -03:00
xforwardedprefix.go Refactor e2e tests to use testify y httpexpect 2020-02-19 19:42:50 -03:00