ingress-nginx-helm/docs/user-guide
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
..
nginx-configuration Support cors-allow-origin with multiple origins (#7614) 2021-11-02 12:31:42 -07:00
third-party-addons fix ingress syntax. (#7867) 2021-11-01 17:12:58 -07:00
basic-usage.md improve basic usage documentation (#7661) 2021-10-24 12:20:21 -07:00
cli-arguments.md This PR: (#7514) 2021-09-07 10:53:16 -07:00
convert_arguments_to_doc.py Update test images 2020-10-29 19:34:05 -03:00
custom-errors.md Change all master reference to main (#7369) 2021-08-06 17:07:29 -07:00
default-backend.md Change all master reference to main (#7369) 2021-08-06 17:07:29 -07:00
exposing-tcp-udp-services.md Added docs to clear up PROXY definition 2021-01-27 11:27:54 -08:00
external-articles.md Split documentation 2017-10-13 18:13:51 -03:00
fcgi-services.md fix ingress syntax. (#7867) 2021-11-01 17:12:58 -07:00
ingress-path-matching.md fix ingress syntax. (#7867) 2021-11-01 17:12:58 -07:00
miscellaneous.md fix for 6219 2020-10-15 12:18:25 +05:30
monitoring.md Change all master reference to main (#7369) 2021-08-06 17:07:29 -07:00
multiple-ingress.md Docs: remove redundant --election-id arg from Multiple Ingresses 2020-09-15 13:55:24 -04:00
tls.md Replace kube-lego docs with cert-manager (#7659) 2021-09-19 11:06:08 -07:00