forked from Ivasoft/traefik
Compare commits
19 Commits
v2.6.0-rc2
...
v2.6.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a1c936ede | ||
|
|
47ad6538f1 | ||
|
|
9be44d8330 | ||
|
|
a4b354b33f | ||
|
|
a70b864c55 | ||
|
|
3bd5fc0f90 | ||
|
|
aabfb792af | ||
|
|
e5e48d1cc1 | ||
|
|
42a110dd69 | ||
|
|
64af364b02 | ||
|
|
cf14b8fa92 | ||
|
|
e7dc6ec025 | ||
|
|
f29e311b73 | ||
|
|
a914ce2bd2 | ||
|
|
b42a7c89e7 | ||
|
|
67483c1b17 | ||
|
|
4071f1e7f2 | ||
|
|
577709fff3 | ||
|
|
8cd45476ac |
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -3,11 +3,11 @@ PLEASE READ THIS MESSAGE.
|
||||
|
||||
Documentation fixes or enhancements:
|
||||
- for Traefik v1: use branch v1.7
|
||||
- for Traefik v2: use branch v2.5
|
||||
- for Traefik v2: use branch v2.6
|
||||
|
||||
Bug fixes:
|
||||
- for Traefik v1: use branch v1.7
|
||||
- for Traefik v2: use branch v2.5
|
||||
- for Traefik v2: use branch v2.6
|
||||
|
||||
Enhancements:
|
||||
- for Traefik v1: we only accept bug fixes
|
||||
|
||||
74
CHANGELOG.md
74
CHANGELOG.md
@@ -1,3 +1,77 @@
|
||||
## [v2.6.0](https://github.com/traefik/traefik/tree/v2.6.0) (2022-01-24)
|
||||
[All Commits](https://github.com/traefik/traefik/compare/v2.5.0-rc1...v2.6.0)
|
||||
|
||||
**Enhancements:**
|
||||
- **[acme]** Allow configuration of ACME certificates duration ([#8046](https://github.com/traefik/traefik/pull/8046) by [pmontepagano](https://github.com/pmontepagano))
|
||||
- **[consul,consulcatalog]** Support consul enterprise namespaces in consul catalog provider ([#8592](https://github.com/traefik/traefik/pull/8592) by [kevinpollet](https://github.com/kevinpollet))
|
||||
- **[k8s,k8s/gatewayapi]** Update gateway api provider to v1alpha2 ([#8535](https://github.com/traefik/traefik/pull/8535) by [kevinpollet](https://github.com/kevinpollet))
|
||||
- **[k8s,k8s/gatewayapi]** Support gateway api RouteNamespaces ([#8299](https://github.com/traefik/traefik/pull/8299) by [tomMoulard](https://github.com/tomMoulard))
|
||||
- **[k8s/crd]** Support Kubernetes basic-auth secrets ([#8189](https://github.com/traefik/traefik/pull/8189) by [dtomcej](https://github.com/dtomcej))
|
||||
- **[metrics]** Add configurable tags to influxdb metrics ([#8308](https://github.com/traefik/traefik/pull/8308) by [Tetha](https://github.com/Tetha))
|
||||
- **[metrics]** Add prefix to datadog metrics ([#8234](https://github.com/traefik/traefik/pull/8234) by [fredwangwang](https://github.com/fredwangwang))
|
||||
- **[middleware,tcp]** Add in flight connection middleware ([#8429](https://github.com/traefik/traefik/pull/8429) by [tomMoulard](https://github.com/tomMoulard))
|
||||
- **[middleware]** Add Organizational Unit to passtlscert middleware ([#7958](https://github.com/traefik/traefik/pull/7958) by [FernFerret](https://github.com/FernFerret))
|
||||
- **[middleware]** Allow configuration of minimum body size for compress middleware ([#8239](https://github.com/traefik/traefik/pull/8239) by [lus](https://github.com/lus))
|
||||
- **[middleware]** Ceil Retry-After value in the rate-limit middleware ([#8581](https://github.com/traefik/traefik/pull/8581) by [pyaillet](https://github.com/pyaillet))
|
||||
- **[middleware]** Refactor Exponential Backoff ([#7519](https://github.com/traefik/traefik/pull/7519) by [danieladams456](https://github.com/danieladams456))
|
||||
- **[server,k8s/crd,k8s]** Allow configuration of HTTP/2 readIdleTimeout and pingTimeout ([#8539](https://github.com/traefik/traefik/pull/8539) by [tomMoulard](https://github.com/tomMoulard))
|
||||
- **[server]** Allow configuration of advertised port for HTTP/3 ([#8131](https://github.com/traefik/traefik/pull/8131) by [valerauko](https://github.com/valerauko))
|
||||
- **[tracing]** Upgrade Instana tracer and make process profiling configurable ([#8334](https://github.com/traefik/traefik/pull/8334) by [andriikushch](https://github.com/andriikushch))
|
||||
|
||||
**Bug fixes:**
|
||||
- **[consul,kv]** Support Consul KV Enterprise namespaces ([#8692](https://github.com/traefik/traefik/pull/8692) by [kevinpollet](https://github.com/kevinpollet))
|
||||
- **[consul]** Support token authentication for Consul KV ([#8712](https://github.com/traefik/traefik/pull/8712) by [kevinpollet](https://github.com/kevinpollet))
|
||||
- **[consulcatalog]** Configure Consul Catalog namespace at client level ([#8725](https://github.com/traefik/traefik/pull/8725) by [kevinpollet](https://github.com/kevinpollet))
|
||||
- **[tracing]** Upgrade Instana tracer dependency ([#8687](https://github.com/traefik/traefik/pull/8687) by [andriikushch](https://github.com/andriikushch))
|
||||
- **[logs]** Redact credentials before logging ([#8699](https://github.com/traefik/traefik/pull/8699) by [ibrahimalihc](https://github.com/ibrahimalihc))
|
||||
|
||||
**Misc:**
|
||||
- Merge current v2.5 into v2.6 ([#8720](https://github.com/traefik/traefik/pull/8720) by [tomMoulard](https://github.com/tomMoulard))
|
||||
- Merge current v2.5 into v2.6 ([#8717](https://github.com/traefik/traefik/pull/8717) by [tomMoulard](https://github.com/tomMoulard))
|
||||
- Merge current v2.5 into v2.6 ([#8714](https://github.com/traefik/traefik/pull/8714) by [rtribotte](https://github.com/rtribotte))
|
||||
- Merge current v2.5 into v2.6 ([#8688](https://github.com/traefik/traefik/pull/8688) by [tomMoulard](https://github.com/tomMoulard))
|
||||
- Merge current v2.5 into v2.6 ([#8664](https://github.com/traefik/traefik/pull/8664) by [tomMoulard](https://github.com/tomMoulard))
|
||||
- Merge current v2.5 into v2.6 ([#8651](https://github.com/traefik/traefik/pull/8651) by [tomMoulard](https://github.com/tomMoulard))
|
||||
- Merge current v2.5 into master ([#8645](https://github.com/traefik/traefik/pull/8645) by [tomMoulard](https://github.com/tomMoulard))
|
||||
- Merge current v2.5 into master ([#8609](https://github.com/traefik/traefik/pull/8609) by [tomMoulard](https://github.com/tomMoulard))
|
||||
- Merge current v2.5 into master ([#8563](https://github.com/traefik/traefik/pull/8563) by [kevinpollet](https://github.com/kevinpollet))
|
||||
- Merge current v2.5 into master ([#8498](https://github.com/traefik/traefik/pull/8498) by [kevinpollet](https://github.com/kevinpollet))
|
||||
- Merge current v2.5 into master ([#8461](https://github.com/traefik/traefik/pull/8461) by [tomMoulard](https://github.com/tomMoulard))
|
||||
- Merge current v2.5 into master ([#8435](https://github.com/traefik/traefik/pull/8435) by [jbdoumenjou](https://github.com/jbdoumenjou))
|
||||
- Merge current v2.5 into master ([#8419](https://github.com/traefik/traefik/pull/8419) by [rtribotte](https://github.com/rtribotte))
|
||||
- Merge current v2.5 into master ([#8411](https://github.com/traefik/traefik/pull/8411) by [rtribotte](https://github.com/rtribotte))
|
||||
- Merge current v2.5 into master ([#8316](https://github.com/traefik/traefik/pull/8316) by [rtribotte](https://github.com/rtribotte))
|
||||
- Merge current v2.5 into master ([#8298](https://github.com/traefik/traefik/pull/8298) by [tomMoulard](https://github.com/tomMoulard))
|
||||
- Merge current v2.5 into master ([#8289](https://github.com/traefik/traefik/pull/8289) by [rtribotte](https://github.com/rtribotte))
|
||||
- Merge current v2.5 into master ([#8241](https://github.com/traefik/traefik/pull/8241) by [rtribotte](https://github.com/rtribotte))
|
||||
|
||||
## [v2.6.0-rc3](https://github.com/traefik/traefik/tree/v2.6.0-rc3) (2022-01-20)
|
||||
[All Commits](https://github.com/traefik/traefik/compare/v2.6.0-rc2...v2.6.0-rc3)
|
||||
|
||||
**Bug fixes:**
|
||||
- **[consul]** Support token authentication for Consul KV ([#8712](https://github.com/traefik/traefik/pull/8712) by [kevinpollet](https://github.com/kevinpollet))
|
||||
|
||||
**Misc:**
|
||||
- Merge current v2.5 into v2.6 ([#8717](https://github.com/traefik/traefik/pull/8717) by [tomMoulard](https://github.com/tomMoulard))
|
||||
- Merge current v2.5 into v2.6 ([#8714](https://github.com/traefik/traefik/pull/8714) by [rtribotte](https://github.com/rtribotte))
|
||||
|
||||
## [v2.5.7](https://github.com/traefik/traefik/tree/v2.5.7) (2022-01-20)
|
||||
[All Commits](https://github.com/traefik/traefik/compare/v2.5.6...v2.5.7)
|
||||
|
||||
**Bug fixes:**
|
||||
- **[acme]** Update go-acme/lego to v4.6.0 ([#8716](https://github.com/traefik/traefik/pull/8716) by [ldez](https://github.com/ldez))
|
||||
- **[logs]** Adjust log level from info to debug ([#8718](https://github.com/traefik/traefik/pull/8718) by [tomMoulard](https://github.com/tomMoulard))
|
||||
- **[plugins]** Fix middleware plugins memory leak ([#8702](https://github.com/traefik/traefik/pull/8702) by [ldez](https://github.com/ldez))
|
||||
- **[server]** Mitigate memory leak ([#8706](https://github.com/traefik/traefik/pull/8706) by [mpl](https://github.com/mpl))
|
||||
- **[webui,middleware]** Fix middleware regexp's display ([#8697](https://github.com/traefik/traefik/pull/8697) by [tomMoulard](https://github.com/tomMoulard))
|
||||
|
||||
**Documentation:**
|
||||
- **[http]** Fix HTTP provider endpoint config example ([#8715](https://github.com/traefik/traefik/pull/8715) by [kevinpollet](https://github.com/kevinpollet))
|
||||
- **[k8s]** Remove typo in Kubernetes providers labelSelector examples ([#8676](https://github.com/traefik/traefik/pull/8676) by [colinwilson](https://github.com/colinwilson))
|
||||
- **[rules]** Improve regexp matcher documentation ([#8686](https://github.com/traefik/traefik/pull/8686) by [Hades32](https://github.com/Hades32))
|
||||
- **[tracing]** Fix broken jaeger documentation link ([#8665](https://github.com/traefik/traefik/pull/8665) by [tomMoulard](https://github.com/tomMoulard))
|
||||
- Update copyright for 2022 ([#8679](https://github.com/traefik/traefik/pull/8679) by [kevinpollet](https://github.com/kevinpollet))
|
||||
|
||||
## [v2.6.0-rc2](https://github.com/traefik/traefik/tree/v2.6.0-rc2) (2022-01-12)
|
||||
[All Commits](https://github.com/traefik/traefik/compare/v2.6.0-rc1...v2.6.0-rc2)
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ You can install Traefik with the following flavors:
|
||||
|
||||
Choose one of the [official Docker images](https://hub.docker.com/_/traefik) and run it with one sample configuration file:
|
||||
|
||||
* [YAML](https://raw.githubusercontent.com/traefik/traefik/v2.5/traefik.sample.yml)
|
||||
* [TOML](https://raw.githubusercontent.com/traefik/traefik/v2.5/traefik.sample.toml)
|
||||
* [YAML](https://raw.githubusercontent.com/traefik/traefik/v2.6/traefik.sample.yml)
|
||||
* [TOML](https://raw.githubusercontent.com/traefik/traefik/v2.6/traefik.sample.toml)
|
||||
|
||||
```bash
|
||||
docker run -d -p 8080:8080 -p 80:80 \
|
||||
|
||||
@@ -371,7 +371,9 @@ For complete details, refer to your provider's _Additional configuration_ link.
|
||||
| [Simply.com](https://www.simply.com/en/domains/) | `simply` | `SIMPLY_ACCOUNT_NAME`, `SIMPLY_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/simply) |
|
||||
| [Sonic](https://www.sonic.com/) | `sonic` | `SONIC_USER_ID`, `SONIC_API_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/sonic) |
|
||||
| [Stackpath](https://www.stackpath.com/) | `stackpath` | `STACKPATH_CLIENT_ID`, `STACKPATH_CLIENT_SECRET`, `STACKPATH_STACK_ID` | [Additional configuration](https://go-acme.github.io/lego/dns/stackpath) |
|
||||
| [Tencent Cloud DNS](https://cloud.tencent.com/product/cns) | `tencentcloud` | `TENCENTCLOUD_SECRET_ID`, `TENCENTCLOUD_SECRET_KEY` | [Additional configuration](https://go-acme.github.io/lego/dns/tencentcloud) |
|
||||
| [TransIP](https://www.transip.nl/) | `transip` | `TRANSIP_ACCOUNT_NAME`, `TRANSIP_PRIVATE_KEY_PATH` | [Additional configuration](https://go-acme.github.io/lego/dns/transip) |
|
||||
| [UKFast SafeDNS](https://www.ukfast.co.uk/dns-hosting.html) | `safedns` | `SAFEDNS_AUTH_TOKEN` | [Additional configuration](https://go-acme.github.io/lego/dns/safedns) |
|
||||
| [VegaDNS](https://github.com/shupp/VegaDNS-API) | `vegadns` | `SECRET_VEGADNS_KEY`, `SECRET_VEGADNS_SECRET`, `VEGADNS_URL` | [Additional configuration](https://go-acme.github.io/lego/dns/vegadns) |
|
||||
| [Versio](https://www.versio.nl/domeinnamen) | `versio` | `VERSIO_USERNAME`, `VERSIO_PASSWORD` | [Additional configuration](https://go-acme.github.io/lego/dns/versio) |
|
||||
| [VinylDNS](https://www.vinyldns.io) | `vinyldns` | `VINYLDNS_ACCESS_KEY`, `VINYLDNS_SECRET_KEY`, `VINYLDNS_HOST` | [Additional configuration](https://go-acme.github.io/lego/dns/vinyldns) |
|
||||
|
||||
@@ -23,7 +23,7 @@ The total count of configuration reloads.
|
||||
config.reload.total
|
||||
```
|
||||
|
||||
```influxdb tab="InfluDB"
|
||||
```influxdb tab="InfluxDB"
|
||||
traefik.config.reload.total
|
||||
```
|
||||
|
||||
@@ -43,7 +43,7 @@ The total count of configuration reload failures.
|
||||
config.reload.total (with tag "failure" to true)
|
||||
```
|
||||
|
||||
```influxdb tab="InfluDB"
|
||||
```influxdb tab="InfluxDB"
|
||||
traefik.config.reload.total.failure
|
||||
```
|
||||
|
||||
@@ -63,7 +63,7 @@ The timestamp of the last configuration reload success.
|
||||
config.reload.lastSuccessTimestamp
|
||||
```
|
||||
|
||||
```influxdb tab="InfluDB"
|
||||
```influxdb tab="InfluxDB"
|
||||
traefik.config.reload.lastSuccessTimestamp
|
||||
```
|
||||
|
||||
@@ -83,7 +83,7 @@ The timestamp of the last configuration reload failure.
|
||||
config.reload.lastFailureTimestamp
|
||||
```
|
||||
|
||||
```influxdb tab="InfluDB"
|
||||
```influxdb tab="InfluxDB"
|
||||
traefik.config.reload.lastFailureTimestamp
|
||||
```
|
||||
|
||||
@@ -114,7 +114,7 @@ Available labels: `code`, `method`, `protocol`, `entrypoint`.
|
||||
entrypoint.request.total
|
||||
```
|
||||
|
||||
```influxdb tab="InfluDB"
|
||||
```influxdb tab="InfluxDB"
|
||||
traefik.entrypoint.requests.total
|
||||
```
|
||||
|
||||
@@ -145,7 +145,7 @@ Available labels: `code`, `method`, `protocol`, `entrypoint`.
|
||||
entrypoint.request.duration
|
||||
```
|
||||
|
||||
```influxdb tab="InfluDB"
|
||||
```influxdb tab="InfluxDB"
|
||||
traefik.entrypoint.request.duration
|
||||
```
|
||||
|
||||
@@ -167,7 +167,7 @@ Available labels: `method`, `protocol`, `entrypoint`.
|
||||
entrypoint.connections.open
|
||||
```
|
||||
|
||||
```influxdb tab="InfluDB"
|
||||
```influxdb tab="InfluxDB"
|
||||
traefik.entrypoint.connections.open
|
||||
```
|
||||
|
||||
@@ -200,7 +200,7 @@ Available labels: `code`, `method`, `protocol`, `service`.
|
||||
service.request.total
|
||||
```
|
||||
|
||||
```influxdb tab="InfluDB"
|
||||
```influxdb tab="InfluxDB"
|
||||
traefik.service.requests.total
|
||||
```
|
||||
|
||||
@@ -231,7 +231,7 @@ Available labels: `code`, `method`, `protocol`, `service`.
|
||||
service.request.duration
|
||||
```
|
||||
|
||||
```influxdb tab="InfluDB"
|
||||
```influxdb tab="InfluxDB"
|
||||
traefik.service.request.duration
|
||||
```
|
||||
|
||||
@@ -253,7 +253,7 @@ Available labels: `method`, `protocol`, `service`.
|
||||
service.connections.open
|
||||
```
|
||||
|
||||
```influxdb tab="InfluDB"
|
||||
```influxdb tab="InfluxDB"
|
||||
traefik.service.connections.open
|
||||
```
|
||||
|
||||
@@ -275,7 +275,7 @@ Available labels: `service`.
|
||||
service.retries.total
|
||||
```
|
||||
|
||||
```influxdb tab="InfluDB"
|
||||
```influxdb tab="InfluxDB"
|
||||
traefik.service.retries.total
|
||||
```
|
||||
|
||||
@@ -297,7 +297,7 @@ Available labels: `service`, `url`.
|
||||
service.server.up
|
||||
```
|
||||
|
||||
```influxdb tab="InfluDB"
|
||||
```influxdb tab="InfluxDB"
|
||||
traefik.service.server.up
|
||||
```
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ tracing:
|
||||
|
||||
_Required, Default=false_
|
||||
|
||||
Enables [automatic profiling](https://www.instana.com/docs/ecosystem/go/#instana-autoprofile) for the Traefik process.
|
||||
Enables [automatic profiling](https://www.ibm.com/docs/en/obi/current?topic=instana-profile-processes) for the Traefik process.
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
tracing:
|
||||
|
||||
@@ -125,7 +125,30 @@ providers:
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--providers.consul.password=foo
|
||||
--providers.consul.password=bar
|
||||
```
|
||||
|
||||
### `token`
|
||||
|
||||
_Optional, Default=""_
|
||||
|
||||
Defines a token with which to connect to Consul.
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
providers:
|
||||
consul:
|
||||
# ...
|
||||
token: "bar"
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[providers.consul]
|
||||
# ...
|
||||
token = "bar"
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--providers.consul.token=bar
|
||||
```
|
||||
|
||||
### `tls`
|
||||
|
||||
@@ -17,8 +17,7 @@ Defines the HTTP(S) endpoint to poll.
|
||||
```yaml tab="File (YAML)"
|
||||
providers:
|
||||
http:
|
||||
endpoint:
|
||||
- "http://127.0.0.1:9000/api"
|
||||
endpoint: "http://127.0.0.1:9000/api"
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
|
||||
@@ -493,4 +493,4 @@ providers:
|
||||
### Further
|
||||
|
||||
To learn more about the various aspects of the Ingress specification that Traefik supports,
|
||||
many examples of Ingresses definitions are located in the test [examples](https://github.com/traefik/traefik/tree/v2.5/pkg/provider/kubernetes/ingress/fixtures) of the Traefik repository.
|
||||
many examples of Ingresses definitions are located in the test [examples](https://github.com/traefik/traefik/tree/v2.6/pkg/provider/kubernetes/ingress/fixtures) of the Traefik repository.
|
||||
|
||||
@@ -375,6 +375,9 @@ TLS insecure skip verify (Default: ```false```)
|
||||
`--providers.consul.tls.key`:
|
||||
TLS key
|
||||
|
||||
`--providers.consul.token`:
|
||||
KV Token
|
||||
|
||||
`--providers.consul.username`:
|
||||
KV Username
|
||||
|
||||
@@ -561,6 +564,9 @@ TLS insecure skip verify (Default: ```false```)
|
||||
`--providers.etcd.tls.key`:
|
||||
TLS key
|
||||
|
||||
`--providers.etcd.token`:
|
||||
KV Token
|
||||
|
||||
`--providers.etcd.username`:
|
||||
KV Username
|
||||
|
||||
@@ -819,6 +825,9 @@ TLS insecure skip verify (Default: ```false```)
|
||||
`--providers.redis.tls.key`:
|
||||
TLS key
|
||||
|
||||
`--providers.redis.token`:
|
||||
KV Token
|
||||
|
||||
`--providers.redis.username`:
|
||||
KV Username
|
||||
|
||||
@@ -858,6 +867,9 @@ TLS insecure skip verify (Default: ```false```)
|
||||
`--providers.zookeeper.tls.key`:
|
||||
TLS key
|
||||
|
||||
`--providers.zookeeper.token`:
|
||||
KV Token
|
||||
|
||||
`--providers.zookeeper.username`:
|
||||
KV Username
|
||||
|
||||
|
||||
@@ -450,6 +450,9 @@ TLS insecure skip verify (Default: ```false```)
|
||||
`TRAEFIK_PROVIDERS_CONSUL_TLS_KEY`:
|
||||
TLS key
|
||||
|
||||
`TRAEFIK_PROVIDERS_CONSUL_TOKEN`:
|
||||
KV Token
|
||||
|
||||
`TRAEFIK_PROVIDERS_CONSUL_USERNAME`:
|
||||
KV Username
|
||||
|
||||
@@ -561,6 +564,9 @@ TLS insecure skip verify (Default: ```false```)
|
||||
`TRAEFIK_PROVIDERS_ETCD_TLS_KEY`:
|
||||
TLS key
|
||||
|
||||
`TRAEFIK_PROVIDERS_ETCD_TOKEN`:
|
||||
KV Token
|
||||
|
||||
`TRAEFIK_PROVIDERS_ETCD_USERNAME`:
|
||||
KV Username
|
||||
|
||||
@@ -819,6 +825,9 @@ TLS insecure skip verify (Default: ```false```)
|
||||
`TRAEFIK_PROVIDERS_REDIS_TLS_KEY`:
|
||||
TLS key
|
||||
|
||||
`TRAEFIK_PROVIDERS_REDIS_TOKEN`:
|
||||
KV Token
|
||||
|
||||
`TRAEFIK_PROVIDERS_REDIS_USERNAME`:
|
||||
KV Username
|
||||
|
||||
@@ -858,6 +867,9 @@ TLS insecure skip verify (Default: ```false```)
|
||||
`TRAEFIK_PROVIDERS_ZOOKEEPER_TLS_KEY`:
|
||||
TLS key
|
||||
|
||||
`TRAEFIK_PROVIDERS_ZOOKEEPER_TOKEN`:
|
||||
KV Token
|
||||
|
||||
`TRAEFIK_PROVIDERS_ZOOKEEPER_USERNAME`:
|
||||
KV Username
|
||||
|
||||
|
||||
@@ -180,6 +180,7 @@
|
||||
username = "foobar"
|
||||
password = "foobar"
|
||||
namespace = "foobar"
|
||||
token = "foobar"
|
||||
[providers.consul.tls]
|
||||
ca = "foobar"
|
||||
caOptional = true
|
||||
@@ -192,6 +193,7 @@
|
||||
username = "foobar"
|
||||
password = "foobar"
|
||||
namespace = "foobar"
|
||||
token = "foobar"
|
||||
[providers.etcd.tls]
|
||||
ca = "foobar"
|
||||
caOptional = true
|
||||
@@ -204,6 +206,7 @@
|
||||
username = "foobar"
|
||||
password = "foobar"
|
||||
namespace = "foobar"
|
||||
token = "foobar"
|
||||
[providers.zooKeeper.tls]
|
||||
ca = "foobar"
|
||||
caOptional = true
|
||||
@@ -216,6 +219,7 @@
|
||||
username = "foobar"
|
||||
password = "foobar"
|
||||
namespace = "foobar"
|
||||
token = "foobar"
|
||||
[providers.redis.tls]
|
||||
ca = "foobar"
|
||||
caOptional = true
|
||||
|
||||
@@ -196,6 +196,7 @@ providers:
|
||||
username: foobar
|
||||
password: foobar
|
||||
namespace: foobar
|
||||
token: foobar
|
||||
tls:
|
||||
ca: foobar
|
||||
caOptional: true
|
||||
@@ -210,6 +211,7 @@ providers:
|
||||
username: foobar
|
||||
password: foobar
|
||||
namespace: foobar
|
||||
token: foobar
|
||||
tls:
|
||||
ca: foobar
|
||||
caOptional: true
|
||||
@@ -224,6 +226,7 @@ providers:
|
||||
username: foobar
|
||||
password: foobar
|
||||
namespace: foobar
|
||||
token: foobar
|
||||
tls:
|
||||
ca: foobar
|
||||
caOptional: true
|
||||
@@ -238,6 +241,7 @@ providers:
|
||||
username: foobar
|
||||
password: foobar
|
||||
namespace: foobar
|
||||
token: foobar
|
||||
tls:
|
||||
ca: foobar
|
||||
caOptional: true
|
||||
|
||||
@@ -22,7 +22,7 @@ find "${PATH_TO_SITE}" -type f -not -path "/app/site/theme/*" \
|
||||
--alt_ignore="/traefikproxy-vertical-logo-color.svg/" \
|
||||
--http_status_ignore="0,500,501,503" \
|
||||
--file_ignore="/404.html/" \
|
||||
--url_ignore="/https://groups.google.com/a/traefik.io/forum/#!forum/security/,/localhost:/,/127.0.0.1:/,/fonts.gstatic.com/,/.minikube/,/github.com\/traefik\/traefik\/*edit*/,/github.com\/traefik\/traefik/,/doc.traefik.io/,/github\.com\/golang\/oauth2\/blob\/36a7019397c4c86cf59eeab3bc0d188bac444277\/.+/,/www.akamai.com/,/pilot.traefik.io\/profile/,/traefik.io/,/doc.traefik.io\/traefik-mesh/,/www.mkdocs.org/,/squidfunk.github.io/,/ietf.org/,/www.namesilo.com/,/www.youtube.com/,/www.linode.com/,/www.alibabacloud.com/" \
|
||||
--url_ignore="/https://groups.google.com/a/traefik.io/forum/#!forum/security/,/localhost:/,/127.0.0.1:/,/fonts.gstatic.com/,/.minikube/,/github.com\/traefik\/traefik\/*edit*/,/github.com\/traefik\/traefik/,/doc.traefik.io/,/github\.com\/golang\/oauth2\/blob\/36a7019397c4c86cf59eeab3bc0d188bac444277\/.+/,/www.akamai.com/,/pilot.traefik.io\/profile/,/traefik.io/,/doc.traefik.io\/traefik-mesh/,/www.mkdocs.org/,/squidfunk.github.io/,/ietf.org/,/www.namesilo.com/,/www.youtube.com/,/www.linode.com/,/www.alibabacloud.com/,/www.cloudxns.net/,/www.vultr.com/,/vscale.io/" \
|
||||
'{}' 1>/dev/null
|
||||
## HTML-proofer options at https://github.com/gjtorikian/html-proofer#configuration
|
||||
|
||||
|
||||
8
go.mod
8
go.mod
@@ -24,7 +24,7 @@ require (
|
||||
github.com/eapache/channels v1.1.0
|
||||
github.com/fatih/structs v1.1.0
|
||||
github.com/gambol99/go-marathon v0.0.0-20180614232016-99a156b96fb2
|
||||
github.com/go-acme/lego/v4 v4.5.3
|
||||
github.com/go-acme/lego/v4 v4.6.0
|
||||
github.com/go-check/check v0.0.0-00010101000000-000000000000
|
||||
github.com/go-kit/kit v0.10.1-0.20200915143503-439c4d2ed3ea
|
||||
github.com/golang/protobuf v1.5.2
|
||||
@@ -93,10 +93,14 @@ require (
|
||||
replace (
|
||||
github.com/abbot/go-http-auth => github.com/containous/go-http-auth v0.4.1-0.20200324110947-a37a7636d23e
|
||||
github.com/go-check/check => github.com/containous/check v0.0.0-20170915194414-ca0bf163426a
|
||||
github.com/gorilla/mux => github.com/containous/mux v0.0.0-20181024131434-c33f32e26898
|
||||
github.com/gorilla/mux => github.com/containous/mux v0.0.0-20220113180107-8ffa4f6d063c
|
||||
github.com/mailgun/minheap => github.com/containous/minheap v0.0.0-20190809180810-6e71eb837595
|
||||
github.com/mailgun/multibuf => github.com/containous/multibuf v0.0.0-20190809014333-8b6c9a7e6bba
|
||||
)
|
||||
|
||||
// https://github.com/docker/compose/blob/e44222664abd07ce1d1fe6796d84d93cbc7468c3/go.mod#L131
|
||||
replace github.com/jaguilar/vt100 => github.com/tonistiigi/vt100 v0.0.0-20190402012908-ad4c4a574305
|
||||
|
||||
// ambiguous import: found package github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http in multiple modules
|
||||
// tencentcloud uses monorepo with multimodule but the go.mod files are incomplete.
|
||||
exclude github.com/tencentcloud/tencentcloud-sdk-go v3.0.83+incompatible
|
||||
|
||||
47
go.sum
47
go.sum
@@ -427,8 +427,8 @@ github.com/containous/minheap v0.0.0-20190809180810-6e71eb837595 h1:aPspFRO6b94T
|
||||
github.com/containous/minheap v0.0.0-20190809180810-6e71eb837595/go.mod h1:+lHFbEasIiQVGzhVDVw/cn0ZaOzde2OwNncp1NhXV4c=
|
||||
github.com/containous/multibuf v0.0.0-20190809014333-8b6c9a7e6bba h1:PhR03pep+5eO/9BSvCY9RyG8rjogB3uYS4X/WBYNTT8=
|
||||
github.com/containous/multibuf v0.0.0-20190809014333-8b6c9a7e6bba/go.mod h1:zkWcASFUJEst6QwCrxLdkuw1gvaKqmflEipm+iecV5M=
|
||||
github.com/containous/mux v0.0.0-20181024131434-c33f32e26898 h1:1srn9voikJGofblBhWy3WuZWqo14Ou7NaswNG/I2yWc=
|
||||
github.com/containous/mux v0.0.0-20181024131434-c33f32e26898/go.mod h1:z8WW7n06n8/1xF9Jl9WmuDeZuHAhfL+bwarNjsciwwg=
|
||||
github.com/containous/mux v0.0.0-20220113180107-8ffa4f6d063c h1:g6JvgTtfpS6AfhRjY87NZ0g39CrNDbdm8R+1CD85Cfo=
|
||||
github.com/containous/mux v0.0.0-20220113180107-8ffa4f6d063c/go.mod h1:z8WW7n06n8/1xF9Jl9WmuDeZuHAhfL+bwarNjsciwwg=
|
||||
github.com/coredns/coredns v1.1.2/go.mod h1:zASH/MVDgR6XZTbxvOnsZfffS+31vg6Ackf/wo1+AM0=
|
||||
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
@@ -461,7 +461,6 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw=
|
||||
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
|
||||
github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4=
|
||||
github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ=
|
||||
@@ -623,8 +622,8 @@ github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2H
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
|
||||
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
|
||||
github.com/go-acme/lego/v4 v4.5.3 h1:v5RSN8l+RAeNHKTSL80eqLiec6q6UNaFpl2Df5x/5tM=
|
||||
github.com/go-acme/lego/v4 v4.5.3/go.mod h1:mL1DY809LzjvRuaxINNxsI26f5oStVhBGTpJMiinkZM=
|
||||
github.com/go-acme/lego/v4 v4.6.0 h1:w1rQtE/YHY5SupCTRpRJQbaZ6bkySJJ0z+kl8p6pVJU=
|
||||
github.com/go-acme/lego/v4 v4.6.0/go.mod h1:v19/zU0bumGNzvsbx07zQ6c9IxAvy55XIKhXCZio3NQ=
|
||||
github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
|
||||
github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs=
|
||||
github.com/go-cmd/cmd v1.0.5/go.mod h1:y8q8qlK5wQibcw63djSl/ntiHUHXHGdCkPk0j4QeW4s=
|
||||
@@ -988,8 +987,6 @@ github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ
|
||||
github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
|
||||
github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
|
||||
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
|
||||
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
|
||||
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
|
||||
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
|
||||
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
|
||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||
@@ -1390,7 +1387,6 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9
|
||||
github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
|
||||
github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ=
|
||||
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
|
||||
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
|
||||
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
|
||||
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
|
||||
github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ=
|
||||
@@ -1578,7 +1574,6 @@ github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTd
|
||||
github.com/spf13/afero v1.4.1/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
|
||||
github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
|
||||
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
|
||||
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
|
||||
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng=
|
||||
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
@@ -1590,7 +1585,6 @@ github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJ
|
||||
github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
|
||||
github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw=
|
||||
github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk=
|
||||
github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk=
|
||||
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
||||
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
|
||||
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
|
||||
@@ -1607,7 +1601,6 @@ github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5q
|
||||
github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
|
||||
github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44=
|
||||
github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns=
|
||||
github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns=
|
||||
github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8=
|
||||
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
|
||||
github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
|
||||
@@ -1638,7 +1631,10 @@ github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG
|
||||
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
|
||||
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
|
||||
github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go v3.0.83+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.287 h1:ohsyW4WffPdd2JLPio2Sd0qGr93hzkawAt9vWdCFLgY=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.287/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.287 h1:O/ycBVvdOAmwFlXm0fCtLz2WOr1EaWZQTDM/4pmVT+s=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.287/go.mod h1:CuOaLxOQr477GhMWAQPYQFUJrsZbW+ZqkAgP2uHDZXg=
|
||||
github.com/tent/http-link-go v0.0.0-20130702225549-ac974c61c2f9/go.mod h1:RHkNRtSLfOK7qBTHaeSX1D6BNpI3qw7NTxsmNr4RvN8=
|
||||
github.com/theupdateframework/notary v0.6.1 h1:7wshjstgS9x9F5LuB1L5mBI2xNMObWqjz+cjWoom6l0=
|
||||
github.com/theupdateframework/notary v0.6.1/go.mod h1:MOfgIfmox8s7/7fduvB2xyPPMJCrjRLRizA8OFwpnKY=
|
||||
@@ -1688,8 +1684,8 @@ github.com/vdemeester/shakers v0.1.0 h1:K+n9sSyUCg2ywmZkv+3c7vsYZfivcfKhMh8kRxCr
|
||||
github.com/vdemeester/shakers v0.1.0/go.mod h1:IZ1HHynUOQt32iQ3rvAeVddXLd19h/6LWiKsh9RZtAQ=
|
||||
github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU=
|
||||
github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM=
|
||||
github.com/vinyldns/go-vinyldns v0.0.0-20200917153823-148a5f6b8f14 h1:TFXGGMHmml4rs29PdPisC/aaCzOxUu1Vsh9on/IpUfE=
|
||||
github.com/vinyldns/go-vinyldns v0.0.0-20200917153823-148a5f6b8f14/go.mod h1:RWc47jtnVuQv6+lY3c768WtXCas/Xi+U5UFc5xULmYg=
|
||||
github.com/vinyldns/go-vinyldns v0.9.16 h1:GZJStDkcCk1F1AcRc64LuuMh+ENL8pHA0CVd4ulRMcQ=
|
||||
github.com/vinyldns/go-vinyldns v0.9.16/go.mod h1:5qIJOdmzAnatKjurI+Tl4uTus7GJKJxb+zitufjHs3Q=
|
||||
github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk=
|
||||
github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE=
|
||||
github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho=
|
||||
@@ -1931,7 +1927,6 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
|
||||
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
@@ -1942,7 +1937,6 @@ golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy
|
||||
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
|
||||
golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY=
|
||||
golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
@@ -2054,7 +2048,6 @@ golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@@ -2071,22 +2064,16 @@ golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@@ -2098,7 +2085,6 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2 h1:c8PlLMqBbOHoqtjteWm5/kbe6rNY2pbRfbIMVnepueo=
|
||||
golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
@@ -2180,10 +2166,7 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY
|
||||
golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
@@ -2247,8 +2230,6 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww
|
||||
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
|
||||
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
|
||||
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
@@ -2287,18 +2268,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG
|
||||
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
|
||||
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
|
||||
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
@@ -2429,7 +2404,6 @@ gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81
|
||||
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
|
||||
gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0=
|
||||
gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8=
|
||||
gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8=
|
||||
grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o=
|
||||
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
@@ -2544,6 +2518,7 @@ sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZa
|
||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
|
||||
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
|
||||
software.sslmate.com/src/go-pkcs12 v0.0.0-20210415151418-c5206de65a78/go.mod h1:B7Wf0Ya4DHF9Yw+qfZuJijQYkWicqDa+79Ytmmq3Kjg=
|
||||
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=
|
||||
sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck=
|
||||
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
|
||||
|
||||
@@ -1,177 +0,0 @@
|
||||
package anonymize
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
type Courgette struct {
|
||||
Ji string
|
||||
Ho string
|
||||
}
|
||||
|
||||
type Tomate struct {
|
||||
Ji string
|
||||
Ho string
|
||||
}
|
||||
|
||||
type Carotte struct {
|
||||
Name string
|
||||
Value int
|
||||
List []string
|
||||
EList []string `export:"true"`
|
||||
Courgette Courgette
|
||||
ECourgette Courgette `export:"true"`
|
||||
Pourgette *Courgette
|
||||
EPourgette *Courgette `export:"true"`
|
||||
Aubergine map[string]string
|
||||
EAubergine map[string]string `export:"true"`
|
||||
SAubergine map[string]Tomate
|
||||
ESAubergine map[string]Tomate `export:"true"`
|
||||
PSAubergine map[string]*Tomate
|
||||
EPAubergine map[string]*Tomate `export:"true"`
|
||||
}
|
||||
|
||||
func Test_doOnStruct(t *testing.T) {
|
||||
testCase := []struct {
|
||||
name string
|
||||
base *Carotte
|
||||
expected *Carotte
|
||||
}{
|
||||
{
|
||||
name: "primitive",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
Value: 666,
|
||||
List: []string{"test"},
|
||||
EList: []string{"test"},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "xxxx",
|
||||
List: []string{"xxxx"},
|
||||
EList: []string{"test"},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "struct",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
Courgette: Courgette{
|
||||
Ji: "huu",
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "xxxx",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "pointer",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
Pourgette: &Courgette{
|
||||
Ji: "hoo",
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "xxxx",
|
||||
Pourgette: nil,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "export struct",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
ECourgette: Courgette{
|
||||
Ji: "huu",
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "xxxx",
|
||||
ECourgette: Courgette{
|
||||
Ji: "xxxx",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "export pointer struct",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
ECourgette: Courgette{
|
||||
Ji: "huu",
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "xxxx",
|
||||
ECourgette: Courgette{
|
||||
Ji: "xxxx",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "export map string/string",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
EAubergine: map[string]string{
|
||||
"foo": "bar",
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "xxxx",
|
||||
EAubergine: map[string]string{
|
||||
"foo": "bar",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "export map string/pointer",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
EPAubergine: map[string]*Tomate{
|
||||
"foo": {
|
||||
Ji: "fdskljf",
|
||||
},
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "xxxx",
|
||||
EPAubergine: map[string]*Tomate{
|
||||
"foo": {
|
||||
Ji: "xxxx",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "export map string/struct",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
ESAubergine: map[string]Tomate{
|
||||
"foo": {
|
||||
Ji: "JiJiJi",
|
||||
},
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "xxxx",
|
||||
ESAubergine: map[string]Tomate{
|
||||
"foo": {
|
||||
Ji: "xxxx",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range testCase {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
val := reflect.ValueOf(test.base).Elem()
|
||||
err := doOnStruct(val)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.EqualValues(t, test.expected, test.base)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/mitchellh/hashstructure"
|
||||
"github.com/traefik/traefik/v2/pkg/anonymize"
|
||||
"github.com/traefik/traefik/v2/pkg/config/static"
|
||||
"github.com/traefik/traefik/v2/pkg/log"
|
||||
"github.com/traefik/traefik/v2/pkg/redactor"
|
||||
"github.com/traefik/traefik/v2/pkg/version"
|
||||
)
|
||||
|
||||
@@ -30,7 +30,7 @@ type data struct {
|
||||
|
||||
// Collect anonymous data.
|
||||
func Collect(staticConfiguration *static.Configuration) error {
|
||||
anonConfig, err := anonymize.Do(staticConfiguration, false)
|
||||
anonConfig, err := redactor.Anonymize(staticConfiguration)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ type AddPrefix struct {
|
||||
|
||||
// BasicAuth holds the HTTP basic authentication configuration.
|
||||
type BasicAuth struct {
|
||||
Users Users `json:"users,omitempty" toml:"users,omitempty" yaml:"users,omitempty"`
|
||||
Users Users `json:"users,omitempty" toml:"users,omitempty" yaml:"users,omitempty" loggable:"false"`
|
||||
UsersFile string `json:"usersFile,omitempty" toml:"usersFile,omitempty" yaml:"usersFile,omitempty"`
|
||||
Realm string `json:"realm,omitempty" toml:"realm,omitempty" yaml:"realm,omitempty"`
|
||||
RemoveHeader bool `json:"removeHeader,omitempty" toml:"removeHeader,omitempty" yaml:"removeHeader,omitempty" export:"true"`
|
||||
@@ -108,7 +108,7 @@ type Compress struct {
|
||||
|
||||
// DigestAuth holds the Digest HTTP authentication configuration.
|
||||
type DigestAuth struct {
|
||||
Users Users `json:"users,omitempty" toml:"users,omitempty" yaml:"users,omitempty"`
|
||||
Users Users `json:"users,omitempty" toml:"users,omitempty" yaml:"users,omitempty" loggable:"false"`
|
||||
UsersFile string `json:"usersFile,omitempty" toml:"usersFile,omitempty" yaml:"usersFile,omitempty"`
|
||||
RemoveHeader bool `json:"removeHeader,omitempty" toml:"removeHeader,omitempty" yaml:"removeHeader,omitempty" export:"true"`
|
||||
Realm string `json:"realm,omitempty" toml:"realm,omitempty" yaml:"realm,omitempty"`
|
||||
|
||||
@@ -2,7 +2,7 @@ package static
|
||||
|
||||
// Pilot Configuration related to Traefik Pilot.
|
||||
type Pilot struct {
|
||||
Token string `description:"Traefik Pilot token." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty"`
|
||||
Token string `description:"Traefik Pilot token." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty" loggable:"false"`
|
||||
Dashboard bool `description:"Enable Traefik Pilot in the dashboard." json:"dashboard,omitempty" toml:"dashboard,omitempty" yaml:"dashboard,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ type API struct {
|
||||
Dashboard bool `description:"Activate dashboard." json:"dashboard,omitempty" toml:"dashboard,omitempty" yaml:"dashboard,omitempty" export:"true"`
|
||||
Debug bool `description:"Enable additional endpoints for debugging and profiling." json:"debug,omitempty" toml:"debug,omitempty" yaml:"debug,omitempty" export:"true"`
|
||||
// TODO: Re-enable statistics
|
||||
// Statistics *types.Statistics `description:"Enable more detailed statistics." json:"statistics,omitempty" toml:"statistics,omitempty" yaml:"statistics,omitempty" export:"true" label:"allowEmpty" file:"allowEmpty"`
|
||||
// Statistics *types.Statistics `description:"Enable more detailed statistics." json:"statistics,omitempty" toml:"statistics,omitempty" yaml:"statistics,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"`
|
||||
}
|
||||
|
||||
// SetDefaults sets the default values.
|
||||
|
||||
@@ -11,10 +11,10 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/cenkalti/backoff/v4"
|
||||
"github.com/traefik/traefik/v2/pkg/anonymize"
|
||||
"github.com/traefik/traefik/v2/pkg/config/dynamic"
|
||||
"github.com/traefik/traefik/v2/pkg/log"
|
||||
"github.com/traefik/traefik/v2/pkg/metrics"
|
||||
"github.com/traefik/traefik/v2/pkg/redactor"
|
||||
"github.com/traefik/traefik/v2/pkg/safe"
|
||||
"github.com/traefik/traefik/v2/pkg/version"
|
||||
)
|
||||
@@ -173,7 +173,7 @@ func (c *client) createUUID() (string, error) {
|
||||
|
||||
// SendAnonDynConf sends anonymized dynamic configuration to Pilot.
|
||||
func (c *client) SendAnonDynConf(ctx context.Context, config dynamic.Configuration) error {
|
||||
anonConfig, err := anonymize.Do(&config, false)
|
||||
anonConfig, err := redactor.Anonymize(&config)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to anonymize dynamic configuration: %w", err)
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
// Handler expose ping routes.
|
||||
type Handler struct {
|
||||
EntryPoint string `description:"EntryPoint" export:"true" json:"entryPoint,omitempty" toml:"entryPoint,omitempty" yaml:"entryPoint,omitempty"`
|
||||
EntryPoint string `description:"EntryPoint" json:"entryPoint,omitempty" toml:"entryPoint,omitempty" yaml:"entryPoint,omitempty" export:"true"`
|
||||
ManualRouting bool `description:"Manual routing" json:"manualRouting,omitempty" toml:"manualRouting,omitempty" yaml:"manualRouting,omitempty" export:"true"`
|
||||
TerminatingStatusCode int `description:"Terminating status code" json:"terminatingStatusCode,omitempty" toml:"terminatingStatusCode,omitempty" yaml:"terminatingStatusCode,omitempty" export:"true"`
|
||||
terminating bool
|
||||
|
||||
@@ -15,31 +15,17 @@ import (
|
||||
// Constructor creates a plugin handler.
|
||||
type Constructor func(context.Context, http.Handler) (http.Handler, error)
|
||||
|
||||
// pluginContext The static part of a plugin configuration.
|
||||
type pluginContext struct {
|
||||
// GoPath plugin's GOPATH
|
||||
GoPath string `json:"goPath,omitempty" toml:"goPath,omitempty" yaml:"goPath,omitempty"`
|
||||
|
||||
// Import plugin's import/package
|
||||
Import string `json:"import,omitempty" toml:"import,omitempty" yaml:"import,omitempty"`
|
||||
|
||||
// BasePkg plugin's base package name (optional)
|
||||
BasePkg string `json:"basePkg,omitempty" toml:"basePkg,omitempty" yaml:"basePkg,omitempty"`
|
||||
|
||||
interpreter *interp.Interpreter
|
||||
}
|
||||
|
||||
// Builder is a plugin builder.
|
||||
type Builder struct {
|
||||
middlewareDescriptors map[string]pluginContext
|
||||
providerDescriptors map[string]pluginContext
|
||||
middlewareBuilders map[string]*middlewareBuilder
|
||||
providerBuilders map[string]providerBuilder
|
||||
}
|
||||
|
||||
// NewBuilder creates a new Builder.
|
||||
func NewBuilder(client *Client, plugins map[string]Descriptor, localPlugins map[string]LocalDescriptor) (*Builder, error) {
|
||||
pb := &Builder{
|
||||
middlewareDescriptors: map[string]pluginContext{},
|
||||
providerDescriptors: map[string]pluginContext{},
|
||||
middlewareBuilders: map[string]*middlewareBuilder{},
|
||||
providerBuilders: map[string]providerBuilder{},
|
||||
}
|
||||
|
||||
for pName, desc := range plugins {
|
||||
@@ -74,16 +60,15 @@ func NewBuilder(client *Client, plugins map[string]Descriptor, localPlugins map[
|
||||
|
||||
switch manifest.Type {
|
||||
case "middleware":
|
||||
pb.middlewareDescriptors[pName] = pluginContext{
|
||||
interpreter: i,
|
||||
GoPath: client.GoPath(),
|
||||
Import: manifest.Import,
|
||||
BasePkg: manifest.BasePkg,
|
||||
middleware, err := newMiddlewareBuilder(i, manifest.BasePkg, manifest.Import)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
pb.middlewareBuilders[pName] = middleware
|
||||
case "provider":
|
||||
pb.providerDescriptors[pName] = pluginContext{
|
||||
pb.providerBuilders[pName] = providerBuilder{
|
||||
interpreter: i,
|
||||
GoPath: client.GoPath(),
|
||||
Import: manifest.Import,
|
||||
BasePkg: manifest.BasePkg,
|
||||
}
|
||||
@@ -123,16 +108,15 @@ func NewBuilder(client *Client, plugins map[string]Descriptor, localPlugins map[
|
||||
|
||||
switch manifest.Type {
|
||||
case "middleware":
|
||||
pb.middlewareDescriptors[pName] = pluginContext{
|
||||
interpreter: i,
|
||||
GoPath: localGoPath,
|
||||
Import: manifest.Import,
|
||||
BasePkg: manifest.BasePkg,
|
||||
middleware, err := newMiddlewareBuilder(i, manifest.BasePkg, manifest.Import)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
pb.middlewareBuilders[pName] = middleware
|
||||
case "provider":
|
||||
pb.providerDescriptors[pName] = pluginContext{
|
||||
pb.providerBuilders[pName] = providerBuilder{
|
||||
interpreter: i,
|
||||
GoPath: localGoPath,
|
||||
Import: manifest.Import,
|
||||
BasePkg: manifest.BasePkg,
|
||||
}
|
||||
|
||||
@@ -9,15 +9,16 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/mitchellh/mapstructure"
|
||||
"github.com/traefik/yaegi/interp"
|
||||
)
|
||||
|
||||
// Build builds a middleware plugin.
|
||||
func (b Builder) Build(pName string, config map[string]interface{}, middlewareName string) (Constructor, error) {
|
||||
if b.middlewareDescriptors == nil {
|
||||
if b.middlewareBuilders == nil {
|
||||
return nil, fmt.Errorf("no plugin definition in the static configuration: %s", pName)
|
||||
}
|
||||
|
||||
descriptor, ok := b.middlewareDescriptors[pName]
|
||||
descriptor, ok := b.middlewareBuilders[pName]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("unknown plugin type: %s", pName)
|
||||
}
|
||||
@@ -30,59 +31,42 @@ func (b Builder) Build(pName string, config map[string]interface{}, middlewareNa
|
||||
return m.NewHandler, err
|
||||
}
|
||||
|
||||
// Middleware is a HTTP handler plugin wrapper.
|
||||
type Middleware struct {
|
||||
middlewareName string
|
||||
type middlewareBuilder struct {
|
||||
fnNew reflect.Value
|
||||
config reflect.Value
|
||||
fnCreateConfig reflect.Value
|
||||
}
|
||||
|
||||
func newMiddleware(descriptor pluginContext, config map[string]interface{}, middlewareName string) (*Middleware, error) {
|
||||
basePkg := descriptor.BasePkg
|
||||
func newMiddlewareBuilder(i *interp.Interpreter, basePkg, imp string) (*middlewareBuilder, error) {
|
||||
if basePkg == "" {
|
||||
basePkg = strings.ReplaceAll(path.Base(descriptor.Import), "-", "_")
|
||||
basePkg = strings.ReplaceAll(path.Base(imp), "-", "_")
|
||||
}
|
||||
|
||||
vConfig, err := descriptor.interpreter.Eval(basePkg + `.CreateConfig()`)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to eval CreateConfig: %w", err)
|
||||
}
|
||||
|
||||
cfg := &mapstructure.DecoderConfig{
|
||||
DecodeHook: mapstructure.StringToSliceHookFunc(","),
|
||||
WeaklyTypedInput: true,
|
||||
Result: vConfig.Interface(),
|
||||
}
|
||||
|
||||
decoder, err := mapstructure.NewDecoder(cfg)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to create configuration decoder: %w", err)
|
||||
}
|
||||
|
||||
err = decoder.Decode(config)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to decode configuration: %w", err)
|
||||
}
|
||||
|
||||
fnNew, err := descriptor.interpreter.Eval(basePkg + `.New`)
|
||||
fnNew, err := i.Eval(basePkg + `.New`)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to eval New: %w", err)
|
||||
}
|
||||
|
||||
return &Middleware{
|
||||
middlewareName: middlewareName,
|
||||
fnCreateConfig, err := i.Eval(basePkg + `.CreateConfig`)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to eval CreateConfig: %w", err)
|
||||
}
|
||||
|
||||
return &middlewareBuilder{
|
||||
fnNew: fnNew,
|
||||
config: vConfig,
|
||||
fnCreateConfig: fnCreateConfig,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// NewHandler creates a new HTTP handler.
|
||||
func (m *Middleware) NewHandler(ctx context.Context, next http.Handler) (http.Handler, error) {
|
||||
args := []reflect.Value{reflect.ValueOf(ctx), reflect.ValueOf(next), m.config, reflect.ValueOf(m.middlewareName)}
|
||||
results := m.fnNew.Call(args)
|
||||
func (p middlewareBuilder) newHandler(ctx context.Context, next http.Handler, cfg reflect.Value, middlewareName string) (http.Handler, error) {
|
||||
args := []reflect.Value{reflect.ValueOf(ctx), reflect.ValueOf(next), cfg, reflect.ValueOf(middlewareName)}
|
||||
results := p.fnNew.Call(args)
|
||||
|
||||
if len(results) > 1 && results[1].Interface() != nil {
|
||||
return nil, results[1].Interface().(error)
|
||||
err, ok := results[1].Interface().(error)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("invalid error type: %T", results[0].Interface())
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
handler, ok := results[0].Interface().(http.Handler)
|
||||
@@ -92,3 +76,55 @@ func (m *Middleware) NewHandler(ctx context.Context, next http.Handler) (http.Ha
|
||||
|
||||
return handler, nil
|
||||
}
|
||||
|
||||
func (p middlewareBuilder) createConfig(config map[string]interface{}) (reflect.Value, error) {
|
||||
results := p.fnCreateConfig.Call(nil)
|
||||
if len(results) != 1 {
|
||||
return reflect.Value{}, fmt.Errorf("invalid number of return for the CreateConfig function: %d", len(results))
|
||||
}
|
||||
|
||||
vConfig := results[0]
|
||||
|
||||
cfg := &mapstructure.DecoderConfig{
|
||||
DecodeHook: mapstructure.StringToSliceHookFunc(","),
|
||||
WeaklyTypedInput: true,
|
||||
Result: vConfig.Interface(),
|
||||
}
|
||||
|
||||
decoder, err := mapstructure.NewDecoder(cfg)
|
||||
if err != nil {
|
||||
return reflect.Value{}, fmt.Errorf("failed to create configuration decoder: %w", err)
|
||||
}
|
||||
|
||||
err = decoder.Decode(config)
|
||||
if err != nil {
|
||||
return reflect.Value{}, fmt.Errorf("failed to decode configuration: %w", err)
|
||||
}
|
||||
|
||||
return vConfig, nil
|
||||
}
|
||||
|
||||
// Middleware is an HTTP handler plugin wrapper.
|
||||
type Middleware struct {
|
||||
middlewareName string
|
||||
config reflect.Value
|
||||
builder *middlewareBuilder
|
||||
}
|
||||
|
||||
func newMiddleware(builder *middlewareBuilder, config map[string]interface{}, middlewareName string) (*Middleware, error) {
|
||||
vConfig, err := builder.createConfig(config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &Middleware{
|
||||
middlewareName: middlewareName,
|
||||
config: vConfig,
|
||||
builder: builder,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// NewHandler creates a new HTTP handler.
|
||||
func (m *Middleware) NewHandler(ctx context.Context, next http.Handler) (http.Handler, error) {
|
||||
return m.builder.newHandler(ctx, next, m.config, m.middlewareName)
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/traefik/traefik/v2/pkg/log"
|
||||
"github.com/traefik/traefik/v2/pkg/provider"
|
||||
"github.com/traefik/traefik/v2/pkg/safe"
|
||||
"github.com/traefik/yaegi/interp"
|
||||
)
|
||||
|
||||
// PP the interface of a plugin's provider.
|
||||
@@ -52,16 +53,26 @@ func ppSymbols() map[string]map[string]reflect.Value {
|
||||
|
||||
// BuildProvider builds a plugin's provider.
|
||||
func (b Builder) BuildProvider(pName string, config map[string]interface{}) (provider.Provider, error) {
|
||||
if b.providerDescriptors == nil {
|
||||
if b.providerBuilders == nil {
|
||||
return nil, fmt.Errorf("no plugin definition in the static configuration: %s", pName)
|
||||
}
|
||||
|
||||
descriptor, ok := b.providerDescriptors[pName]
|
||||
builder, ok := b.providerBuilders[pName]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("unknown plugin type: %s", pName)
|
||||
}
|
||||
|
||||
return newProvider(descriptor, config, "plugin-"+pName)
|
||||
return newProvider(builder, config, "plugin-"+pName)
|
||||
}
|
||||
|
||||
type providerBuilder struct {
|
||||
// Import plugin's import/package
|
||||
Import string `json:"import,omitempty" toml:"import,omitempty" yaml:"import,omitempty"`
|
||||
|
||||
// BasePkg plugin's base package name (optional)
|
||||
BasePkg string `json:"basePkg,omitempty" toml:"basePkg,omitempty" yaml:"basePkg,omitempty"`
|
||||
|
||||
interpreter *interp.Interpreter
|
||||
}
|
||||
|
||||
// Provider is a plugin's provider wrapper.
|
||||
@@ -70,13 +81,13 @@ type Provider struct {
|
||||
pp PP
|
||||
}
|
||||
|
||||
func newProvider(descriptor pluginContext, config map[string]interface{}, providerName string) (*Provider, error) {
|
||||
basePkg := descriptor.BasePkg
|
||||
func newProvider(builder providerBuilder, config map[string]interface{}, providerName string) (*Provider, error) {
|
||||
basePkg := builder.BasePkg
|
||||
if basePkg == "" {
|
||||
basePkg = strings.ReplaceAll(path.Base(descriptor.Import), "-", "_")
|
||||
basePkg = strings.ReplaceAll(path.Base(builder.Import), "-", "_")
|
||||
}
|
||||
|
||||
vConfig, err := descriptor.interpreter.Eval(basePkg + `.CreateConfig()`)
|
||||
vConfig, err := builder.interpreter.Eval(basePkg + `.CreateConfig()`)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to eval CreateConfig: %w", err)
|
||||
}
|
||||
@@ -97,12 +108,12 @@ func newProvider(descriptor pluginContext, config map[string]interface{}, provid
|
||||
return nil, fmt.Errorf("failed to decode configuration: %w", err)
|
||||
}
|
||||
|
||||
_, err = descriptor.interpreter.Eval(`package wrapper
|
||||
_, err = builder.interpreter.Eval(`package wrapper
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
` + basePkg + ` "` + descriptor.Import + `"
|
||||
` + basePkg + ` "` + builder.Import + `"
|
||||
"github.com/traefik/traefik/v2/pkg/plugins"
|
||||
)
|
||||
|
||||
@@ -116,7 +127,7 @@ func NewWrapper(ctx context.Context, config *` + basePkg + `.Config, name string
|
||||
return nil, fmt.Errorf("failed to eval wrapper: %w", err)
|
||||
}
|
||||
|
||||
fnNew, err := descriptor.interpreter.Eval("wrapper.NewWrapper")
|
||||
fnNew, err := builder.interpreter.Eval("wrapper.NewWrapper")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to eval New: %w", err)
|
||||
}
|
||||
|
||||
@@ -69,8 +69,8 @@ type Certificate struct {
|
||||
|
||||
// EAB contains External Account Binding configuration.
|
||||
type EAB struct {
|
||||
Kid string `description:"Key identifier from External CA." json:"kid,omitempty" toml:"kid,omitempty" yaml:"kid,omitempty"`
|
||||
HmacEncoded string `description:"Base64 encoded HMAC key from External CA." json:"hmacEncoded,omitempty" toml:"hmacEncoded,omitempty" yaml:"hmacEncoded,omitempty"`
|
||||
Kid string `description:"Key identifier from External CA." json:"kid,omitempty" toml:"kid,omitempty" yaml:"kid,omitempty" loggable:"false"`
|
||||
HmacEncoded string `description:"Base64 encoded HMAC key from External CA." json:"hmacEncoded,omitempty" toml:"hmacEncoded,omitempty" yaml:"hmacEncoded,omitempty" loggable:"false"`
|
||||
}
|
||||
|
||||
// DNSChallenge contains DNS challenge configuration.
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package aggregator
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/traefik/traefik/v2/pkg/config/dynamic"
|
||||
"github.com/traefik/traefik/v2/pkg/config/static"
|
||||
"github.com/traefik/traefik/v2/pkg/log"
|
||||
"github.com/traefik/traefik/v2/pkg/provider"
|
||||
"github.com/traefik/traefik/v2/pkg/provider/file"
|
||||
"github.com/traefik/traefik/v2/pkg/provider/traefik"
|
||||
"github.com/traefik/traefik/v2/pkg/redactor"
|
||||
"github.com/traefik/traefik/v2/pkg/safe"
|
||||
)
|
||||
|
||||
@@ -140,12 +139,13 @@ func (p ProviderAggregator) Provide(configurationChan chan<- dynamic.Message, po
|
||||
}
|
||||
|
||||
func launchProvider(configurationChan chan<- dynamic.Message, pool *safe.Pool, prd provider.Provider) {
|
||||
jsonConf, err := json.Marshal(prd)
|
||||
jsonConf, err := redactor.RemoveCredentials(prd)
|
||||
if err != nil {
|
||||
log.WithoutContext().Debugf("Cannot marshal the provider configuration %T: %v", prd, err)
|
||||
}
|
||||
|
||||
log.WithoutContext().Infof("Starting provider %T %s", prd, jsonConf)
|
||||
log.WithoutContext().Infof("Starting provider %T", prd)
|
||||
log.WithoutContext().Debugf("%T provider configuration: %s", prd, jsonConf)
|
||||
|
||||
currentProvider := prd
|
||||
err = currentProvider.Provide(configurationChan, pool)
|
||||
|
||||
@@ -67,7 +67,7 @@ type EndpointConfig struct {
|
||||
Address string `description:"The address of the Consul server" json:"address,omitempty" toml:"address,omitempty" yaml:"address,omitempty"`
|
||||
Scheme string `description:"The URI scheme for the Consul server" json:"scheme,omitempty" toml:"scheme,omitempty" yaml:"scheme,omitempty"`
|
||||
DataCenter string `description:"Data center to use. If not provided, the default agent data center is used" json:"datacenter,omitempty" toml:"datacenter,omitempty" yaml:"datacenter,omitempty"`
|
||||
Token string `description:"Token is used to provide a per-request ACL token which overrides the agent's default token" json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty"`
|
||||
Token string `description:"Token is used to provide a per-request ACL token which overrides the agent's default token" json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty" loggable:"false"`
|
||||
TLS *types.ClientTLS `description:"Enable TLS support." json:"tls,omitempty" toml:"tls,omitempty" yaml:"tls,omitempty" export:"true"`
|
||||
HTTPAuth *EndpointHTTPAuthConfig `description:"Auth info to use for http access" json:"httpAuth,omitempty" toml:"httpAuth,omitempty" yaml:"httpAuth,omitempty" export:"true"`
|
||||
EndpointWaitTime ptypes.Duration `description:"WaitTime limits how long a Watch will block. If not provided, the agent default values will be used" json:"endpointWaitTime,omitempty" toml:"endpointWaitTime,omitempty" yaml:"endpointWaitTime,omitempty" export:"true"`
|
||||
@@ -75,8 +75,8 @@ type EndpointConfig struct {
|
||||
|
||||
// EndpointHTTPAuthConfig holds configurations of the authentication.
|
||||
type EndpointHTTPAuthConfig struct {
|
||||
Username string `description:"Basic Auth username" json:"username,omitempty" toml:"username,omitempty" yaml:"username,omitempty"`
|
||||
Password string `description:"Basic Auth password" json:"password,omitempty" toml:"password,omitempty" yaml:"password,omitempty"`
|
||||
Username string `description:"Basic Auth username" json:"username,omitempty" toml:"username,omitempty" yaml:"username,omitempty" loggable:"false"`
|
||||
Password string `description:"Basic Auth password" json:"password,omitempty" toml:"password,omitempty" yaml:"password,omitempty" loggable:"false"`
|
||||
}
|
||||
|
||||
// SetDefaults sets the default values.
|
||||
@@ -105,7 +105,7 @@ func (p *Provider) Init() error {
|
||||
// Provide allows the consul catalog provider to provide configurations to traefik using the given configuration channel.
|
||||
func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe.Pool) error {
|
||||
var err error
|
||||
p.client, err = createClient(p.Endpoint)
|
||||
p.client, err = createClient(p.Namespace, p.Endpoint)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to create consul client: %w", err)
|
||||
}
|
||||
@@ -203,7 +203,7 @@ func (p *Provider) loadConfiguration(ctx context.Context, certInfo *connectCert,
|
||||
func (p *Provider) getConsulServicesData(ctx context.Context) ([]itemData, error) {
|
||||
// The query option "Filter" is not supported by /catalog/services.
|
||||
// https://www.consul.io/api/catalog.html#list-services
|
||||
opts := &api.QueryOptions{AllowStale: p.Stale, RequireConsistent: p.RequireConsistent, UseCache: p.Cache, Namespace: p.Namespace}
|
||||
opts := &api.QueryOptions{AllowStale: p.Stale, RequireConsistent: p.RequireConsistent, UseCache: p.Cache}
|
||||
opts = opts.WithContext(ctx)
|
||||
|
||||
serviceNames, _, err := p.client.Catalog().Services(opts)
|
||||
@@ -296,7 +296,7 @@ func (p *Provider) fetchService(ctx context.Context, name string, connectEnabled
|
||||
tagFilter = p.Prefix + ".enable=true"
|
||||
}
|
||||
|
||||
opts := &api.QueryOptions{AllowStale: p.Stale, RequireConsistent: p.RequireConsistent, UseCache: p.Cache, Namespace: p.Namespace}
|
||||
opts := &api.QueryOptions{AllowStale: p.Stale, RequireConsistent: p.RequireConsistent, UseCache: p.Cache}
|
||||
opts = opts.WithContext(ctx)
|
||||
|
||||
catalogFunc := p.client.Catalog().Service
|
||||
@@ -458,29 +458,30 @@ func (p *Provider) watchConnectTLS(ctx context.Context, leafWatcher *watch.Plan,
|
||||
}
|
||||
}
|
||||
|
||||
func createClient(cfg *EndpointConfig) (*api.Client, error) {
|
||||
func createClient(namespace string, endpoint *EndpointConfig) (*api.Client, error) {
|
||||
config := api.Config{
|
||||
Address: cfg.Address,
|
||||
Scheme: cfg.Scheme,
|
||||
Datacenter: cfg.DataCenter,
|
||||
WaitTime: time.Duration(cfg.EndpointWaitTime),
|
||||
Token: cfg.Token,
|
||||
Address: endpoint.Address,
|
||||
Scheme: endpoint.Scheme,
|
||||
Datacenter: endpoint.DataCenter,
|
||||
WaitTime: time.Duration(endpoint.EndpointWaitTime),
|
||||
Token: endpoint.Token,
|
||||
Namespace: namespace,
|
||||
}
|
||||
|
||||
if cfg.HTTPAuth != nil {
|
||||
if endpoint.HTTPAuth != nil {
|
||||
config.HttpAuth = &api.HttpBasicAuth{
|
||||
Username: cfg.HTTPAuth.Username,
|
||||
Password: cfg.HTTPAuth.Password,
|
||||
Username: endpoint.HTTPAuth.Username,
|
||||
Password: endpoint.HTTPAuth.Password,
|
||||
}
|
||||
}
|
||||
|
||||
if cfg.TLS != nil {
|
||||
if endpoint.TLS != nil {
|
||||
config.TLSConfig = api.TLSConfig{
|
||||
Address: cfg.Address,
|
||||
CAFile: cfg.TLS.CA,
|
||||
CertFile: cfg.TLS.Cert,
|
||||
KeyFile: cfg.TLS.Key,
|
||||
InsecureSkipVerify: cfg.TLS.InsecureSkipVerify,
|
||||
Address: endpoint.Address,
|
||||
CAFile: endpoint.TLS.CA,
|
||||
CertFile: endpoint.TLS.Cert,
|
||||
KeyFile: endpoint.TLS.Key,
|
||||
InsecureSkipVerify: endpoint.TLS.InsecureSkipVerify,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ type Provider struct {
|
||||
Clusters []string `description:"ECS Clusters name" json:"clusters,omitempty" toml:"clusters,omitempty" yaml:"clusters,omitempty" export:"true"`
|
||||
AutoDiscoverClusters bool `description:"Auto discover cluster" json:"autoDiscoverClusters,omitempty" toml:"autoDiscoverClusters,omitempty" yaml:"autoDiscoverClusters,omitempty" export:"true"`
|
||||
Region string `description:"The AWS region to use for requests" json:"region,omitempty" toml:"region,omitempty" yaml:"region,omitempty" export:"true"`
|
||||
AccessKeyID string `description:"The AWS credentials access key to use for making requests" json:"accessKeyID,omitempty" toml:"accessKeyID,omitempty" yaml:"accessKeyID,omitempty"`
|
||||
SecretAccessKey string `description:"The AWS credentials access key to use for making requests" json:"secretAccessKey,omitempty" toml:"secretAccessKey,omitempty" yaml:"secretAccessKey,omitempty"`
|
||||
AccessKeyID string `description:"The AWS credentials access key to use for making requests" json:"accessKeyID,omitempty" toml:"accessKeyID,omitempty" yaml:"accessKeyID,omitempty" loggable:"false"`
|
||||
SecretAccessKey string `description:"The AWS credentials access key to use for making requests" json:"secretAccessKey,omitempty" toml:"secretAccessKey,omitempty" yaml:"secretAccessKey,omitempty" loggable:"false"`
|
||||
defaultRuleTpl *template.Template
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ const (
|
||||
// Provider holds configurations of the provider.
|
||||
type Provider struct {
|
||||
Endpoint string `description:"Kubernetes server endpoint (required for external cluster client)." json:"endpoint,omitempty" toml:"endpoint,omitempty" yaml:"endpoint,omitempty"`
|
||||
Token string `description:"Kubernetes bearer token (not needed for in-cluster client)." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty"`
|
||||
Token string `description:"Kubernetes bearer token (not needed for in-cluster client)." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty" loggable:"false"`
|
||||
CertAuthFilePath string `description:"Kubernetes certificate authority file path (not needed for in-cluster client)." json:"certAuthFilePath,omitempty" toml:"certAuthFilePath,omitempty" yaml:"certAuthFilePath,omitempty"`
|
||||
Namespaces []string `description:"Kubernetes namespaces." json:"namespaces,omitempty" toml:"namespaces,omitempty" yaml:"namespaces,omitempty" export:"true"`
|
||||
AllowCrossNamespace bool `description:"Allow cross namespace resource reference." json:"allowCrossNamespace,omitempty" toml:"allowCrossNamespace,omitempty" yaml:"allowCrossNamespace,omitempty" export:"true"`
|
||||
|
||||
@@ -44,7 +44,7 @@ const (
|
||||
// Provider holds configurations of the provider.
|
||||
type Provider struct {
|
||||
Endpoint string `description:"Kubernetes server endpoint (required for external cluster client)." json:"endpoint,omitempty" toml:"endpoint,omitempty" yaml:"endpoint,omitempty"`
|
||||
Token string `description:"Kubernetes bearer token (not needed for in-cluster client)." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty"`
|
||||
Token string `description:"Kubernetes bearer token (not needed for in-cluster client)." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty" loggable:"false"`
|
||||
CertAuthFilePath string `description:"Kubernetes certificate authority file path (not needed for in-cluster client)." json:"certAuthFilePath,omitempty" toml:"certAuthFilePath,omitempty" yaml:"certAuthFilePath,omitempty"`
|
||||
Namespaces []string `description:"Kubernetes namespaces." json:"namespaces,omitempty" toml:"namespaces,omitempty" yaml:"namespaces,omitempty" export:"true"`
|
||||
LabelSelector string `description:"Kubernetes label selector to select specific GatewayClasses." json:"labelSelector,omitempty" toml:"labelSelector,omitempty" yaml:"labelSelector,omitempty" export:"true"`
|
||||
|
||||
@@ -37,7 +37,7 @@ const (
|
||||
// Provider holds configurations of the provider.
|
||||
type Provider struct {
|
||||
Endpoint string `description:"Kubernetes server endpoint (required for external cluster client)." json:"endpoint,omitempty" toml:"endpoint,omitempty" yaml:"endpoint,omitempty"`
|
||||
Token string `description:"Kubernetes bearer token (not needed for in-cluster client)." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty"`
|
||||
Token string `description:"Kubernetes bearer token (not needed for in-cluster client)." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty" loggable:"false"`
|
||||
CertAuthFilePath string `description:"Kubernetes certificate authority file path (not needed for in-cluster client)." json:"certAuthFilePath,omitempty" toml:"certAuthFilePath,omitempty" yaml:"certAuthFilePath,omitempty"`
|
||||
Namespaces []string `description:"Kubernetes namespaces." json:"namespaces,omitempty" toml:"namespaces,omitempty" yaml:"namespaces,omitempty" export:"true"`
|
||||
LabelSelector string `description:"Kubernetes Ingress label selector to use." json:"labelSelector,omitempty" toml:"labelSelector,omitempty" yaml:"labelSelector,omitempty" export:"true"`
|
||||
|
||||
@@ -24,13 +24,14 @@ import (
|
||||
|
||||
// Provider holds configurations of the provider.
|
||||
type Provider struct {
|
||||
RootKey string `description:"Root key used for KV store" export:"true" json:"rootKey,omitempty" toml:"rootKey,omitempty" yaml:"rootKey,omitempty"`
|
||||
RootKey string `description:"Root key used for KV store" json:"rootKey,omitempty" toml:"rootKey,omitempty" yaml:"rootKey,omitempty"`
|
||||
|
||||
Endpoints []string `description:"KV store endpoints" json:"endpoints,omitempty" toml:"endpoints,omitempty" yaml:"endpoints,omitempty"`
|
||||
Username string `description:"KV Username" json:"username,omitempty" toml:"username,omitempty" yaml:"username,omitempty"`
|
||||
Password string `description:"KV Password" json:"password,omitempty" toml:"password,omitempty" yaml:"password,omitempty"`
|
||||
Username string `description:"KV Username" json:"username,omitempty" toml:"username,omitempty" yaml:"username,omitempty" loggable:"false"`
|
||||
Password string `description:"KV Password" json:"password,omitempty" toml:"password,omitempty" yaml:"password,omitempty" loggable:"false"`
|
||||
Token string `description:"KV Token" json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty" loggable:"false"`
|
||||
Namespace string `description:"KV Namespace" json:"namespace,omitempty" toml:"namespace,omitempty" yaml:"namespace,omitempty"`
|
||||
TLS *types.ClientTLS `description:"Enable TLS support" export:"true" json:"tls,omitempty" toml:"tls,omitempty" yaml:"tls,omitempty"`
|
||||
TLS *types.ClientTLS `description:"Enable TLS support" json:"tls,omitempty" toml:"tls,omitempty" yaml:"tls,omitempty" export:"true" `
|
||||
|
||||
storeType store.Backend
|
||||
kvClient store.Store
|
||||
@@ -165,6 +166,7 @@ func (p *Provider) createKVClient(ctx context.Context) (store.Store, error) {
|
||||
Bucket: "traefik",
|
||||
Username: p.Username,
|
||||
Password: p.Password,
|
||||
Token: p.Token,
|
||||
Namespace: p.Namespace,
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ type Provider struct {
|
||||
Endpoint string `description:"Marathon server endpoint. You can also specify multiple endpoint for Marathon." json:"endpoint,omitempty" toml:"endpoint,omitempty" yaml:"endpoint,omitempty"`
|
||||
DefaultRule string `description:"Default rule." json:"defaultRule,omitempty" toml:"defaultRule,omitempty" yaml:"defaultRule,omitempty"`
|
||||
ExposedByDefault bool `description:"Expose Marathon apps by default." json:"exposedByDefault,omitempty" toml:"exposedByDefault,omitempty" yaml:"exposedByDefault,omitempty" export:"true"`
|
||||
DCOSToken string `description:"DCOSToken for DCOS environment, This will override the Authorization header." json:"dcosToken,omitempty" toml:"dcosToken,omitempty" yaml:"dcosToken,omitempty"`
|
||||
DCOSToken string `description:"DCOSToken for DCOS environment, This will override the Authorization header." json:"dcosToken,omitempty" toml:"dcosToken,omitempty" yaml:"dcosToken,omitempty" loggable:"false"`
|
||||
TLS *types.ClientTLS `description:"Enable TLS support." json:"tls,omitempty" toml:"tls,omitempty" yaml:"tls,omitempty" export:"true"`
|
||||
DialerTimeout ptypes.Duration `description:"Set a dialer timeout for Marathon." json:"dialerTimeout,omitempty" toml:"dialerTimeout,omitempty" yaml:"dialerTimeout,omitempty" export:"true"`
|
||||
ResponseHeaderTimeout ptypes.Duration `description:"Set a response header timeout for Marathon." json:"responseHeaderTimeout,omitempty" toml:"responseHeaderTimeout,omitempty" yaml:"responseHeaderTimeout,omitempty" export:"true"`
|
||||
@@ -80,8 +80,8 @@ func (p *Provider) SetDefaults() {
|
||||
|
||||
// Basic holds basic authentication specific configurations.
|
||||
type Basic struct {
|
||||
HTTPBasicAuthUser string `description:"Basic authentication User." json:"httpBasicAuthUser,omitempty" toml:"httpBasicAuthUser,omitempty" yaml:"httpBasicAuthUser,omitempty"`
|
||||
HTTPBasicPassword string `description:"Basic authentication Password." json:"httpBasicPassword,omitempty" toml:"httpBasicPassword,omitempty" yaml:"httpBasicPassword,omitempty"`
|
||||
HTTPBasicAuthUser string `description:"Basic authentication User." json:"httpBasicAuthUser,omitempty" toml:"httpBasicAuthUser,omitempty" yaml:"httpBasicAuthUser,omitempty" loggable:"false"`
|
||||
HTTPBasicPassword string `description:"Basic authentication Password." json:"httpBasicPassword,omitempty" toml:"httpBasicPassword,omitempty" yaml:"httpBasicPassword,omitempty" loggable:"false"`
|
||||
}
|
||||
|
||||
// Init the provider.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package anonymize
|
||||
package redactor
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
@@ -13,12 +13,39 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
maskShort = "xxxx"
|
||||
maskLarge = maskShort + maskShort + maskShort + maskShort + maskShort + maskShort + maskShort + maskShort
|
||||
maskShort = "xxxx"
|
||||
maskLarge = maskShort + maskShort + maskShort + maskShort + maskShort + maskShort + maskShort + maskShort
|
||||
tagLoggable = "loggable"
|
||||
tagExport = "export"
|
||||
)
|
||||
|
||||
// Do sends configuration.
|
||||
func Do(baseConfig interface{}, indent bool) (string, error) {
|
||||
// Anonymize redacts the configuration fields that do not have an export=true struct tag.
|
||||
// It returns the resulting marshaled configuration.
|
||||
func Anonymize(baseConfig interface{}) (string, error) {
|
||||
return anonymize(baseConfig, false)
|
||||
}
|
||||
|
||||
func anonymize(baseConfig interface{}, indent bool) (string, error) {
|
||||
conf, err := do(baseConfig, tagExport, true, indent)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return doOnJSON(conf), nil
|
||||
}
|
||||
|
||||
// RemoveCredentials redacts the configuration fields that have a loggable=false struct tag.
|
||||
// It returns the resulting marshaled configuration.
|
||||
func RemoveCredentials(baseConfig interface{}) (string, error) {
|
||||
return removeCredentials(baseConfig, false)
|
||||
}
|
||||
|
||||
func removeCredentials(baseConfig interface{}, indent bool) (string, error) {
|
||||
return do(baseConfig, tagLoggable, false, indent)
|
||||
}
|
||||
|
||||
// do marshals the given configuration, while redacting some of the fields
|
||||
// respectively to the given tag.
|
||||
func do(baseConfig interface{}, tag string, redactByDefault, indent bool) (string, error) {
|
||||
anomConfig, err := copystructure.Copy(baseConfig)
|
||||
if err != nil {
|
||||
return "", err
|
||||
@@ -26,7 +53,7 @@ func Do(baseConfig interface{}, indent bool) (string, error) {
|
||||
|
||||
val := reflect.ValueOf(anomConfig)
|
||||
|
||||
err = doOnStruct(val)
|
||||
err = doOnStruct(val, tag, redactByDefault)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -36,7 +63,7 @@ func Do(baseConfig interface{}, indent bool) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return doOnJSON(string(configJSON)), nil
|
||||
return string(configJSON), nil
|
||||
}
|
||||
|
||||
func doOnJSON(input string) string {
|
||||
@@ -44,7 +71,7 @@ func doOnJSON(input string) string {
|
||||
return xurls.Relaxed().ReplaceAllString(mailExp.ReplaceAllString(input, maskLarge+"\""), maskLarge)
|
||||
}
|
||||
|
||||
func doOnStruct(field reflect.Value) error {
|
||||
func doOnStruct(field reflect.Value, tag string, redactByDefault bool) error {
|
||||
if field.Type().AssignableTo(reflect.TypeOf(dynamic.PluginConf{})) {
|
||||
resetPlugin(field)
|
||||
return nil
|
||||
@@ -53,7 +80,7 @@ func doOnStruct(field reflect.Value) error {
|
||||
switch field.Kind() {
|
||||
case reflect.Ptr:
|
||||
if !field.IsNil() {
|
||||
if err := doOnStruct(field.Elem()); err != nil {
|
||||
if err := doOnStruct(field.Elem(), tag, redactByDefault); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -65,25 +92,28 @@ func doOnStruct(field reflect.Value) error {
|
||||
continue
|
||||
}
|
||||
|
||||
if stField.Tag.Get("export") == "true" {
|
||||
// A struct field cannot be set it must be filled as pointer.
|
||||
if fld.Kind() == reflect.Struct {
|
||||
fldPtr := reflect.New(fld.Type())
|
||||
fldPtr.Elem().Set(fld)
|
||||
|
||||
if err := doOnStruct(fldPtr); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fld.Set(fldPtr.Elem())
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
if err := doOnStruct(fld); err != nil {
|
||||
if stField.Tag.Get(tag) == "false" || stField.Tag.Get(tag) != "true" && redactByDefault {
|
||||
if err := reset(fld, stField.Name); err != nil {
|
||||
return err
|
||||
}
|
||||
} else if err := reset(fld, stField.Name); err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
// A struct field cannot be set it must be filled as pointer.
|
||||
if fld.Kind() == reflect.Struct {
|
||||
fldPtr := reflect.New(fld.Type())
|
||||
fldPtr.Elem().Set(fld)
|
||||
|
||||
if err := doOnStruct(fldPtr, tag, redactByDefault); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fld.Set(fldPtr.Elem())
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
if err := doOnStruct(fld, tag, redactByDefault); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -96,7 +126,7 @@ func doOnStruct(field reflect.Value) error {
|
||||
valPtr := reflect.New(val.Type())
|
||||
valPtr.Elem().Set(val)
|
||||
|
||||
if err := doOnStruct(valPtr); err != nil {
|
||||
if err := doOnStruct(valPtr, tag, redactByDefault); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -105,13 +135,13 @@ func doOnStruct(field reflect.Value) error {
|
||||
continue
|
||||
}
|
||||
|
||||
if err := doOnStruct(val); err != nil {
|
||||
if err := doOnStruct(val, tag, redactByDefault); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
case reflect.Slice:
|
||||
for j := 0; j < field.Len(); j++ {
|
||||
if err := doOnStruct(field.Index(j)); err != nil {
|
||||
if err := doOnStruct(field.Index(j), tag, redactByDefault); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package anonymize
|
||||
package redactor
|
||||
|
||||
import (
|
||||
"flag"
|
||||
@@ -43,7 +43,9 @@ import (
|
||||
|
||||
var updateExpected = flag.Bool("update_expected", false, "Update expected files in fixtures")
|
||||
|
||||
func TestDo_dynamicConfiguration(t *testing.T) {
|
||||
var fullDynConf *dynamic.Configuration
|
||||
|
||||
func init() {
|
||||
config := &dynamic.Configuration{}
|
||||
config.HTTP = &dynamic.HTTPConfiguration{
|
||||
Routers: map[string]*dynamic.Router{
|
||||
@@ -242,7 +244,7 @@ func TestDo_dynamicConfiguration(t *testing.T) {
|
||||
SourceCriterion: &dynamic.SourceCriterion{
|
||||
IPStrategy: &dynamic.IPStrategy{
|
||||
Depth: 42,
|
||||
ExcludedIPs: []string{"foo"},
|
||||
ExcludedIPs: []string{"127.0.0.1"},
|
||||
},
|
||||
RequestHeaderName: "foo",
|
||||
RequestHost: true,
|
||||
@@ -291,7 +293,7 @@ func TestDo_dynamicConfiguration(t *testing.T) {
|
||||
SourceCriterion: &dynamic.SourceCriterion{
|
||||
IPStrategy: &dynamic.IPStrategy{
|
||||
Depth: 42,
|
||||
ExcludedIPs: []string{"foo"},
|
||||
ExcludedIPs: []string{"127.0.0.1"},
|
||||
},
|
||||
RequestHeaderName: "foo",
|
||||
RequestHost: true,
|
||||
@@ -463,10 +465,16 @@ func TestDo_dynamicConfiguration(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
fullDynConf = config
|
||||
}
|
||||
|
||||
func TestAnonymize_dynamicConfiguration(t *testing.T) {
|
||||
config := fullDynConf
|
||||
|
||||
expectedConfiguration, err := os.ReadFile("./testdata/anonymized-dynamic-config.json")
|
||||
require.NoError(t, err)
|
||||
|
||||
cleanJSON, err := Do(config, true)
|
||||
cleanJSON, err := anonymize(config, true)
|
||||
require.NoError(t, err)
|
||||
|
||||
if *updateExpected {
|
||||
@@ -477,6 +485,23 @@ func TestDo_dynamicConfiguration(t *testing.T) {
|
||||
assert.Equal(t, expected, cleanJSON)
|
||||
}
|
||||
|
||||
func TestSecure_dynamicConfiguration(t *testing.T) {
|
||||
config := fullDynConf
|
||||
|
||||
expectedConfiguration, err := os.ReadFile("./testdata/secured-dynamic-config.json")
|
||||
require.NoError(t, err)
|
||||
|
||||
cleanJSON, err := removeCredentials(config, true)
|
||||
require.NoError(t, err)
|
||||
|
||||
if *updateExpected {
|
||||
require.NoError(t, os.WriteFile("testdata/secured-dynamic-config.json", []byte(cleanJSON), 0o666))
|
||||
}
|
||||
|
||||
expected := strings.TrimSuffix(string(expectedConfiguration), "\n")
|
||||
assert.Equal(t, expected, cleanJSON)
|
||||
}
|
||||
|
||||
func TestDo_staticConfiguration(t *testing.T) {
|
||||
config := &static.Configuration{}
|
||||
|
||||
@@ -962,7 +987,7 @@ func TestDo_staticConfiguration(t *testing.T) {
|
||||
expectedConfiguration, err := os.ReadFile("./testdata/anonymized-static-config.json")
|
||||
require.NoError(t, err)
|
||||
|
||||
cleanJSON, err := Do(config, true)
|
||||
cleanJSON, err := anonymize(config, true)
|
||||
require.NoError(t, err)
|
||||
|
||||
if *updateExpected {
|
||||
@@ -1,4 +1,4 @@
|
||||
package anonymize
|
||||
package redactor
|
||||
|
||||
import (
|
||||
"os"
|
||||
@@ -57,7 +57,9 @@ func Test_doOnJSON_simple(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, test := range testCases {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
output := doOnJSON(test.input)
|
||||
assert.Equal(t, test.expectedOutput, output)
|
||||
})
|
||||
382
pkg/redactor/redactor_doOnStruct_test.go
Normal file
382
pkg/redactor/redactor_doOnStruct_test.go
Normal file
@@ -0,0 +1,382 @@
|
||||
package redactor
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
type Courgette struct {
|
||||
Ji string
|
||||
Ho string
|
||||
}
|
||||
|
||||
type Tomate struct {
|
||||
Ji string
|
||||
Ho string
|
||||
}
|
||||
|
||||
type Carotte struct {
|
||||
Name string
|
||||
EName string `export:"true"`
|
||||
EFName string `export:"false"`
|
||||
Value int
|
||||
EValue int `export:"true"`
|
||||
EFValue int `export:"false"`
|
||||
List []string
|
||||
EList []string `export:"true"`
|
||||
EFList []string `export:"false"`
|
||||
Courgette Courgette
|
||||
ECourgette Courgette `export:"true"`
|
||||
EFCourgette Courgette `export:"false"`
|
||||
Pourgette *Courgette
|
||||
EPourgette *Courgette `export:"true"`
|
||||
EFPourgette *Courgette `export:"false"`
|
||||
Aubergine map[string]string
|
||||
EAubergine map[string]string `export:"true"`
|
||||
EFAubergine map[string]string `export:"false"`
|
||||
SAubergine map[string]Tomate
|
||||
ESAubergine map[string]Tomate `export:"true"`
|
||||
EFSAubergine map[string]Tomate `export:"false"`
|
||||
PSAubergine map[string]*Tomate
|
||||
EPAubergine map[string]*Tomate `export:"true"`
|
||||
EFPAubergine map[string]*Tomate `export:"false"`
|
||||
}
|
||||
|
||||
func Test_doOnStruct(t *testing.T) {
|
||||
testCase := []struct {
|
||||
name string
|
||||
base *Carotte
|
||||
expected *Carotte
|
||||
redactByDefault bool
|
||||
}{
|
||||
{
|
||||
name: "primitive",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
EName: "kiki",
|
||||
Value: 666,
|
||||
EValue: 666,
|
||||
List: []string{"test"},
|
||||
EList: []string{"test"},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "xxxx",
|
||||
EName: "kiki",
|
||||
EValue: 666,
|
||||
List: []string{"xxxx"},
|
||||
EList: []string{"test"},
|
||||
},
|
||||
redactByDefault: true,
|
||||
},
|
||||
{
|
||||
name: "primitive2",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
EFName: "keke",
|
||||
Value: 666,
|
||||
EFValue: 777,
|
||||
List: []string{"test"},
|
||||
EFList: []string{"test"},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "koko",
|
||||
EFName: "xxxx",
|
||||
Value: 666,
|
||||
List: []string{"test"},
|
||||
EFList: []string{"xxxx"},
|
||||
},
|
||||
redactByDefault: false,
|
||||
},
|
||||
{
|
||||
name: "struct",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
Courgette: Courgette{
|
||||
Ji: "huu",
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "xxxx",
|
||||
},
|
||||
redactByDefault: true,
|
||||
},
|
||||
{
|
||||
name: "struct2",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
EFName: "keke",
|
||||
Courgette: Courgette{
|
||||
Ji: "huu",
|
||||
},
|
||||
EFCourgette: Courgette{
|
||||
Ji: "huu",
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "koko",
|
||||
EFName: "xxxx",
|
||||
Courgette: Courgette{
|
||||
Ji: "huu",
|
||||
Ho: "",
|
||||
},
|
||||
},
|
||||
redactByDefault: false,
|
||||
},
|
||||
{
|
||||
name: "pointer",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
Pourgette: &Courgette{
|
||||
Ji: "hoo",
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "xxxx",
|
||||
Pourgette: nil,
|
||||
},
|
||||
redactByDefault: true,
|
||||
},
|
||||
{
|
||||
name: "pointer2",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
EFName: "keke",
|
||||
Pourgette: &Courgette{
|
||||
Ji: "hoo",
|
||||
},
|
||||
EFPourgette: &Courgette{
|
||||
Ji: "hoo",
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "koko",
|
||||
EFName: "xxxx",
|
||||
Pourgette: &Courgette{
|
||||
Ji: "hoo",
|
||||
},
|
||||
EFPourgette: nil,
|
||||
},
|
||||
redactByDefault: false,
|
||||
},
|
||||
{
|
||||
name: "export struct",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
ECourgette: Courgette{
|
||||
Ji: "huu",
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "xxxx",
|
||||
ECourgette: Courgette{
|
||||
Ji: "xxxx",
|
||||
},
|
||||
},
|
||||
redactByDefault: true,
|
||||
},
|
||||
{
|
||||
name: "export struct 2",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
EFName: "keke",
|
||||
ECourgette: Courgette{
|
||||
Ji: "huu",
|
||||
},
|
||||
EFCourgette: Courgette{
|
||||
Ji: "huu",
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "koko",
|
||||
EFName: "xxxx",
|
||||
ECourgette: Courgette{
|
||||
Ji: "huu",
|
||||
},
|
||||
},
|
||||
redactByDefault: false,
|
||||
},
|
||||
{
|
||||
name: "export pointer struct",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
EPourgette: &Courgette{
|
||||
Ji: "huu",
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "xxxx",
|
||||
EPourgette: &Courgette{
|
||||
Ji: "xxxx",
|
||||
},
|
||||
},
|
||||
redactByDefault: true,
|
||||
},
|
||||
{
|
||||
name: "export pointer struct 2",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
EFName: "keke",
|
||||
EPourgette: &Courgette{
|
||||
Ji: "huu",
|
||||
},
|
||||
EFPourgette: &Courgette{
|
||||
Ji: "huu",
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "koko",
|
||||
EFName: "xxxx",
|
||||
EPourgette: &Courgette{
|
||||
Ji: "huu",
|
||||
},
|
||||
EFPourgette: nil,
|
||||
},
|
||||
redactByDefault: false,
|
||||
},
|
||||
{
|
||||
name: "export map string/string",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
EAubergine: map[string]string{
|
||||
"foo": "bar",
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "xxxx",
|
||||
EAubergine: map[string]string{
|
||||
"foo": "bar",
|
||||
},
|
||||
},
|
||||
redactByDefault: true,
|
||||
},
|
||||
{
|
||||
name: "export map string/string 2",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
EFName: "keke",
|
||||
EAubergine: map[string]string{
|
||||
"foo": "bar",
|
||||
},
|
||||
EFAubergine: map[string]string{
|
||||
"foo": "bar",
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "koko",
|
||||
EFName: "xxxx",
|
||||
EAubergine: map[string]string{
|
||||
"foo": "bar",
|
||||
},
|
||||
EFAubergine: map[string]string{},
|
||||
},
|
||||
redactByDefault: false,
|
||||
},
|
||||
{
|
||||
name: "export map string/pointer",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
EPAubergine: map[string]*Tomate{
|
||||
"foo": {
|
||||
Ji: "fdskljf",
|
||||
},
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "xxxx",
|
||||
EPAubergine: map[string]*Tomate{
|
||||
"foo": {
|
||||
Ji: "xxxx",
|
||||
},
|
||||
},
|
||||
},
|
||||
redactByDefault: true,
|
||||
},
|
||||
{
|
||||
name: "export map string/pointer 2",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
EPAubergine: map[string]*Tomate{
|
||||
"foo": {
|
||||
Ji: "fdskljf",
|
||||
},
|
||||
},
|
||||
EFPAubergine: map[string]*Tomate{
|
||||
"foo": {
|
||||
Ji: "fdskljf",
|
||||
},
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "koko",
|
||||
EPAubergine: map[string]*Tomate{
|
||||
"foo": {
|
||||
Ji: "fdskljf",
|
||||
},
|
||||
},
|
||||
EFPAubergine: map[string]*Tomate{},
|
||||
},
|
||||
redactByDefault: false,
|
||||
},
|
||||
{
|
||||
name: "export map string/struct",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
ESAubergine: map[string]Tomate{
|
||||
"foo": {
|
||||
Ji: "JiJiJi",
|
||||
},
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "xxxx",
|
||||
ESAubergine: map[string]Tomate{
|
||||
"foo": {
|
||||
Ji: "xxxx",
|
||||
},
|
||||
},
|
||||
},
|
||||
redactByDefault: true,
|
||||
},
|
||||
{
|
||||
name: "export map string/struct 2",
|
||||
base: &Carotte{
|
||||
Name: "koko",
|
||||
ESAubergine: map[string]Tomate{
|
||||
"foo": {
|
||||
Ji: "JiJiJi",
|
||||
},
|
||||
},
|
||||
EFSAubergine: map[string]Tomate{
|
||||
"foo": {
|
||||
Ji: "JiJiJi",
|
||||
},
|
||||
},
|
||||
},
|
||||
expected: &Carotte{
|
||||
Name: "koko",
|
||||
ESAubergine: map[string]Tomate{
|
||||
"foo": {
|
||||
Ji: "JiJiJi",
|
||||
},
|
||||
},
|
||||
EFSAubergine: map[string]Tomate{},
|
||||
},
|
||||
redactByDefault: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range testCase {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
val := reflect.ValueOf(test.base).Elem()
|
||||
err := doOnStruct(val, tagExport, test.redactByDefault)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.EqualValues(t, test.expected, test.base)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -223,7 +223,7 @@
|
||||
"secretAccessKey": "xxxx"
|
||||
},
|
||||
"consul": {
|
||||
"rootKey": "RootKey",
|
||||
"rootKey": "xxxx",
|
||||
"username": "xxxx",
|
||||
"password": "xxxx",
|
||||
"tls": {
|
||||
@@ -235,7 +235,7 @@
|
||||
}
|
||||
},
|
||||
"etcd": {
|
||||
"rootKey": "RootKey",
|
||||
"rootKey": "xxxx",
|
||||
"username": "xxxx",
|
||||
"password": "xxxx",
|
||||
"tls": {
|
||||
@@ -247,7 +247,7 @@
|
||||
}
|
||||
},
|
||||
"zooKeeper": {
|
||||
"rootKey": "RootKey",
|
||||
"rootKey": "xxxx",
|
||||
"username": "xxxx",
|
||||
"password": "xxxx",
|
||||
"tls": {
|
||||
@@ -259,7 +259,7 @@
|
||||
}
|
||||
},
|
||||
"redis": {
|
||||
"rootKey": "RootKey",
|
||||
"rootKey": "xxxx",
|
||||
"username": "xxxx",
|
||||
"password": "xxxx",
|
||||
"tls": {
|
||||
487
pkg/redactor/testdata/secured-dynamic-config.json
vendored
Normal file
487
pkg/redactor/testdata/secured-dynamic-config.json
vendored
Normal file
@@ -0,0 +1,487 @@
|
||||
{
|
||||
"http": {
|
||||
"routers": {
|
||||
"foo": {
|
||||
"entryPoints": [
|
||||
"foo"
|
||||
],
|
||||
"middlewares": [
|
||||
"foo"
|
||||
],
|
||||
"service": "foo",
|
||||
"rule": "foo",
|
||||
"priority": 42,
|
||||
"tls": {
|
||||
"options": "foo",
|
||||
"certResolver": "foo",
|
||||
"domains": [
|
||||
{
|
||||
"main": "foo",
|
||||
"sans": [
|
||||
"foo"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"bar": {
|
||||
"weighted": {
|
||||
"services": [
|
||||
{
|
||||
"name": "foo",
|
||||
"weight": 42
|
||||
}
|
||||
],
|
||||
"sticky": {
|
||||
"cookie": {
|
||||
"name": "foo",
|
||||
"secure": true,
|
||||
"httpOnly": true,
|
||||
"sameSite": "foo"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"baz": {
|
||||
"mirroring": {
|
||||
"service": "foo",
|
||||
"maxBodySize": 42,
|
||||
"mirrors": [
|
||||
{
|
||||
"name": "foo",
|
||||
"percent": 42
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"foo": {
|
||||
"loadBalancer": {
|
||||
"sticky": {
|
||||
"cookie": {
|
||||
"name": "foo",
|
||||
"secure": true,
|
||||
"httpOnly": true,
|
||||
"sameSite": "foo"
|
||||
}
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"url": "http://127.0.0.1:8080"
|
||||
}
|
||||
],
|
||||
"healthCheck": {
|
||||
"scheme": "foo",
|
||||
"path": "foo",
|
||||
"port": 42,
|
||||
"interval": "foo",
|
||||
"timeout": "foo",
|
||||
"hostname": "foo",
|
||||
"followRedirects": true,
|
||||
"headers": {
|
||||
"foo": "bar"
|
||||
}
|
||||
},
|
||||
"passHostHeader": true,
|
||||
"responseForwarding": {
|
||||
"flushInterval": "foo"
|
||||
},
|
||||
"serversTransport": "foo"
|
||||
}
|
||||
}
|
||||
},
|
||||
"middlewares": {
|
||||
"foo": {
|
||||
"addPrefix": {
|
||||
"prefix": "foo"
|
||||
},
|
||||
"stripPrefix": {
|
||||
"prefixes": [
|
||||
"foo"
|
||||
],
|
||||
"forceSlash": true
|
||||
},
|
||||
"stripPrefixRegex": {
|
||||
"regex": [
|
||||
"foo"
|
||||
]
|
||||
},
|
||||
"replacePath": {
|
||||
"path": "foo"
|
||||
},
|
||||
"replacePathRegex": {
|
||||
"regex": "foo",
|
||||
"replacement": "foo"
|
||||
},
|
||||
"chain": {
|
||||
"middlewares": [
|
||||
"foo"
|
||||
]
|
||||
},
|
||||
"ipWhiteList": {
|
||||
"sourceRange": [
|
||||
"foo"
|
||||
],
|
||||
"ipStrategy": {
|
||||
"depth": 42,
|
||||
"excludedIPs": [
|
||||
"127.0.0.1"
|
||||
]
|
||||
}
|
||||
},
|
||||
"headers": {
|
||||
"customRequestHeaders": {
|
||||
"foo": "bar"
|
||||
},
|
||||
"customResponseHeaders": {
|
||||
"foo": "bar"
|
||||
},
|
||||
"accessControlAllowCredentials": true,
|
||||
"accessControlAllowHeaders": [
|
||||
"foo"
|
||||
],
|
||||
"accessControlAllowMethods": [
|
||||
"foo"
|
||||
],
|
||||
"accessControlAllowOriginList": [
|
||||
"foo"
|
||||
],
|
||||
"accessControlAllowOriginListRegex": [
|
||||
"foo"
|
||||
],
|
||||
"accessControlExposeHeaders": [
|
||||
"foo"
|
||||
],
|
||||
"accessControlMaxAge": 42,
|
||||
"addVaryHeader": true,
|
||||
"allowedHosts": [
|
||||
"foo"
|
||||
],
|
||||
"hostsProxyHeaders": [
|
||||
"foo"
|
||||
],
|
||||
"sslRedirect": true,
|
||||
"sslTemporaryRedirect": true,
|
||||
"sslHost": "foo",
|
||||
"sslProxyHeaders": {
|
||||
"foo": "bar"
|
||||
},
|
||||
"sslForceHost": true,
|
||||
"stsSeconds": 42,
|
||||
"stsIncludeSubdomains": true,
|
||||
"stsPreload": true,
|
||||
"forceSTSHeader": true,
|
||||
"frameDeny": true,
|
||||
"customFrameOptionsValue": "foo",
|
||||
"contentTypeNosniff": true,
|
||||
"browserXssFilter": true,
|
||||
"customBrowserXSSValue": "foo",
|
||||
"contentSecurityPolicy": "foo",
|
||||
"publicKey": "foo",
|
||||
"referrerPolicy": "foo",
|
||||
"featurePolicy": "foo",
|
||||
"permissionsPolicy": "foo",
|
||||
"isDevelopment": true
|
||||
},
|
||||
"errors": {
|
||||
"status": [
|
||||
"foo"
|
||||
],
|
||||
"service": "foo",
|
||||
"query": "foo"
|
||||
},
|
||||
"rateLimit": {
|
||||
"average": 42,
|
||||
"period": "42ns",
|
||||
"burst": 42,
|
||||
"sourceCriterion": {
|
||||
"ipStrategy": {
|
||||
"depth": 42,
|
||||
"excludedIPs": [
|
||||
"127.0.0.1"
|
||||
]
|
||||
},
|
||||
"requestHeaderName": "foo",
|
||||
"requestHost": true
|
||||
}
|
||||
},
|
||||
"redirectRegex": {
|
||||
"regex": "foo",
|
||||
"replacement": "foo",
|
||||
"permanent": true
|
||||
},
|
||||
"redirectScheme": {
|
||||
"scheme": "foo",
|
||||
"port": "foo",
|
||||
"permanent": true
|
||||
},
|
||||
"basicAuth": {
|
||||
"users": [
|
||||
"xxxx"
|
||||
],
|
||||
"usersFile": "foo",
|
||||
"realm": "foo",
|
||||
"removeHeader": true,
|
||||
"headerField": "foo"
|
||||
},
|
||||
"digestAuth": {
|
||||
"users": [
|
||||
"xxxx"
|
||||
],
|
||||
"usersFile": "foo",
|
||||
"removeHeader": true,
|
||||
"realm": "foo",
|
||||
"headerField": "foo"
|
||||
},
|
||||
"forwardAuth": {
|
||||
"address": "127.0.0.1",
|
||||
"tls": {
|
||||
"ca": "ca.pem",
|
||||
"caOptional": true,
|
||||
"cert": "cert.pem",
|
||||
"key": "xxxx",
|
||||
"insecureSkipVerify": true
|
||||
},
|
||||
"trustForwardHeader": true,
|
||||
"authResponseHeaders": [
|
||||
"foo"
|
||||
],
|
||||
"authResponseHeadersRegex": "foo",
|
||||
"authRequestHeaders": [
|
||||
"foo"
|
||||
]
|
||||
},
|
||||
"inFlightReq": {
|
||||
"amount": 42,
|
||||
"sourceCriterion": {
|
||||
"ipStrategy": {
|
||||
"depth": 42,
|
||||
"excludedIPs": [
|
||||
"127.0.0.1"
|
||||
]
|
||||
},
|
||||
"requestHeaderName": "foo",
|
||||
"requestHost": true
|
||||
}
|
||||
},
|
||||
"buffering": {
|
||||
"maxRequestBodyBytes": 42,
|
||||
"memRequestBodyBytes": 42,
|
||||
"maxResponseBodyBytes": 42,
|
||||
"memResponseBodyBytes": 42,
|
||||
"retryExpression": "foo"
|
||||
},
|
||||
"circuitBreaker": {
|
||||
"expression": "foo"
|
||||
},
|
||||
"compress": {
|
||||
"excludedContentTypes": [
|
||||
"foo"
|
||||
]
|
||||
},
|
||||
"passTLSClientCert": {
|
||||
"pem": true,
|
||||
"info": {
|
||||
"notAfter": true,
|
||||
"notBefore": true,
|
||||
"sans": true,
|
||||
"subject": {
|
||||
"country": true,
|
||||
"province": true,
|
||||
"locality": true,
|
||||
"organization": true,
|
||||
"organizationalUnit": true,
|
||||
"commonName": true,
|
||||
"serialNumber": true,
|
||||
"domainComponent": true
|
||||
},
|
||||
"issuer": {
|
||||
"country": true,
|
||||
"province": true,
|
||||
"locality": true,
|
||||
"organization": true,
|
||||
"commonName": true,
|
||||
"serialNumber": true,
|
||||
"domainComponent": true
|
||||
},
|
||||
"serialNumber": true
|
||||
}
|
||||
},
|
||||
"retry": {
|
||||
"attempts": 42,
|
||||
"initialInterval": "42ns"
|
||||
},
|
||||
"contentType": {
|
||||
"autoDetect": true
|
||||
},
|
||||
"plugin": {
|
||||
"foo": {
|
||||
"answer": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"models": {
|
||||
"foo": {
|
||||
"middlewares": [
|
||||
"foo"
|
||||
],
|
||||
"tls": {
|
||||
"options": "foo",
|
||||
"certResolver": "foo",
|
||||
"domains": [
|
||||
{
|
||||
"main": "foo",
|
||||
"sans": [
|
||||
"foo"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"serversTransports": {
|
||||
"foo": {
|
||||
"serverName": "foo",
|
||||
"insecureSkipVerify": true,
|
||||
"rootCAs": [
|
||||
"rootca.pem"
|
||||
],
|
||||
"certificates": [
|
||||
{
|
||||
"certFile": "cert.pem",
|
||||
"keyFile": "xxxx"
|
||||
}
|
||||
],
|
||||
"maxIdleConnsPerHost": 42,
|
||||
"forwardingTimeouts": {
|
||||
"dialTimeout": "42ns",
|
||||
"responseHeaderTimeout": "42ns",
|
||||
"idleConnTimeout": "42ns",
|
||||
"readIdleTimeout": "42ns",
|
||||
"pingTimeout": "42ns"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"tcp": {
|
||||
"routers": {
|
||||
"foo": {
|
||||
"entryPoints": [
|
||||
"foo"
|
||||
],
|
||||
"service": "foo",
|
||||
"rule": "foo",
|
||||
"tls": {
|
||||
"passthrough": true,
|
||||
"options": "foo",
|
||||
"certResolver": "foo",
|
||||
"domains": [
|
||||
{
|
||||
"main": "foo",
|
||||
"sans": [
|
||||
"foo"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"bar": {
|
||||
"weighted": {
|
||||
"services": [
|
||||
{
|
||||
"name": "foo",
|
||||
"weight": 42
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"foo": {
|
||||
"loadBalancer": {
|
||||
"terminationDelay": 42,
|
||||
"proxyProtocol": {
|
||||
"version": 42
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"address": "127.0.0.1:8080"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"udp": {
|
||||
"routers": {
|
||||
"foo": {
|
||||
"entryPoints": [
|
||||
"foo"
|
||||
],
|
||||
"service": "foo"
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"bar": {
|
||||
"weighted": {
|
||||
"services": [
|
||||
{
|
||||
"name": "foo",
|
||||
"weight": 42
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"foo": {
|
||||
"loadBalancer": {
|
||||
"servers": [
|
||||
{
|
||||
"address": "127.0.0.1:8080"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"tls": {
|
||||
"certificates": [
|
||||
{
|
||||
"certFile": "cert.pem",
|
||||
"keyFile": "xxxx",
|
||||
"stores": [
|
||||
"foo"
|
||||
]
|
||||
}
|
||||
],
|
||||
"options": {
|
||||
"foo": {
|
||||
"minVersion": "foo",
|
||||
"maxVersion": "foo",
|
||||
"cipherSuites": [
|
||||
"foo"
|
||||
],
|
||||
"curvePreferences": [
|
||||
"foo"
|
||||
],
|
||||
"clientAuth": {
|
||||
"caFiles": [
|
||||
"ca.pem"
|
||||
],
|
||||
"clientAuthType": "RequireAndVerifyClientCert"
|
||||
},
|
||||
"sniStrict": true,
|
||||
"preferServerCipherSuites": true
|
||||
}
|
||||
},
|
||||
"stores": {
|
||||
"foo": {
|
||||
"defaultCertificate": {
|
||||
"certFile": "cert.pem",
|
||||
"keyFile": "xxxx"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,12 +84,8 @@ func (c *ConfigurationWatcher) AddListener(listener func(dynamic.Configuration))
|
||||
func (c *ConfigurationWatcher) startProvider() {
|
||||
logger := log.WithoutContext()
|
||||
|
||||
jsonConf, err := json.Marshal(c.provider)
|
||||
if err != nil {
|
||||
logger.Debugf("Unable to marshal provider configuration %T: %v", c.provider, err)
|
||||
}
|
||||
logger.Infof("Starting provider %T", c.provider)
|
||||
|
||||
logger.Infof("Starting provider %T %s", c.provider, jsonConf)
|
||||
currentProvider := c.provider
|
||||
|
||||
safe.Go(func() {
|
||||
@@ -245,7 +241,7 @@ func (c *ConfigurationWatcher) throttleProviderConfigReload(ctx context.Context,
|
||||
case nextConfig := <-in:
|
||||
if reflect.DeepEqual(previousConfig, nextConfig) {
|
||||
logger := log.WithoutContext().WithField(log.ProviderName, nextConfig.ProviderName)
|
||||
logger.Info("Skipping same configuration")
|
||||
logger.Debug("Skipping same configuration")
|
||||
continue
|
||||
}
|
||||
previousConfig = *nextConfig.DeepCopy()
|
||||
|
||||
@@ -50,7 +50,7 @@ var (
|
||||
// Certs and Key could be either a file path, or the file content itself.
|
||||
type Certificate struct {
|
||||
CertFile FileOrContent `json:"certFile,omitempty" toml:"certFile,omitempty" yaml:"certFile,omitempty"`
|
||||
KeyFile FileOrContent `json:"keyFile,omitempty" toml:"keyFile,omitempty" yaml:"keyFile,omitempty"`
|
||||
KeyFile FileOrContent `json:"keyFile,omitempty" toml:"keyFile,omitempty" yaml:"keyFile,omitempty" loggable:"false"`
|
||||
}
|
||||
|
||||
// Certificates defines traefik certificates type
|
||||
|
||||
@@ -25,7 +25,7 @@ func init() {
|
||||
// Config provides configuration settings for a elastic.co tracer.
|
||||
type Config struct {
|
||||
ServerURL string `description:"Sets the URL of the Elastic APM server." json:"serverURL,omitempty" toml:"serverURL,omitempty" yaml:"serverURL,omitempty"`
|
||||
SecretToken string `description:"Sets the token used to connect to Elastic APM Server." json:"secretToken,omitempty" toml:"secretToken,omitempty" yaml:"secretToken,omitempty"`
|
||||
SecretToken string `description:"Sets the token used to connect to Elastic APM Server." json:"secretToken,omitempty" toml:"secretToken,omitempty" yaml:"secretToken,omitempty" loggable:"false"`
|
||||
ServiceEnvironment string `description:"Sets the name of the environment Traefik is deployed in, e.g. 'production' or 'staging'." json:"serviceEnvironment,omitempty" toml:"serviceEnvironment,omitempty" yaml:"serviceEnvironment,omitempty" export:"true"`
|
||||
}
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@ func (c *Config) SetDefaults() {
|
||||
// Collector provides configuration settings for jaeger collector.
|
||||
type Collector struct {
|
||||
Endpoint string `description:"Instructs reporter to send spans to jaeger-collector at this URL." json:"endpoint,omitempty" toml:"endpoint,omitempty" yaml:"endpoint,omitempty"`
|
||||
User string `description:"User for basic http authentication when sending spans to jaeger-collector." json:"user,omitempty" toml:"user,omitempty" yaml:"user,omitempty"`
|
||||
Password string `description:"Password for basic http authentication when sending spans to jaeger-collector." json:"password,omitempty" toml:"password,omitempty" yaml:"password,omitempty"`
|
||||
User string `description:"User for basic http authentication when sending spans to jaeger-collector." json:"user,omitempty" toml:"user,omitempty" yaml:"user,omitempty" loggable:"false"`
|
||||
Password string `description:"Password for basic http authentication when sending spans to jaeger-collector." json:"password,omitempty" toml:"password,omitempty" yaml:"password,omitempty" loggable:"false"`
|
||||
}
|
||||
|
||||
// SetDefaults sets the default values.
|
||||
|
||||
@@ -22,7 +22,7 @@ type Prometheus struct {
|
||||
AddEntryPointsLabels bool `description:"Enable metrics on entry points." json:"addEntryPointsLabels,omitempty" toml:"addEntryPointsLabels,omitempty" yaml:"addEntryPointsLabels,omitempty" export:"true"`
|
||||
AddRoutersLabels bool `description:"Enable metrics on routers." json:"addRoutersLabels,omitempty" toml:"addRoutersLabels,omitempty" yaml:"addRoutersLabels,omitempty" export:"true"`
|
||||
AddServicesLabels bool `description:"Enable metrics on services." json:"addServicesLabels,omitempty" toml:"addServicesLabels,omitempty" yaml:"addServicesLabels,omitempty" export:"true"`
|
||||
EntryPoint string `description:"EntryPoint" export:"true" json:"entryPoint,omitempty" toml:"entryPoint,omitempty" yaml:"entryPoint,omitempty"`
|
||||
EntryPoint string `description:"EntryPoint" json:"entryPoint,omitempty" toml:"entryPoint,omitempty" yaml:"entryPoint,omitempty" export:"true"`
|
||||
ManualRouting bool `description:"Manual routing" json:"manualRouting,omitempty" toml:"manualRouting,omitempty" yaml:"manualRouting,omitempty" export:"true"`
|
||||
}
|
||||
|
||||
@@ -88,8 +88,8 @@ type InfluxDB struct {
|
||||
PushInterval types.Duration `description:"InfluxDB push interval." json:"pushInterval,omitempty" toml:"pushInterval,omitempty" yaml:"pushInterval,omitempty" export:"true"`
|
||||
Database string `description:"InfluxDB database used when protocol is http." json:"database,omitempty" toml:"database,omitempty" yaml:"database,omitempty" export:"true"`
|
||||
RetentionPolicy string `description:"InfluxDB retention policy used when protocol is http." json:"retentionPolicy,omitempty" toml:"retentionPolicy,omitempty" yaml:"retentionPolicy,omitempty" export:"true"`
|
||||
Username string `description:"InfluxDB username (only with http)." json:"username,omitempty" toml:"username,omitempty" yaml:"username,omitempty"`
|
||||
Password string `description:"InfluxDB password (only with http)." json:"password,omitempty" toml:"password,omitempty" yaml:"password,omitempty"`
|
||||
Username string `description:"InfluxDB username (only with http)." json:"username,omitempty" toml:"username,omitempty" yaml:"username,omitempty" loggable:"false"`
|
||||
Password string `description:"InfluxDB password (only with http)." json:"password,omitempty" toml:"password,omitempty" yaml:"password,omitempty" loggable:"false"`
|
||||
AddEntryPointsLabels bool `description:"Enable metrics on entry points." json:"addEntryPointsLabels,omitempty" toml:"addEntryPointsLabels,omitempty" yaml:"addEntryPointsLabels,omitempty" export:"true"`
|
||||
AddRoutersLabels bool `description:"Enable metrics on routers." json:"addRoutersLabels,omitempty" toml:"addRoutersLabels,omitempty" yaml:"addRoutersLabels,omitempty" export:"true"`
|
||||
AddServicesLabels bool `description:"Enable metrics on services." json:"addServicesLabels,omitempty" toml:"addServicesLabels,omitempty" yaml:"addServicesLabels,omitempty" export:"true"`
|
||||
|
||||
@@ -19,7 +19,7 @@ type ClientTLS struct {
|
||||
CA string `description:"TLS CA" json:"ca,omitempty" toml:"ca,omitempty" yaml:"ca,omitempty"`
|
||||
CAOptional bool `description:"TLS CA.Optional" json:"caOptional,omitempty" toml:"caOptional,omitempty" yaml:"caOptional,omitempty" export:"true"`
|
||||
Cert string `description:"TLS cert" json:"cert,omitempty" toml:"cert,omitempty" yaml:"cert,omitempty"`
|
||||
Key string `description:"TLS key" json:"key,omitempty" toml:"key,omitempty" yaml:"key,omitempty"`
|
||||
Key string `description:"TLS key" json:"key,omitempty" toml:"key,omitempty" yaml:"key,omitempty" loggable:"false"`
|
||||
InsecureSkipVerify bool `description:"TLS insecure skip verify" json:"insecureSkipVerify,omitempty" toml:"insecureSkipVerify,omitempty" yaml:"insecureSkipVerify,omitempty" export:"true"`
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ RepositoryName = "traefik"
|
||||
OutputType = "file"
|
||||
FileName = "traefik_changelog.md"
|
||||
|
||||
# example new bugfix v2.5.6
|
||||
# example new bugfix v2.5.7
|
||||
CurrentRef = "v2.5"
|
||||
PreviousRef = "v2.5.5"
|
||||
PreviousRef = "v2.5.6"
|
||||
BaseBranch = "v2.5"
|
||||
FutureCurrentRefName = "v2.5.6"
|
||||
FutureCurrentRefName = "v2.5.7"
|
||||
|
||||
ThresholdPreviousRef = 10
|
||||
ThresholdCurrentRef = 10
|
||||
|
||||
@@ -4,11 +4,11 @@ RepositoryName = "traefik"
|
||||
OutputType = "file"
|
||||
FileName = "traefik_changelog.md"
|
||||
|
||||
# example final release of v2.5.0
|
||||
CurrentRef = "v2.5"
|
||||
PreviousRef = "v2.5.0-rc1"
|
||||
BaseBranch = "v2.5"
|
||||
FutureCurrentRefName = "v2.5.0"
|
||||
# example final release of v2.6.0
|
||||
CurrentRef = "v2.6"
|
||||
PreviousRef = "v2.6.0-rc1"
|
||||
BaseBranch = "v2.6"
|
||||
FutureCurrentRefName = "v2.6.0"
|
||||
|
||||
ThresholdPreviousRef = 10
|
||||
ThresholdCurrentRef = 10
|
||||
|
||||
@@ -4,11 +4,11 @@ RepositoryName = "traefik"
|
||||
OutputType = "file"
|
||||
FileName = "traefik_changelog.md"
|
||||
|
||||
# example final release of v2.5.0
|
||||
CurrentRef = "v2.5.0-rc1"
|
||||
PreviousRef = "v2.4.0-rc1"
|
||||
# example final release of v2.6.0
|
||||
CurrentRef = "v2.6.0-rc1"
|
||||
PreviousRef = "v2.5.0-rc1"
|
||||
BaseBranch = "master"
|
||||
FutureCurrentRefName = "v2.5.0-rc1"
|
||||
FutureCurrentRefName = "v2.6.0-rc1"
|
||||
|
||||
ThresholdPreviousRef = 10
|
||||
ThresholdCurrentRef = 10
|
||||
|
||||
@@ -4,11 +4,11 @@ RepositoryName = "traefik"
|
||||
OutputType = "file"
|
||||
FileName = "traefik_changelog.md"
|
||||
|
||||
# example RC2 of v2.6.0
|
||||
# example RC3 of v2.6.0
|
||||
CurrentRef = "v2.6"
|
||||
PreviousRef = "v2.6.0-rc1"
|
||||
PreviousRef = "v2.6.0-rc2"
|
||||
BaseBranch = "v2.6"
|
||||
FutureCurrentRefName = "v2.6.0-rc2"
|
||||
FutureCurrentRefName = "v2.6.0-rc3"
|
||||
|
||||
ThresholdPreviousRef = 10
|
||||
ThresholdCurrentRef = 10
|
||||
|
||||
@@ -941,8 +941,9 @@
|
||||
<div class="text-subtitle2">Regex</div>
|
||||
<q-chip
|
||||
dense
|
||||
class="app-chip app-chip-green">
|
||||
class="app-chip app-chip-green app-chip-overflow">
|
||||
{{ exData(middleware).regex }}
|
||||
<q-tooltip>{{ exData(middleware).regex }}</q-tooltip>
|
||||
</q-chip>
|
||||
</div>
|
||||
</div>
|
||||
@@ -954,8 +955,9 @@
|
||||
<div class="text-subtitle2">Replacement</div>
|
||||
<q-chip
|
||||
dense
|
||||
class="app-chip app-chip-green">
|
||||
class="app-chip app-chip-green app-chip-overflow">
|
||||
{{ exData(middleware).replacement }}
|
||||
<q-tooltip>{{ exData(middleware).replacement }}</q-tooltip>
|
||||
</q-chip>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1005,8 +1007,9 @@
|
||||
<div class="text-subtitle2">Regex</div>
|
||||
<q-chip
|
||||
dense
|
||||
class="app-chip app-chip-green">
|
||||
class="app-chip app-chip-green app-chip-overflow">
|
||||
{{ exData(middleware).regex }}
|
||||
<q-tooltip>{{ exData(middleware).regex }}</q-tooltip>
|
||||
</q-chip>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1018,8 +1021,9 @@
|
||||
<div class="text-subtitle2">Replacement</div>
|
||||
<q-chip
|
||||
dense
|
||||
class="app-chip app-chip-green">
|
||||
class="app-chip app-chip-green app-chip-overflow">
|
||||
{{ exData(middleware).replacement }}
|
||||
<q-tooltip>{{ exData(middleware).replacement }}</q-tooltip>
|
||||
</q-chip>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1062,8 +1066,9 @@
|
||||
<q-chip
|
||||
v-for="(exp, key) in exData(middleware).regex" :key="key"
|
||||
dense
|
||||
class="app-chip app-chip-green">
|
||||
class="app-chip app-chip-green app-chip-overflow">
|
||||
{{ exp }}
|
||||
<q-tooltip>{{ exp }}</q-tooltip>
|
||||
</q-chip>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user