Commit graph

18 commits

Author SHA1 Message Date
Lien Li
5b0cc8edca
migrate ginkgo to v2 (#8826)
* Migrate ginkgo to v2

* Update test/e2e/annotations/ipwhitelist.go

Co-authored-by: Jintao Zhang <tao12345666333@163.com>

* Update test/e2e/annotations/modsecurity/modsecurity.go

Co-authored-by: Jintao Zhang <tao12345666333@163.com>

* Update test/e2e/settings/access_log.go

Co-authored-by: Jintao Zhang <tao12345666333@163.com>

* remove unnecessary blank line

* re-order packages

* less change

Co-authored-by: Jintao Zhang <tao12345666333@163.com>
2022-07-31 09:16:28 -07:00
kszafran
3230638160
Update default allowed CORS headers (#8459)
X-CustomHeader looks more like an example than a header we would want to
accept in production. Added Range as a useful header that enables
operations on resources that can be fetched in chunks.
2022-05-04 05:11:51 -07:00
Damien Mathieu
dcd552ceb5
use functional options to reduce number of methods creating an EchoDeployment (#8199) 2022-02-02 05:12:22 -08:00
Christopher Larivière
100057d0c5
fix missing \- in regex expression for CORS wildcard domain (#7904) 2021-11-11 10:26:08 -08:00
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
Ricardo Katz
11d4ddca8e
Revert "feat: multiple-cors-allow-origin support (#7134)" (#7168)
This reverts commit 8a55801cc0.
2021-05-27 05:38:24 -07:00
Alex Zhang
8a55801cc0
feat: multiple-cors-allow-origin support (#7134) 2021-05-23 09:13:39 -07:00
Maxime LUCE
b7b85175f6 Add annotation to configure CORS Access-Control-Expose-Headers 2020-09-23 17:41:52 +02:00
Manuel Alejandro de Brito Fontes
f9624cbe46 Refactor e2e tests to use testify y httpexpect 2020-02-19 19:42:50 -03:00
Manuel Alejandro de Brito Fontes
cc318cdec1
Cleanup and standardization of e2e test definitions (#5090) 2020-02-16 15:27:58 -03:00
Manuel Alejandro de Brito Fontes
0197ea0dc4 Remove empty BeforeEach and AfterEach from e2e tests 2020-02-13 15:33:14 -03:00
Manuel Alejandro de Brito Fontes
5c30820d1f Remove hard-coded annotation and don't use map pointers 2019-12-13 03:05:20 -03:00
Manuel Alejandro de Brito Fontes
c85450c1e7
Remove hard-coded names from e2e test and use local docker dependencies (#4502) 2019-09-01 14:16:52 -04:00
Manuel Alejandro de Brito Fontes
5e249d3366
Refactor e2e tests to use the service ClusterIP 2019-02-24 20:04:07 -03:00
Manuel Alejandro de Brito Fontes
a51136b863 Refactor assertions 2018-11-18 10:53:05 -03:00
Manuel Alejandro de Brito Fontes
83dc4607c5
Remove e2e boilerplate 2018-10-29 22:38:15 -03:00
Fernando Diaz
44a11898d8 Refactor e2e Tests to use common helper function
Each e2e test is creating the same(or similar) Ingress Resource in
different ways. This makes common ingress resource creation be
performed by a framework  method, reducing code duplication
2018-10-09 11:12:11 -05:00
Fernando Diaz
2a990d2d2c Add e2e tests for CORS and more
Adds the missing e2e tests for Cross-Origin Resource Sharing(CORS).
This will include all the CORS annotations. Also adds more unit tests.
2018-09-01 16:14:52 -05:00