2018-12-04 13:24:04 +00:00
|
|
|
package label
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"testing"
|
2020-01-08 10:44:04 +00:00
|
|
|
"time"
|
2018-12-04 13:24:04 +00:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/stretchr/testify/require"
|
2020-08-17 16:04:03 +00:00
|
|
|
ptypes "github.com/traefik/paerser/types"
|
2023-02-03 14:24:05 +00:00
|
|
|
"github.com/traefik/traefik/v3/pkg/config/dynamic"
|
|
|
|
"github.com/traefik/traefik/v3/pkg/types"
|
2018-12-04 13:24:04 +00:00
|
|
|
)
|
|
|
|
|
2019-01-18 14:18:04 +00:00
|
|
|
func TestDecodeConfiguration(t *testing.T) {
|
2018-12-04 13:24:04 +00:00
|
|
|
labels := map[string]string{
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.http.middlewares.Middleware0.addprefix.prefix": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware1.basicauth.headerfield": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware1.basicauth.realm": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware1.basicauth.removeheader": "true",
|
|
|
|
"traefik.http.middlewares.Middleware1.basicauth.users": "foobar, fiibar",
|
|
|
|
"traefik.http.middlewares.Middleware1.basicauth.usersfile": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware2.buffering.maxrequestbodybytes": "42",
|
|
|
|
"traefik.http.middlewares.Middleware2.buffering.maxresponsebodybytes": "42",
|
|
|
|
"traefik.http.middlewares.Middleware2.buffering.memrequestbodybytes": "42",
|
|
|
|
"traefik.http.middlewares.Middleware2.buffering.memresponsebodybytes": "42",
|
|
|
|
"traefik.http.middlewares.Middleware2.buffering.retryexpression": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware3.chain.middlewares": "foobar, fiibar",
|
|
|
|
"traefik.http.middlewares.Middleware4.circuitbreaker.expression": "foobar",
|
2022-04-05 10:30:08 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware4.circuitbreaker.checkperiod": "1s",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware4.circuitbreaker.fallbackduration": "1s",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware4.circuitbreaker.recoveryduration": "1s",
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.http.middlewares.Middleware5.digestauth.headerfield": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware5.digestauth.realm": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware5.digestauth.removeheader": "true",
|
|
|
|
"traefik.http.middlewares.Middleware5.digestauth.users": "foobar, fiibar",
|
|
|
|
"traefik.http.middlewares.Middleware5.digestauth.usersfile": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware6.errors.query": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware6.errors.service": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware6.errors.status": "foobar, fiibar",
|
|
|
|
"traefik.http.middlewares.Middleware7.forwardauth.address": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware7.forwardauth.authresponseheaders": "foobar, fiibar",
|
2020-10-07 14:36:04 +00:00
|
|
|
"traefik.http.middlewares.Middleware7.forwardauth.authrequestheaders": "foobar, fiibar",
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.http.middlewares.Middleware7.forwardauth.tls.ca": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware7.forwardauth.tls.cert": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware7.forwardauth.tls.insecureskipverify": "true",
|
|
|
|
"traefik.http.middlewares.Middleware7.forwardauth.tls.key": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware7.forwardauth.trustforwardheader": "true",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.accesscontrolallowcredentials": "true",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.allowedhosts": "foobar, fiibar",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.accesscontrolallowheaders": "X-foobar, X-fiibar",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.accesscontrolallowmethods": "GET, PUT",
|
2020-03-05 07:18:04 +00:00
|
|
|
"traefik.http.middlewares.Middleware8.headers.accesscontrolalloworiginList": "foobar, fiibar",
|
2020-10-29 09:52:03 +00:00
|
|
|
"traefik.http.middlewares.Middleware8.headers.accesscontrolalloworiginListRegex": "foobar, fiibar",
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.http.middlewares.Middleware8.headers.accesscontrolexposeheaders": "X-foobar, X-fiibar",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.accesscontrolmaxage": "200",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.addvaryheader": "true",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.browserxssfilter": "true",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.contentsecuritypolicy": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.contenttypenosniff": "true",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.custombrowserxssvalue": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.customframeoptionsvalue": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.customrequestheaders.name0": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.customrequestheaders.name1": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.customresponseheaders.name0": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.customresponseheaders.name1": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.forcestsheader": "true",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.framedeny": "true",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.hostsproxyheaders": "foobar, fiibar",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.isdevelopment": "true",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.publickey": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.referrerpolicy": "foobar",
|
2021-06-21 13:16:13 +00:00
|
|
|
"traefik.http.middlewares.Middleware8.headers.permissionspolicy": "foobar",
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.http.middlewares.Middleware8.headers.sslproxyheaders.name0": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.sslproxyheaders.name1": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.stsincludesubdomains": "true",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.stspreload": "true",
|
|
|
|
"traefik.http.middlewares.Middleware8.headers.stsseconds": "42",
|
2022-10-26 15:16:05 +00:00
|
|
|
"traefik.http.middlewares.Middleware9.ipallowlist.ipstrategy.depth": "42",
|
|
|
|
"traefik.http.middlewares.Middleware9.ipallowlist.ipstrategy.excludedips": "foobar, fiibar",
|
|
|
|
"traefik.http.middlewares.Middleware9.ipallowlist.sourcerange": "foobar, fiibar",
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.http.middlewares.Middleware10.inflightreq.amount": "42",
|
|
|
|
"traefik.http.middlewares.Middleware10.inflightreq.sourcecriterion.ipstrategy.depth": "42",
|
|
|
|
"traefik.http.middlewares.Middleware10.inflightreq.sourcecriterion.ipstrategy.excludedips": "foobar, fiibar",
|
|
|
|
"traefik.http.middlewares.Middleware10.inflightreq.sourcecriterion.requestheadername": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware10.inflightreq.sourcecriterion.requesthost": "true",
|
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.notafter": "true",
|
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.notbefore": "true",
|
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.sans": "true",
|
2019-12-11 23:32:03 +00:00
|
|
|
"traefik.http.middlewares.Middleware11.passTLSClientCert.info.serialNumber": "true",
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.subject.commonname": "true",
|
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.subject.country": "true",
|
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.subject.domaincomponent": "true",
|
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.subject.locality": "true",
|
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.subject.organization": "true",
|
2021-07-28 15:42:09 +00:00
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.subject.organizationalunit": "true",
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.subject.province": "true",
|
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.subject.serialnumber": "true",
|
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.issuer.commonname": "true",
|
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.issuer.country": "true",
|
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.issuer.domaincomponent": "true",
|
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.issuer.locality": "true",
|
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.issuer.organization": "true",
|
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.issuer.province": "true",
|
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.info.issuer.serialnumber": "true",
|
|
|
|
"traefik.http.middlewares.Middleware11.passtlsclientcert.pem": "true",
|
|
|
|
"traefik.http.middlewares.Middleware12.ratelimit.average": "42",
|
2020-01-08 10:44:04 +00:00
|
|
|
"traefik.http.middlewares.Middleware12.ratelimit.period": "1s",
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.http.middlewares.Middleware12.ratelimit.burst": "42",
|
|
|
|
"traefik.http.middlewares.Middleware12.ratelimit.sourcecriterion.requestheadername": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware12.ratelimit.sourcecriterion.requesthost": "true",
|
|
|
|
"traefik.http.middlewares.Middleware12.ratelimit.sourcecriterion.ipstrategy.depth": "42",
|
|
|
|
"traefik.http.middlewares.Middleware12.ratelimit.sourcecriterion.ipstrategy.excludedips": "foobar, foobar",
|
|
|
|
"traefik.http.middlewares.Middleware13.redirectregex.permanent": "true",
|
|
|
|
"traefik.http.middlewares.Middleware13.redirectregex.regex": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware13.redirectregex.replacement": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware13b.redirectscheme.scheme": "https",
|
|
|
|
"traefik.http.middlewares.Middleware13b.redirectscheme.port": "80",
|
|
|
|
"traefik.http.middlewares.Middleware13b.redirectscheme.permanent": "true",
|
|
|
|
"traefik.http.middlewares.Middleware14.replacepath.path": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware15.replacepathregex.regex": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware15.replacepathregex.replacement": "foobar",
|
|
|
|
"traefik.http.middlewares.Middleware16.retry.attempts": "42",
|
2020-11-05 15:14:04 +00:00
|
|
|
"traefik.http.middlewares.Middleware16.retry.initialinterval": "1s",
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.http.middlewares.Middleware17.stripprefix.prefixes": "foobar, fiibar",
|
|
|
|
"traefik.http.middlewares.Middleware18.stripprefixregex.regex": "foobar, fiibar",
|
2021-09-20 16:00:08 +00:00
|
|
|
"traefik.http.middlewares.Middleware19.compress.minresponsebodybytes": "42",
|
2020-07-12 10:56:22 +00:00
|
|
|
"traefik.http.middlewares.Middleware20.plugin.tomato.aaa": "foo1",
|
|
|
|
"traefik.http.middlewares.Middleware20.plugin.tomato.bbb": "foo2",
|
|
|
|
"traefik.http.routers.Router0.entrypoints": "foobar, fiibar",
|
|
|
|
"traefik.http.routers.Router0.middlewares": "foobar, fiibar",
|
|
|
|
"traefik.http.routers.Router0.priority": "42",
|
|
|
|
"traefik.http.routers.Router0.rule": "foobar",
|
|
|
|
"traefik.http.routers.Router0.tls": "true",
|
|
|
|
"traefik.http.routers.Router0.service": "foobar",
|
|
|
|
"traefik.http.routers.Router1.entrypoints": "foobar, fiibar",
|
|
|
|
"traefik.http.routers.Router1.middlewares": "foobar, fiibar",
|
|
|
|
"traefik.http.routers.Router1.priority": "42",
|
|
|
|
"traefik.http.routers.Router1.rule": "foobar",
|
|
|
|
"traefik.http.routers.Router1.service": "foobar",
|
2018-12-04 13:24:04 +00:00
|
|
|
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.http.services.Service0.loadbalancer.healthcheck.headers.name0": "foobar",
|
|
|
|
"traefik.http.services.Service0.loadbalancer.healthcheck.headers.name1": "foobar",
|
|
|
|
"traefik.http.services.Service0.loadbalancer.healthcheck.hostname": "foobar",
|
2022-11-16 10:38:07 +00:00
|
|
|
"traefik.http.services.Service0.loadbalancer.healthcheck.interval": "1s",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.http.services.Service0.loadbalancer.healthcheck.path": "foobar",
|
2022-08-08 13:22:07 +00:00
|
|
|
"traefik.http.services.Service0.loadbalancer.healthcheck.method": "foobar",
|
2022-11-24 10:40:05 +00:00
|
|
|
"traefik.http.services.Service0.loadbalancer.healthcheck.status": "401",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.http.services.Service0.loadbalancer.healthcheck.port": "42",
|
|
|
|
"traefik.http.services.Service0.loadbalancer.healthcheck.scheme": "foobar",
|
2022-09-20 14:54:08 +00:00
|
|
|
"traefik.http.services.Service0.loadbalancer.healthcheck.mode": "foobar",
|
2022-11-16 10:38:07 +00:00
|
|
|
"traefik.http.services.Service0.loadbalancer.healthcheck.timeout": "1s",
|
2020-02-26 16:28:04 +00:00
|
|
|
"traefik.http.services.Service0.loadbalancer.healthcheck.followredirects": "true",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.http.services.Service0.loadbalancer.passhostheader": "true",
|
2022-11-16 10:38:07 +00:00
|
|
|
"traefik.http.services.Service0.loadbalancer.responseforwarding.flushinterval": "1s",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.http.services.Service0.loadbalancer.server.scheme": "foobar",
|
|
|
|
"traefik.http.services.Service0.loadbalancer.server.port": "8080",
|
2019-08-26 08:30:05 +00:00
|
|
|
"traefik.http.services.Service0.loadbalancer.sticky.cookie.name": "foobar",
|
|
|
|
"traefik.http.services.Service0.loadbalancer.sticky.cookie.secure": "true",
|
2022-12-09 08:58:05 +00:00
|
|
|
"traefik.http.services.Service0.loadbalancer.serversTransport": "foobar",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.http.services.Service1.loadbalancer.healthcheck.headers.name0": "foobar",
|
|
|
|
"traefik.http.services.Service1.loadbalancer.healthcheck.headers.name1": "foobar",
|
|
|
|
"traefik.http.services.Service1.loadbalancer.healthcheck.hostname": "foobar",
|
2022-11-16 10:38:07 +00:00
|
|
|
"traefik.http.services.Service1.loadbalancer.healthcheck.interval": "1s",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.http.services.Service1.loadbalancer.healthcheck.path": "foobar",
|
2022-08-08 13:22:07 +00:00
|
|
|
"traefik.http.services.Service1.loadbalancer.healthcheck.method": "foobar",
|
2022-11-24 10:40:05 +00:00
|
|
|
"traefik.http.services.Service1.loadbalancer.healthcheck.status": "401",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.http.services.Service1.loadbalancer.healthcheck.port": "42",
|
|
|
|
"traefik.http.services.Service1.loadbalancer.healthcheck.scheme": "foobar",
|
2022-09-20 14:54:08 +00:00
|
|
|
"traefik.http.services.Service1.loadbalancer.healthcheck.mode": "foobar",
|
2022-11-16 10:38:07 +00:00
|
|
|
"traefik.http.services.Service1.loadbalancer.healthcheck.timeout": "1s",
|
2020-02-26 16:28:04 +00:00
|
|
|
"traefik.http.services.Service1.loadbalancer.healthcheck.followredirects": "true",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.http.services.Service1.loadbalancer.passhostheader": "true",
|
2022-11-16 10:38:07 +00:00
|
|
|
"traefik.http.services.Service1.loadbalancer.responseforwarding.flushinterval": "1s",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.http.services.Service1.loadbalancer.server.scheme": "foobar",
|
|
|
|
"traefik.http.services.Service1.loadbalancer.server.port": "8080",
|
2019-08-26 08:30:05 +00:00
|
|
|
"traefik.http.services.Service1.loadbalancer.sticky": "false",
|
|
|
|
"traefik.http.services.Service1.loadbalancer.sticky.cookie.name": "fui",
|
2022-12-09 08:58:05 +00:00
|
|
|
"traefik.http.services.Service1.loadbalancer.serversTransport": "foobar",
|
2021-06-11 13:30:05 +00:00
|
|
|
|
2022-10-26 15:16:05 +00:00
|
|
|
"traefik.tcp.middlewares.Middleware0.ipallowlist.sourcerange": "foobar, fiibar",
|
2021-11-29 16:12:06 +00:00
|
|
|
"traefik.tcp.middlewares.Middleware2.inflightconn.amount": "42",
|
2021-06-11 13:30:05 +00:00
|
|
|
"traefik.tcp.routers.Router0.rule": "foobar",
|
2022-03-17 17:02:08 +00:00
|
|
|
"traefik.tcp.routers.Router0.priority": "42",
|
2021-06-11 13:30:05 +00:00
|
|
|
"traefik.tcp.routers.Router0.entrypoints": "foobar, fiibar",
|
|
|
|
"traefik.tcp.routers.Router0.service": "foobar",
|
|
|
|
"traefik.tcp.routers.Router0.tls.passthrough": "false",
|
|
|
|
"traefik.tcp.routers.Router0.tls.options": "foo",
|
|
|
|
"traefik.tcp.routers.Router1.rule": "foobar",
|
2022-03-17 17:02:08 +00:00
|
|
|
"traefik.tcp.routers.Router1.priority": "42",
|
2021-06-11 13:30:05 +00:00
|
|
|
"traefik.tcp.routers.Router1.entrypoints": "foobar, fiibar",
|
|
|
|
"traefik.tcp.routers.Router1.service": "foobar",
|
|
|
|
"traefik.tcp.routers.Router1.tls.options": "foo",
|
|
|
|
"traefik.tcp.routers.Router1.tls.passthrough": "false",
|
|
|
|
"traefik.tcp.services.Service0.loadbalancer.server.Port": "42",
|
|
|
|
"traefik.tcp.services.Service0.loadbalancer.proxyProtocol.version": "42",
|
2022-12-09 08:58:05 +00:00
|
|
|
"traefik.tcp.services.Service0.loadbalancer.serversTransport": "foo",
|
2021-06-11 13:30:05 +00:00
|
|
|
"traefik.tcp.services.Service1.loadbalancer.server.Port": "42",
|
|
|
|
"traefik.tcp.services.Service1.loadbalancer.proxyProtocol": "true",
|
2022-12-09 08:58:05 +00:00
|
|
|
"traefik.tcp.services.Service1.loadbalancer.serversTransport": "foo",
|
2020-02-20 21:24:05 +00:00
|
|
|
|
|
|
|
"traefik.udp.routers.Router0.entrypoints": "foobar, fiibar",
|
|
|
|
"traefik.udp.routers.Router0.service": "foobar",
|
|
|
|
"traefik.udp.routers.Router1.entrypoints": "foobar, fiibar",
|
|
|
|
"traefik.udp.routers.Router1.service": "foobar",
|
|
|
|
"traefik.udp.services.Service0.loadbalancer.server.Port": "42",
|
|
|
|
"traefik.udp.services.Service1.loadbalancer.server.Port": "42",
|
2018-12-04 13:24:04 +00:00
|
|
|
}
|
|
|
|
|
2019-01-18 14:18:04 +00:00
|
|
|
configuration, err := DecodeConfiguration(labels)
|
2018-12-04 13:24:04 +00:00
|
|
|
require.NoError(t, err)
|
|
|
|
|
2019-07-10 07:26:04 +00:00
|
|
|
expected := &dynamic.Configuration{
|
|
|
|
TCP: &dynamic.TCPConfiguration{
|
|
|
|
Routers: map[string]*dynamic.TCPRouter{
|
2019-04-15 16:22:07 +00:00
|
|
|
"Router0": {
|
|
|
|
EntryPoints: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2022-03-17 17:02:08 +00:00
|
|
|
Service: "foobar",
|
|
|
|
Rule: "foobar",
|
|
|
|
Priority: 42,
|
2019-07-10 07:26:04 +00:00
|
|
|
TLS: &dynamic.RouterTCPTLSConfig{
|
2019-04-15 16:22:07 +00:00
|
|
|
Passthrough: false,
|
2019-06-17 16:14:08 +00:00
|
|
|
Options: "foo",
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Router1": {
|
|
|
|
EntryPoints: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2022-03-17 17:02:08 +00:00
|
|
|
Service: "foobar",
|
|
|
|
Rule: "foobar",
|
|
|
|
Priority: 42,
|
2019-07-10 07:26:04 +00:00
|
|
|
TLS: &dynamic.RouterTCPTLSConfig{
|
2019-04-15 16:22:07 +00:00
|
|
|
Passthrough: false,
|
2019-06-17 16:14:08 +00:00
|
|
|
Options: "foo",
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
2021-06-11 13:30:05 +00:00
|
|
|
Middlewares: map[string]*dynamic.TCPMiddleware{
|
|
|
|
"Middleware0": {
|
2022-10-26 15:16:05 +00:00
|
|
|
IPAllowList: &dynamic.TCPIPAllowList{
|
2021-06-11 13:30:05 +00:00
|
|
|
SourceRange: []string{"foobar", "fiibar"},
|
|
|
|
},
|
|
|
|
},
|
2021-11-29 16:12:06 +00:00
|
|
|
"Middleware2": {
|
|
|
|
InFlightConn: &dynamic.TCPInFlightConn{
|
|
|
|
Amount: 42,
|
|
|
|
},
|
|
|
|
},
|
2021-06-11 13:30:05 +00:00
|
|
|
},
|
2019-07-10 07:26:04 +00:00
|
|
|
Services: map[string]*dynamic.TCPService{
|
2019-04-15 16:22:07 +00:00
|
|
|
"Service0": {
|
2019-09-13 18:00:06 +00:00
|
|
|
LoadBalancer: &dynamic.TCPServersLoadBalancer{
|
2019-07-10 07:26:04 +00:00
|
|
|
Servers: []dynamic.TCPServer{
|
2019-04-15 16:22:07 +00:00
|
|
|
{
|
2019-06-05 20:18:06 +00:00
|
|
|
Port: "42",
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
|
|
|
},
|
2020-11-17 12:04:04 +00:00
|
|
|
ProxyProtocol: &dynamic.ProxyProtocol{Version: 42},
|
2022-12-09 08:58:05 +00:00
|
|
|
ServersTransport: "foo",
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Service1": {
|
2019-09-13 18:00:06 +00:00
|
|
|
LoadBalancer: &dynamic.TCPServersLoadBalancer{
|
2019-07-10 07:26:04 +00:00
|
|
|
Servers: []dynamic.TCPServer{
|
2019-04-15 16:22:07 +00:00
|
|
|
{
|
2019-06-05 20:18:06 +00:00
|
|
|
Port: "42",
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
|
|
|
},
|
2020-11-17 12:04:04 +00:00
|
|
|
ProxyProtocol: &dynamic.ProxyProtocol{Version: 2},
|
2022-12-09 08:58:05 +00:00
|
|
|
ServersTransport: "foo",
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2020-02-20 21:24:05 +00:00
|
|
|
UDP: &dynamic.UDPConfiguration{
|
|
|
|
Routers: map[string]*dynamic.UDPRouter{
|
|
|
|
"Router0": {
|
|
|
|
EntryPoints: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
Service: "foobar",
|
|
|
|
},
|
|
|
|
"Router1": {
|
|
|
|
EntryPoints: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
Service: "foobar",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Services: map[string]*dynamic.UDPService{
|
|
|
|
"Service0": {
|
|
|
|
LoadBalancer: &dynamic.UDPServersLoadBalancer{
|
|
|
|
Servers: []dynamic.UDPServer{
|
|
|
|
{
|
|
|
|
Port: "42",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"Service1": {
|
|
|
|
LoadBalancer: &dynamic.UDPServersLoadBalancer{
|
|
|
|
Servers: []dynamic.UDPServer{
|
|
|
|
{
|
|
|
|
Port: "42",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2019-07-10 07:26:04 +00:00
|
|
|
HTTP: &dynamic.HTTPConfiguration{
|
|
|
|
Routers: map[string]*dynamic.Router{
|
2019-04-15 16:22:07 +00:00
|
|
|
"Router0": {
|
|
|
|
EntryPoints: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
Middlewares: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
Service: "foobar",
|
|
|
|
Rule: "foobar",
|
|
|
|
Priority: 42,
|
2019-07-10 07:26:04 +00:00
|
|
|
TLS: &dynamic.RouterTLSConfig{},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Router1": {
|
|
|
|
EntryPoints: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
Middlewares: []string{
|
2018-12-04 13:24:04 +00:00
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
Service: "foobar",
|
|
|
|
Rule: "foobar",
|
|
|
|
Priority: 42,
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
2019-07-10 07:26:04 +00:00
|
|
|
Middlewares: map[string]*dynamic.Middleware{
|
2019-04-15 16:22:07 +00:00
|
|
|
"Middleware0": {
|
2019-07-10 07:26:04 +00:00
|
|
|
AddPrefix: &dynamic.AddPrefix{
|
2019-04-15 16:22:07 +00:00
|
|
|
Prefix: "foobar",
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Middleware1": {
|
2019-07-10 07:26:04 +00:00
|
|
|
BasicAuth: &dynamic.BasicAuth{
|
2019-04-15 16:22:07 +00:00
|
|
|
Users: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
2019-02-26 13:50:07 +00:00
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
UsersFile: "foobar",
|
|
|
|
Realm: "foobar",
|
|
|
|
RemoveHeader: true,
|
|
|
|
HeaderField: "foobar",
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Middleware10": {
|
2019-08-26 10:20:06 +00:00
|
|
|
InFlightReq: &dynamic.InFlightReq{
|
|
|
|
Amount: 42,
|
|
|
|
SourceCriterion: &dynamic.SourceCriterion{
|
|
|
|
IPStrategy: &dynamic.IPStrategy{
|
|
|
|
Depth: 42,
|
|
|
|
ExcludedIPs: []string{"foobar", "fiibar"},
|
|
|
|
},
|
|
|
|
RequestHeaderName: "foobar",
|
|
|
|
RequestHost: true,
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Middleware11": {
|
2019-07-10 07:26:04 +00:00
|
|
|
PassTLSClientCert: &dynamic.PassTLSClientCert{
|
2019-04-15 16:22:07 +00:00
|
|
|
PEM: true,
|
2019-07-10 07:26:04 +00:00
|
|
|
Info: &dynamic.TLSClientCertificateInfo{
|
2019-12-11 23:32:03 +00:00
|
|
|
NotAfter: true,
|
|
|
|
NotBefore: true,
|
|
|
|
SerialNumber: true,
|
2021-11-08 21:41:43 +00:00
|
|
|
Subject: &dynamic.TLSClientCertificateSubjectDNInfo{
|
2021-07-28 15:42:09 +00:00
|
|
|
Country: true,
|
|
|
|
Province: true,
|
|
|
|
Locality: true,
|
|
|
|
Organization: true,
|
|
|
|
OrganizationalUnit: true,
|
|
|
|
CommonName: true,
|
|
|
|
SerialNumber: true,
|
|
|
|
DomainComponent: true,
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
2021-11-08 21:41:43 +00:00
|
|
|
Issuer: &dynamic.TLSClientCertificateIssuerDNInfo{
|
2019-04-15 16:22:07 +00:00
|
|
|
Country: true,
|
|
|
|
Province: true,
|
|
|
|
Locality: true,
|
|
|
|
Organization: true,
|
|
|
|
CommonName: true,
|
|
|
|
SerialNumber: true,
|
|
|
|
DomainComponent: true,
|
|
|
|
},
|
|
|
|
Sans: true,
|
|
|
|
},
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-08-26 10:20:06 +00:00
|
|
|
"Middleware12": {
|
|
|
|
RateLimit: &dynamic.RateLimit{
|
|
|
|
Average: 42,
|
|
|
|
Burst: 42,
|
2020-08-17 16:04:03 +00:00
|
|
|
Period: ptypes.Duration(time.Second),
|
2019-08-26 10:20:06 +00:00
|
|
|
SourceCriterion: &dynamic.SourceCriterion{
|
|
|
|
IPStrategy: &dynamic.IPStrategy{
|
|
|
|
Depth: 42,
|
|
|
|
ExcludedIPs: []string{"foobar", "foobar"},
|
|
|
|
},
|
|
|
|
RequestHeaderName: "foobar",
|
|
|
|
RequestHost: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Middleware13": {
|
2019-07-10 07:26:04 +00:00
|
|
|
RedirectRegex: &dynamic.RedirectRegex{
|
2019-04-15 16:22:07 +00:00
|
|
|
Regex: "foobar",
|
|
|
|
Replacement: "foobar",
|
|
|
|
Permanent: true,
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Middleware13b": {
|
2019-07-10 07:26:04 +00:00
|
|
|
RedirectScheme: &dynamic.RedirectScheme{
|
2019-04-15 16:22:07 +00:00
|
|
|
Scheme: "https",
|
|
|
|
Port: "80",
|
|
|
|
Permanent: true,
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Middleware14": {
|
2019-07-10 07:26:04 +00:00
|
|
|
ReplacePath: &dynamic.ReplacePath{
|
2019-04-15 16:22:07 +00:00
|
|
|
Path: "foobar",
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Middleware15": {
|
2019-07-10 07:26:04 +00:00
|
|
|
ReplacePathRegex: &dynamic.ReplacePathRegex{
|
2019-04-15 16:22:07 +00:00
|
|
|
Regex: "foobar",
|
|
|
|
Replacement: "foobar",
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Middleware16": {
|
2019-07-10 07:26:04 +00:00
|
|
|
Retry: &dynamic.Retry{
|
2020-11-05 15:14:04 +00:00
|
|
|
Attempts: 42,
|
|
|
|
InitialInterval: ptypes.Duration(time.Second),
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Middleware17": {
|
2019-07-10 07:26:04 +00:00
|
|
|
StripPrefix: &dynamic.StripPrefix{
|
2019-04-15 16:22:07 +00:00
|
|
|
Prefixes: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Middleware18": {
|
2019-07-10 07:26:04 +00:00
|
|
|
StripPrefixRegex: &dynamic.StripPrefixRegex{
|
2019-04-15 16:22:07 +00:00
|
|
|
Regex: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Middleware19": {
|
2021-09-20 16:00:08 +00:00
|
|
|
Compress: &dynamic.Compress{
|
|
|
|
MinResponseBodyBytes: 42,
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Middleware2": {
|
2019-07-10 07:26:04 +00:00
|
|
|
Buffering: &dynamic.Buffering{
|
2019-04-15 16:22:07 +00:00
|
|
|
MaxRequestBodyBytes: 42,
|
|
|
|
MemRequestBodyBytes: 42,
|
|
|
|
MaxResponseBodyBytes: 42,
|
|
|
|
MemResponseBodyBytes: 42,
|
|
|
|
RetryExpression: "foobar",
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Middleware3": {
|
2019-07-10 07:26:04 +00:00
|
|
|
Chain: &dynamic.Chain{
|
2019-04-15 16:22:07 +00:00
|
|
|
Middlewares: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Middleware4": {
|
2019-07-10 07:26:04 +00:00
|
|
|
CircuitBreaker: &dynamic.CircuitBreaker{
|
2022-04-05 10:30:08 +00:00
|
|
|
Expression: "foobar",
|
|
|
|
CheckPeriod: ptypes.Duration(time.Second),
|
|
|
|
FallbackDuration: ptypes.Duration(time.Second),
|
|
|
|
RecoveryDuration: ptypes.Duration(time.Second),
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Middleware5": {
|
2019-07-10 07:26:04 +00:00
|
|
|
DigestAuth: &dynamic.DigestAuth{
|
2019-04-15 16:22:07 +00:00
|
|
|
Users: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
UsersFile: "foobar",
|
|
|
|
RemoveHeader: true,
|
|
|
|
Realm: "foobar",
|
|
|
|
HeaderField: "foobar",
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Middleware6": {
|
2019-07-10 07:26:04 +00:00
|
|
|
Errors: &dynamic.ErrorPage{
|
2019-04-15 16:22:07 +00:00
|
|
|
Status: []string{
|
2018-12-04 13:24:04 +00:00
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
Service: "foobar",
|
|
|
|
Query: "foobar",
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
"Middleware7": {
|
2019-07-10 07:26:04 +00:00
|
|
|
ForwardAuth: &dynamic.ForwardAuth{
|
2019-04-15 16:22:07 +00:00
|
|
|
Address: "foobar",
|
2021-10-26 08:54:11 +00:00
|
|
|
TLS: &types.ClientTLS{
|
2019-04-15 16:22:07 +00:00
|
|
|
CA: "foobar",
|
|
|
|
Cert: "foobar",
|
|
|
|
Key: "foobar",
|
|
|
|
InsecureSkipVerify: true,
|
|
|
|
},
|
|
|
|
TrustForwardHeader: true,
|
|
|
|
AuthResponseHeaders: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2020-10-07 14:36:04 +00:00
|
|
|
AuthRequestHeaders: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
|
|
|
"Middleware8": {
|
2019-07-10 07:26:04 +00:00
|
|
|
Headers: &dynamic.Headers{
|
2019-04-15 16:22:07 +00:00
|
|
|
CustomRequestHeaders: map[string]string{
|
|
|
|
"name0": "foobar",
|
|
|
|
"name1": "foobar",
|
|
|
|
},
|
|
|
|
CustomResponseHeaders: map[string]string{
|
|
|
|
"name0": "foobar",
|
|
|
|
"name1": "foobar",
|
|
|
|
},
|
|
|
|
AccessControlAllowCredentials: true,
|
|
|
|
AccessControlAllowHeaders: []string{
|
|
|
|
"X-foobar",
|
|
|
|
"X-fiibar",
|
|
|
|
},
|
|
|
|
AccessControlAllowMethods: []string{
|
|
|
|
"GET",
|
|
|
|
"PUT",
|
|
|
|
},
|
2020-03-05 07:18:04 +00:00
|
|
|
AccessControlAllowOriginList: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2020-10-29 09:52:03 +00:00
|
|
|
AccessControlAllowOriginListRegex: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
AccessControlExposeHeaders: []string{
|
|
|
|
"X-foobar",
|
|
|
|
"X-fiibar",
|
|
|
|
},
|
|
|
|
AccessControlMaxAge: 200,
|
|
|
|
AddVaryHeader: true,
|
|
|
|
AllowedHosts: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
HostsProxyHeaders: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
SSLProxyHeaders: map[string]string{
|
2018-12-04 13:24:04 +00:00
|
|
|
"name0": "foobar",
|
|
|
|
"name1": "foobar",
|
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
STSSeconds: 42,
|
|
|
|
STSIncludeSubdomains: true,
|
|
|
|
STSPreload: true,
|
|
|
|
ForceSTSHeader: true,
|
|
|
|
FrameDeny: true,
|
|
|
|
CustomFrameOptionsValue: "foobar",
|
|
|
|
ContentTypeNosniff: true,
|
|
|
|
BrowserXSSFilter: true,
|
|
|
|
CustomBrowserXSSValue: "foobar",
|
|
|
|
ContentSecurityPolicy: "foobar",
|
|
|
|
PublicKey: "foobar",
|
|
|
|
ReferrerPolicy: "foobar",
|
2021-06-21 13:16:13 +00:00
|
|
|
PermissionsPolicy: "foobar",
|
2019-04-15 16:22:07 +00:00
|
|
|
IsDevelopment: true,
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
|
|
|
"Middleware9": {
|
2022-10-26 15:16:05 +00:00
|
|
|
IPAllowList: &dynamic.IPAllowList{
|
2019-04-15 16:22:07 +00:00
|
|
|
SourceRange: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2019-07-10 07:26:04 +00:00
|
|
|
IPStrategy: &dynamic.IPStrategy{
|
2019-04-15 16:22:07 +00:00
|
|
|
Depth: 42,
|
|
|
|
ExcludedIPs: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
2020-07-12 10:56:22 +00:00
|
|
|
"Middleware20": {
|
|
|
|
Plugin: map[string]dynamic.PluginConf{
|
|
|
|
"tomato": {
|
|
|
|
"aaa": "foo1",
|
|
|
|
"bbb": "foo2",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-07-10 07:26:04 +00:00
|
|
|
Services: map[string]*dynamic.Service{
|
2019-04-15 16:22:07 +00:00
|
|
|
"Service0": {
|
2019-08-26 08:30:05 +00:00
|
|
|
LoadBalancer: &dynamic.ServersLoadBalancer{
|
|
|
|
Sticky: &dynamic.Sticky{
|
|
|
|
Cookie: &dynamic.Cookie{
|
|
|
|
Name: "foobar",
|
|
|
|
Secure: true,
|
|
|
|
HTTPOnly: false,
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-07-10 07:26:04 +00:00
|
|
|
Servers: []dynamic.Server{
|
2019-04-15 16:22:07 +00:00
|
|
|
{
|
|
|
|
Scheme: "foobar",
|
|
|
|
Port: "8080",
|
|
|
|
},
|
|
|
|
},
|
2021-06-25 19:08:11 +00:00
|
|
|
HealthCheck: &dynamic.ServerHealthCheck{
|
2019-04-15 16:22:07 +00:00
|
|
|
Scheme: "foobar",
|
2022-09-20 14:54:08 +00:00
|
|
|
Mode: "foobar",
|
2019-04-15 16:22:07 +00:00
|
|
|
Path: "foobar",
|
2022-08-08 13:22:07 +00:00
|
|
|
Method: "foobar",
|
2022-11-24 10:40:05 +00:00
|
|
|
Status: 401,
|
2019-04-15 16:22:07 +00:00
|
|
|
Port: 42,
|
2022-11-16 10:38:07 +00:00
|
|
|
Interval: ptypes.Duration(time.Second),
|
|
|
|
Timeout: ptypes.Duration(time.Second),
|
2019-04-15 16:22:07 +00:00
|
|
|
Hostname: "foobar",
|
|
|
|
Headers: map[string]string{
|
|
|
|
"name0": "foobar",
|
|
|
|
"name1": "foobar",
|
|
|
|
},
|
2020-02-26 16:28:04 +00:00
|
|
|
FollowRedirects: func(v bool) *bool { return &v }(true),
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
2019-09-30 16:12:04 +00:00
|
|
|
PassHostHeader: func(v bool) *bool { return &v }(true),
|
2019-07-10 07:26:04 +00:00
|
|
|
ResponseForwarding: &dynamic.ResponseForwarding{
|
2022-11-16 10:38:07 +00:00
|
|
|
FlushInterval: ptypes.Duration(time.Second),
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2022-12-09 08:58:05 +00:00
|
|
|
ServersTransport: "foobar",
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
|
|
|
"Service1": {
|
2019-08-26 08:30:05 +00:00
|
|
|
LoadBalancer: &dynamic.ServersLoadBalancer{
|
2019-07-10 07:26:04 +00:00
|
|
|
Servers: []dynamic.Server{
|
2019-04-15 16:22:07 +00:00
|
|
|
{
|
|
|
|
Scheme: "foobar",
|
|
|
|
Port: "8080",
|
|
|
|
},
|
|
|
|
},
|
2021-06-25 19:08:11 +00:00
|
|
|
HealthCheck: &dynamic.ServerHealthCheck{
|
2019-04-15 16:22:07 +00:00
|
|
|
Scheme: "foobar",
|
2022-09-20 14:54:08 +00:00
|
|
|
Mode: "foobar",
|
2019-04-15 16:22:07 +00:00
|
|
|
Path: "foobar",
|
2022-08-08 13:22:07 +00:00
|
|
|
Method: "foobar",
|
2022-11-24 10:40:05 +00:00
|
|
|
Status: 401,
|
2019-04-15 16:22:07 +00:00
|
|
|
Port: 42,
|
2022-11-16 10:38:07 +00:00
|
|
|
Interval: ptypes.Duration(time.Second),
|
|
|
|
Timeout: ptypes.Duration(time.Second),
|
2019-04-15 16:22:07 +00:00
|
|
|
Hostname: "foobar",
|
|
|
|
Headers: map[string]string{
|
|
|
|
"name0": "foobar",
|
|
|
|
"name1": "foobar",
|
|
|
|
},
|
2020-02-26 16:28:04 +00:00
|
|
|
FollowRedirects: func(v bool) *bool { return &v }(true),
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
2019-09-30 16:12:04 +00:00
|
|
|
PassHostHeader: func(v bool) *bool { return &v }(true),
|
2019-07-10 07:26:04 +00:00
|
|
|
ResponseForwarding: &dynamic.ResponseForwarding{
|
2022-11-16 10:38:07 +00:00
|
|
|
FlushInterval: ptypes.Duration(time.Second),
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
2022-12-09 08:58:05 +00:00
|
|
|
ServersTransport: "foobar",
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2021-07-15 12:02:11 +00:00
|
|
|
assert.Nil(t, configuration.HTTP.ServersTransports)
|
2022-12-09 08:58:05 +00:00
|
|
|
assert.Nil(t, configuration.TCP.ServersTransports)
|
2019-04-15 16:22:07 +00:00
|
|
|
assert.Equal(t, expected, configuration)
|
2018-12-04 13:24:04 +00:00
|
|
|
}
|
|
|
|
|
2019-01-18 14:18:04 +00:00
|
|
|
func TestEncodeConfiguration(t *testing.T) {
|
2019-07-10 07:26:04 +00:00
|
|
|
configuration := &dynamic.Configuration{
|
|
|
|
TCP: &dynamic.TCPConfiguration{
|
|
|
|
Routers: map[string]*dynamic.TCPRouter{
|
2019-04-15 16:22:07 +00:00
|
|
|
"Router0": {
|
|
|
|
EntryPoints: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2022-03-17 17:02:08 +00:00
|
|
|
Service: "foobar",
|
|
|
|
Rule: "foobar",
|
|
|
|
Priority: 42,
|
2019-07-10 07:26:04 +00:00
|
|
|
TLS: &dynamic.RouterTCPTLSConfig{
|
2019-04-15 16:22:07 +00:00
|
|
|
Passthrough: false,
|
2019-06-17 16:14:08 +00:00
|
|
|
Options: "foo",
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
"Router1": {
|
|
|
|
EntryPoints: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2022-03-17 17:02:08 +00:00
|
|
|
Service: "foobar",
|
|
|
|
Rule: "foobar",
|
|
|
|
Priority: 42,
|
2019-07-10 07:26:04 +00:00
|
|
|
TLS: &dynamic.RouterTCPTLSConfig{
|
2019-04-15 16:22:07 +00:00
|
|
|
Passthrough: false,
|
2019-06-17 16:14:08 +00:00
|
|
|
Options: "foo",
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2021-06-11 13:30:05 +00:00
|
|
|
Middlewares: map[string]*dynamic.TCPMiddleware{
|
|
|
|
"Middleware0": {
|
2022-10-26 15:16:05 +00:00
|
|
|
IPAllowList: &dynamic.TCPIPAllowList{
|
2021-06-11 13:30:05 +00:00
|
|
|
SourceRange: []string{"foobar", "fiibar"},
|
|
|
|
},
|
|
|
|
},
|
2021-11-29 16:12:06 +00:00
|
|
|
"Middleware2": {
|
|
|
|
InFlightConn: &dynamic.TCPInFlightConn{
|
|
|
|
Amount: 42,
|
|
|
|
},
|
|
|
|
},
|
2021-06-11 13:30:05 +00:00
|
|
|
},
|
2019-07-10 07:26:04 +00:00
|
|
|
Services: map[string]*dynamic.TCPService{
|
2019-04-15 16:22:07 +00:00
|
|
|
"Service0": {
|
2019-09-13 18:00:06 +00:00
|
|
|
LoadBalancer: &dynamic.TCPServersLoadBalancer{
|
2019-07-10 07:26:04 +00:00
|
|
|
Servers: []dynamic.TCPServer{
|
2019-04-15 16:22:07 +00:00
|
|
|
{
|
2019-06-05 20:18:06 +00:00
|
|
|
Port: "42",
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
|
|
|
},
|
2022-12-09 08:58:05 +00:00
|
|
|
ServersTransport: "foo",
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
"Service1": {
|
2019-09-13 18:00:06 +00:00
|
|
|
LoadBalancer: &dynamic.TCPServersLoadBalancer{
|
2019-07-10 07:26:04 +00:00
|
|
|
Servers: []dynamic.TCPServer{
|
2019-04-15 16:22:07 +00:00
|
|
|
{
|
2019-06-05 20:18:06 +00:00
|
|
|
Port: "42",
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
|
|
|
},
|
2022-12-09 08:58:05 +00:00
|
|
|
ServersTransport: "foo",
|
2020-02-20 21:24:05 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
UDP: &dynamic.UDPConfiguration{
|
|
|
|
Routers: map[string]*dynamic.UDPRouter{
|
|
|
|
"Router0": {
|
|
|
|
EntryPoints: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
Service: "foobar",
|
|
|
|
},
|
|
|
|
"Router1": {
|
|
|
|
EntryPoints: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
Service: "foobar",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Services: map[string]*dynamic.UDPService{
|
|
|
|
"Service0": {
|
|
|
|
LoadBalancer: &dynamic.UDPServersLoadBalancer{
|
|
|
|
Servers: []dynamic.UDPServer{
|
|
|
|
{
|
|
|
|
Port: "42",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"Service1": {
|
|
|
|
LoadBalancer: &dynamic.UDPServersLoadBalancer{
|
|
|
|
Servers: []dynamic.UDPServer{
|
|
|
|
{
|
|
|
|
Port: "42",
|
|
|
|
},
|
|
|
|
},
|
2019-04-15 16:22:07 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2019-07-10 07:26:04 +00:00
|
|
|
HTTP: &dynamic.HTTPConfiguration{
|
|
|
|
Routers: map[string]*dynamic.Router{
|
2019-03-14 08:30:04 +00:00
|
|
|
"Router0": {
|
|
|
|
EntryPoints: []string{
|
2018-12-04 13:24:04 +00:00
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
Middlewares: []string{
|
2018-12-04 13:24:04 +00:00
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
Service: "foobar",
|
|
|
|
Rule: "foobar",
|
|
|
|
Priority: 42,
|
2019-07-10 07:26:04 +00:00
|
|
|
TLS: &dynamic.RouterTLSConfig{},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
"Router1": {
|
|
|
|
EntryPoints: []string{
|
2018-12-04 13:24:04 +00:00
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
Middlewares: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
Service: "foobar",
|
|
|
|
Rule: "foobar",
|
|
|
|
Priority: 42,
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
2019-07-10 07:26:04 +00:00
|
|
|
Middlewares: map[string]*dynamic.Middleware{
|
2019-03-14 08:30:04 +00:00
|
|
|
"Middleware0": {
|
2019-07-10 07:26:04 +00:00
|
|
|
AddPrefix: &dynamic.AddPrefix{
|
2019-03-14 08:30:04 +00:00
|
|
|
Prefix: "foobar",
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
"Middleware1": {
|
2019-07-10 07:26:04 +00:00
|
|
|
BasicAuth: &dynamic.BasicAuth{
|
2019-03-14 08:30:04 +00:00
|
|
|
Users: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
UsersFile: "foobar",
|
|
|
|
Realm: "foobar",
|
|
|
|
RemoveHeader: true,
|
|
|
|
HeaderField: "foobar",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"Middleware10": {
|
2019-08-26 10:20:06 +00:00
|
|
|
InFlightReq: &dynamic.InFlightReq{
|
|
|
|
Amount: 42,
|
|
|
|
SourceCriterion: &dynamic.SourceCriterion{
|
|
|
|
IPStrategy: &dynamic.IPStrategy{
|
|
|
|
Depth: 42,
|
|
|
|
ExcludedIPs: []string{"foobar", "fiibar"},
|
|
|
|
},
|
|
|
|
RequestHeaderName: "foobar",
|
|
|
|
RequestHost: true,
|
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
"Middleware11": {
|
2019-07-10 07:26:04 +00:00
|
|
|
PassTLSClientCert: &dynamic.PassTLSClientCert{
|
2019-03-14 08:30:04 +00:00
|
|
|
PEM: true,
|
2019-07-10 07:26:04 +00:00
|
|
|
Info: &dynamic.TLSClientCertificateInfo{
|
2019-12-11 23:32:03 +00:00
|
|
|
NotAfter: true,
|
|
|
|
NotBefore: true,
|
|
|
|
SerialNumber: true,
|
2021-11-08 21:41:43 +00:00
|
|
|
Subject: &dynamic.TLSClientCertificateSubjectDNInfo{
|
2021-07-28 15:42:09 +00:00
|
|
|
Country: true,
|
|
|
|
Province: true,
|
|
|
|
Locality: true,
|
|
|
|
Organization: true,
|
|
|
|
OrganizationalUnit: true,
|
|
|
|
CommonName: true,
|
|
|
|
SerialNumber: true,
|
|
|
|
DomainComponent: true,
|
2019-03-14 08:30:04 +00:00
|
|
|
},
|
2021-11-08 21:41:43 +00:00
|
|
|
Issuer: &dynamic.TLSClientCertificateIssuerDNInfo{
|
2019-03-14 08:30:04 +00:00
|
|
|
Country: true,
|
|
|
|
Province: true,
|
|
|
|
Locality: true,
|
|
|
|
Organization: true,
|
|
|
|
CommonName: true,
|
|
|
|
SerialNumber: true,
|
|
|
|
DomainComponent: true,
|
|
|
|
}, Sans: true,
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
2019-08-26 10:20:06 +00:00
|
|
|
"Middleware12": {
|
|
|
|
RateLimit: &dynamic.RateLimit{
|
|
|
|
Average: 42,
|
|
|
|
Burst: 42,
|
2020-08-17 16:04:03 +00:00
|
|
|
Period: ptypes.Duration(time.Second),
|
2019-08-26 10:20:06 +00:00
|
|
|
SourceCriterion: &dynamic.SourceCriterion{
|
|
|
|
IPStrategy: &dynamic.IPStrategy{
|
|
|
|
Depth: 42,
|
|
|
|
ExcludedIPs: []string{"foobar", "foobar"},
|
|
|
|
},
|
|
|
|
RequestHeaderName: "foobar",
|
|
|
|
RequestHost: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
"Middleware13": {
|
2019-07-10 07:26:04 +00:00
|
|
|
RedirectRegex: &dynamic.RedirectRegex{
|
2019-03-14 08:30:04 +00:00
|
|
|
Regex: "foobar",
|
|
|
|
Replacement: "foobar",
|
|
|
|
Permanent: true,
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
},
|
|
|
|
"Middleware13b": {
|
2019-07-10 07:26:04 +00:00
|
|
|
RedirectScheme: &dynamic.RedirectScheme{
|
2019-03-14 08:30:04 +00:00
|
|
|
Scheme: "https",
|
|
|
|
Port: "80",
|
|
|
|
Permanent: true,
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
"Middleware14": {
|
2019-07-10 07:26:04 +00:00
|
|
|
ReplacePath: &dynamic.ReplacePath{
|
2019-03-14 08:30:04 +00:00
|
|
|
Path: "foobar",
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
},
|
|
|
|
"Middleware15": {
|
2019-07-10 07:26:04 +00:00
|
|
|
ReplacePathRegex: &dynamic.ReplacePathRegex{
|
2019-03-14 08:30:04 +00:00
|
|
|
Regex: "foobar",
|
|
|
|
Replacement: "foobar",
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
},
|
|
|
|
"Middleware16": {
|
2019-07-10 07:26:04 +00:00
|
|
|
Retry: &dynamic.Retry{
|
2020-11-05 15:14:04 +00:00
|
|
|
Attempts: 42,
|
|
|
|
InitialInterval: ptypes.Duration(time.Second),
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
},
|
|
|
|
"Middleware17": {
|
2019-07-10 07:26:04 +00:00
|
|
|
StripPrefix: &dynamic.StripPrefix{
|
2019-03-14 08:30:04 +00:00
|
|
|
Prefixes: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
},
|
|
|
|
"Middleware18": {
|
2019-07-10 07:26:04 +00:00
|
|
|
StripPrefixRegex: &dynamic.StripPrefixRegex{
|
2019-03-14 08:30:04 +00:00
|
|
|
Regex: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
"Middleware19": {
|
2021-09-20 16:00:08 +00:00
|
|
|
Compress: &dynamic.Compress{
|
|
|
|
MinResponseBodyBytes: 42,
|
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
},
|
|
|
|
"Middleware2": {
|
2019-07-10 07:26:04 +00:00
|
|
|
Buffering: &dynamic.Buffering{
|
2019-03-14 08:30:04 +00:00
|
|
|
MaxRequestBodyBytes: 42,
|
|
|
|
MemRequestBodyBytes: 42,
|
|
|
|
MaxResponseBodyBytes: 42,
|
|
|
|
MemResponseBodyBytes: 42,
|
|
|
|
RetryExpression: "foobar",
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
},
|
2020-07-12 10:56:22 +00:00
|
|
|
"Middleware20": {
|
|
|
|
Plugin: map[string]dynamic.PluginConf{
|
|
|
|
"tomato": {
|
|
|
|
"aaa": "foo1",
|
|
|
|
"bbb": "foo2",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
"Middleware3": {
|
2019-07-10 07:26:04 +00:00
|
|
|
Chain: &dynamic.Chain{
|
2019-03-14 08:30:04 +00:00
|
|
|
Middlewares: []string{
|
2018-12-04 13:24:04 +00:00
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
"Middleware4": {
|
2019-07-10 07:26:04 +00:00
|
|
|
CircuitBreaker: &dynamic.CircuitBreaker{
|
2022-04-05 10:30:08 +00:00
|
|
|
Expression: "foobar",
|
|
|
|
CheckPeriod: ptypes.Duration(time.Second),
|
|
|
|
FallbackDuration: ptypes.Duration(time.Second),
|
|
|
|
RecoveryDuration: ptypes.Duration(time.Second),
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
},
|
|
|
|
"Middleware5": {
|
2019-07-10 07:26:04 +00:00
|
|
|
DigestAuth: &dynamic.DigestAuth{
|
2019-03-14 08:30:04 +00:00
|
|
|
Users: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
UsersFile: "foobar",
|
|
|
|
RemoveHeader: true,
|
|
|
|
Realm: "foobar",
|
|
|
|
HeaderField: "foobar",
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
},
|
|
|
|
"Middleware6": {
|
2019-07-10 07:26:04 +00:00
|
|
|
Errors: &dynamic.ErrorPage{
|
2019-03-14 08:30:04 +00:00
|
|
|
Status: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
Service: "foobar",
|
|
|
|
Query: "foobar",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"Middleware7": {
|
2019-07-10 07:26:04 +00:00
|
|
|
ForwardAuth: &dynamic.ForwardAuth{
|
2019-03-14 08:30:04 +00:00
|
|
|
Address: "foobar",
|
2021-10-26 08:54:11 +00:00
|
|
|
TLS: &types.ClientTLS{
|
2019-03-14 08:30:04 +00:00
|
|
|
CA: "foobar",
|
|
|
|
Cert: "foobar",
|
|
|
|
Key: "foobar",
|
|
|
|
InsecureSkipVerify: true,
|
|
|
|
},
|
|
|
|
TrustForwardHeader: true,
|
|
|
|
AuthResponseHeaders: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2020-10-07 14:36:04 +00:00
|
|
|
AuthRequestHeaders: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
"Middleware8": {
|
2019-07-10 07:26:04 +00:00
|
|
|
Headers: &dynamic.Headers{
|
2019-03-14 08:30:04 +00:00
|
|
|
CustomRequestHeaders: map[string]string{
|
2018-12-04 13:24:04 +00:00
|
|
|
"name0": "foobar",
|
|
|
|
"name1": "foobar",
|
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
CustomResponseHeaders: map[string]string{
|
|
|
|
"name0": "foobar",
|
|
|
|
"name1": "foobar",
|
|
|
|
},
|
2019-04-02 08:40:04 +00:00
|
|
|
AccessControlAllowCredentials: true,
|
|
|
|
AccessControlAllowHeaders: []string{
|
|
|
|
"X-foobar",
|
|
|
|
"X-fiibar",
|
|
|
|
},
|
|
|
|
AccessControlAllowMethods: []string{
|
|
|
|
"GET",
|
|
|
|
"PUT",
|
|
|
|
},
|
2020-03-05 07:18:04 +00:00
|
|
|
AccessControlAllowOriginList: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2020-10-29 09:52:03 +00:00
|
|
|
AccessControlAllowOriginListRegex: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2019-04-02 08:40:04 +00:00
|
|
|
AccessControlExposeHeaders: []string{
|
|
|
|
"X-foobar",
|
|
|
|
"X-fiibar",
|
|
|
|
},
|
|
|
|
AccessControlMaxAge: 200,
|
|
|
|
AddVaryHeader: true,
|
2019-03-14 08:30:04 +00:00
|
|
|
AllowedHosts: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
HostsProxyHeaders: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
SSLProxyHeaders: map[string]string{
|
|
|
|
"name0": "foobar",
|
|
|
|
"name1": "foobar",
|
|
|
|
},
|
|
|
|
STSSeconds: 42,
|
|
|
|
STSIncludeSubdomains: true,
|
|
|
|
STSPreload: true,
|
|
|
|
ForceSTSHeader: true,
|
|
|
|
FrameDeny: true,
|
|
|
|
CustomFrameOptionsValue: "foobar",
|
|
|
|
ContentTypeNosniff: true,
|
|
|
|
BrowserXSSFilter: true,
|
|
|
|
CustomBrowserXSSValue: "foobar",
|
|
|
|
ContentSecurityPolicy: "foobar",
|
|
|
|
PublicKey: "foobar",
|
|
|
|
ReferrerPolicy: "foobar",
|
2021-06-21 13:16:13 +00:00
|
|
|
PermissionsPolicy: "foobar",
|
2019-03-14 08:30:04 +00:00
|
|
|
IsDevelopment: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"Middleware9": {
|
2022-10-26 15:16:05 +00:00
|
|
|
IPAllowList: &dynamic.IPAllowList{
|
2019-03-14 08:30:04 +00:00
|
|
|
SourceRange: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
2019-07-10 07:26:04 +00:00
|
|
|
IPStrategy: &dynamic.IPStrategy{
|
2019-03-14 08:30:04 +00:00
|
|
|
Depth: 42,
|
|
|
|
ExcludedIPs: []string{
|
|
|
|
"foobar",
|
|
|
|
"fiibar",
|
|
|
|
},
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2019-07-10 07:26:04 +00:00
|
|
|
Services: map[string]*dynamic.Service{
|
2019-03-14 08:30:04 +00:00
|
|
|
"Service0": {
|
2019-08-26 08:30:05 +00:00
|
|
|
LoadBalancer: &dynamic.ServersLoadBalancer{
|
|
|
|
Sticky: &dynamic.Sticky{
|
|
|
|
Cookie: &dynamic.Cookie{
|
|
|
|
Name: "foobar",
|
|
|
|
HTTPOnly: true,
|
|
|
|
},
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-07-10 07:26:04 +00:00
|
|
|
Servers: []dynamic.Server{
|
2019-03-14 08:30:04 +00:00
|
|
|
{
|
|
|
|
Scheme: "foobar",
|
|
|
|
Port: "8080",
|
|
|
|
},
|
|
|
|
},
|
2021-06-25 19:08:11 +00:00
|
|
|
HealthCheck: &dynamic.ServerHealthCheck{
|
2019-03-14 08:30:04 +00:00
|
|
|
Scheme: "foobar",
|
|
|
|
Path: "foobar",
|
2022-08-08 13:22:07 +00:00
|
|
|
Method: "foobar",
|
2022-11-24 10:40:05 +00:00
|
|
|
Status: 401,
|
2019-03-14 08:30:04 +00:00
|
|
|
Port: 42,
|
2022-11-16 10:38:07 +00:00
|
|
|
Interval: ptypes.Duration(time.Second),
|
|
|
|
Timeout: ptypes.Duration(time.Second),
|
2019-03-14 08:30:04 +00:00
|
|
|
Hostname: "foobar",
|
|
|
|
Headers: map[string]string{
|
|
|
|
"name0": "foobar",
|
|
|
|
"name1": "foobar",
|
|
|
|
},
|
|
|
|
},
|
2019-09-30 16:12:04 +00:00
|
|
|
PassHostHeader: func(v bool) *bool { return &v }(true),
|
2019-07-10 07:26:04 +00:00
|
|
|
ResponseForwarding: &dynamic.ResponseForwarding{
|
2022-11-16 10:38:07 +00:00
|
|
|
FlushInterval: ptypes.Duration(time.Second),
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2022-12-09 08:58:05 +00:00
|
|
|
ServersTransport: "foobar",
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
2019-03-14 08:30:04 +00:00
|
|
|
},
|
|
|
|
"Service1": {
|
2019-08-26 08:30:05 +00:00
|
|
|
LoadBalancer: &dynamic.ServersLoadBalancer{
|
2019-07-10 07:26:04 +00:00
|
|
|
Servers: []dynamic.Server{
|
2019-03-14 08:30:04 +00:00
|
|
|
{
|
|
|
|
Scheme: "foobar",
|
|
|
|
Port: "8080",
|
|
|
|
},
|
|
|
|
},
|
2021-06-25 19:08:11 +00:00
|
|
|
HealthCheck: &dynamic.ServerHealthCheck{
|
2019-03-14 08:30:04 +00:00
|
|
|
Scheme: "foobar",
|
|
|
|
Path: "foobar",
|
2022-08-08 13:22:07 +00:00
|
|
|
Method: "foobar",
|
2022-11-24 10:40:05 +00:00
|
|
|
Status: 401,
|
2019-03-14 08:30:04 +00:00
|
|
|
Port: 42,
|
2022-11-16 10:38:07 +00:00
|
|
|
Interval: ptypes.Duration(time.Second),
|
|
|
|
Timeout: ptypes.Duration(time.Second),
|
2019-03-14 08:30:04 +00:00
|
|
|
Hostname: "foobar",
|
|
|
|
Headers: map[string]string{
|
|
|
|
"name0": "foobar",
|
|
|
|
"name1": "foobar",
|
|
|
|
},
|
|
|
|
},
|
2019-09-30 16:12:04 +00:00
|
|
|
PassHostHeader: func(v bool) *bool { return &v }(true),
|
2019-07-10 07:26:04 +00:00
|
|
|
ResponseForwarding: &dynamic.ResponseForwarding{
|
2022-11-16 10:38:07 +00:00
|
|
|
FlushInterval: ptypes.Duration(time.Second),
|
2019-03-14 08:30:04 +00:00
|
|
|
},
|
2022-12-09 08:58:05 +00:00
|
|
|
ServersTransport: "foobar",
|
2018-12-04 13:24:04 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2019-01-18 14:18:04 +00:00
|
|
|
labels, err := EncodeConfiguration(configuration)
|
2018-12-04 13:24:04 +00:00
|
|
|
require.NoError(t, err)
|
|
|
|
|
|
|
|
expected := map[string]string{
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware0.AddPrefix.Prefix": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware1.BasicAuth.HeaderField": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware1.BasicAuth.Realm": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware1.BasicAuth.RemoveHeader": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware1.BasicAuth.Users": "foobar, fiibar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware1.BasicAuth.UsersFile": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware2.Buffering.MaxRequestBodyBytes": "42",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware2.Buffering.MaxResponseBodyBytes": "42",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware2.Buffering.MemRequestBodyBytes": "42",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware2.Buffering.MemResponseBodyBytes": "42",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware2.Buffering.RetryExpression": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware3.Chain.Middlewares": "foobar, fiibar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware4.CircuitBreaker.Expression": "foobar",
|
2022-04-05 10:30:08 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware4.CircuitBreaker.CheckPeriod": "1000000000",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware4.CircuitBreaker.FallbackDuration": "1000000000",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware4.CircuitBreaker.RecoveryDuration": "1000000000",
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware5.DigestAuth.HeaderField": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware5.DigestAuth.Realm": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware5.DigestAuth.RemoveHeader": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware5.DigestAuth.Users": "foobar, fiibar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware5.DigestAuth.UsersFile": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware6.Errors.Query": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware6.Errors.Service": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware6.Errors.Status": "foobar, fiibar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware7.ForwardAuth.Address": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware7.ForwardAuth.AuthResponseHeaders": "foobar, fiibar",
|
2020-10-07 14:36:04 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware7.ForwardAuth.AuthRequestHeaders": "foobar, fiibar",
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware7.ForwardAuth.TLS.CA": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware7.ForwardAuth.TLS.Cert": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware7.ForwardAuth.TLS.InsecureSkipVerify": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware7.ForwardAuth.TLS.Key": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware7.ForwardAuth.TrustForwardHeader": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.AccessControlAllowCredentials": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.AccessControlAllowHeaders": "X-foobar, X-fiibar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.AccessControlAllowMethods": "GET, PUT",
|
2020-03-05 07:18:04 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.AccessControlAllowOriginList": "foobar, fiibar",
|
2020-10-29 09:52:03 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.AccessControlAllowOriginListRegex": "foobar, fiibar",
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.AccessControlExposeHeaders": "X-foobar, X-fiibar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.AccessControlMaxAge": "200",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.AddVaryHeader": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.AllowedHosts": "foobar, fiibar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.BrowserXSSFilter": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.ContentSecurityPolicy": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.ContentTypeNosniff": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.CustomBrowserXSSValue": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.CustomFrameOptionsValue": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.CustomRequestHeaders.name0": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.CustomRequestHeaders.name1": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.CustomResponseHeaders.name0": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.CustomResponseHeaders.name1": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.ForceSTSHeader": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.FrameDeny": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.HostsProxyHeaders": "foobar, fiibar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.IsDevelopment": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.PublicKey": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.ReferrerPolicy": "foobar",
|
2021-06-21 13:16:13 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.PermissionsPolicy": "foobar",
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.SSLProxyHeaders.name0": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.SSLProxyHeaders.name1": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.STSIncludeSubdomains": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.STSPreload": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware8.Headers.STSSeconds": "42",
|
2022-10-26 15:16:05 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware9.IPAllowList.IPStrategy.Depth": "42",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware9.IPAllowList.IPStrategy.ExcludedIPs": "foobar, fiibar",
|
2024-01-09 19:26:05 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware9.IPAllowList.RejectStatusCode": "0",
|
2022-10-26 15:16:05 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware9.IPAllowList.SourceRange": "foobar, fiibar",
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware10.InFlightReq.Amount": "42",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware10.InFlightReq.SourceCriterion.IPStrategy.Depth": "42",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware10.InFlightReq.SourceCriterion.IPStrategy.ExcludedIPs": "foobar, fiibar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware10.InFlightReq.SourceCriterion.RequestHeaderName": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware10.InFlightReq.SourceCriterion.RequestHost": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.NotAfter": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.NotBefore": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Sans": "true",
|
2019-12-11 23:32:03 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.SerialNumber": "true",
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Subject.Country": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Subject.Province": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Subject.Locality": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Subject.Organization": "true",
|
2021-07-28 15:42:09 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Subject.OrganizationalUnit": "true",
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Subject.CommonName": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Subject.SerialNumber": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Subject.DomainComponent": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Issuer.Country": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Issuer.Province": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Issuer.Locality": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Issuer.Organization": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Issuer.CommonName": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Issuer.SerialNumber": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.Info.Issuer.DomainComponent": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware11.PassTLSClientCert.PEM": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware12.RateLimit.Average": "42",
|
2020-01-08 10:44:04 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware12.RateLimit.Period": "1000000000",
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware12.RateLimit.Burst": "42",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware12.RateLimit.SourceCriterion.RequestHeaderName": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware12.RateLimit.SourceCriterion.RequestHost": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware12.RateLimit.SourceCriterion.IPStrategy.Depth": "42",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware12.RateLimit.SourceCriterion.IPStrategy.ExcludedIPs": "foobar, foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware13.RedirectRegex.Regex": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware13.RedirectRegex.Replacement": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware13.RedirectRegex.Permanent": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware13b.RedirectScheme.Scheme": "https",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware13b.RedirectScheme.Port": "80",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware13b.RedirectScheme.Permanent": "true",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware14.ReplacePath.Path": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware15.ReplacePathRegex.Regex": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware15.ReplacePathRegex.Replacement": "foobar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware16.Retry.Attempts": "42",
|
2020-11-05 15:14:04 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware16.Retry.InitialInterval": "1000000000",
|
2019-08-26 10:20:06 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware17.StripPrefix.Prefixes": "foobar, fiibar",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware18.StripPrefixRegex.Regex": "foobar, fiibar",
|
2021-09-20 16:00:08 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware19.Compress.MinResponseBodyBytes": "42",
|
2020-07-12 10:56:22 +00:00
|
|
|
"traefik.HTTP.Middlewares.Middleware20.Plugin.tomato.aaa": "foo1",
|
|
|
|
"traefik.HTTP.Middlewares.Middleware20.Plugin.tomato.bbb": "foo2",
|
2018-12-04 13:24:04 +00:00
|
|
|
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.HTTP.Routers.Router0.EntryPoints": "foobar, fiibar",
|
|
|
|
"traefik.HTTP.Routers.Router0.Middlewares": "foobar, fiibar",
|
|
|
|
"traefik.HTTP.Routers.Router0.Priority": "42",
|
|
|
|
"traefik.HTTP.Routers.Router0.Rule": "foobar",
|
|
|
|
"traefik.HTTP.Routers.Router0.Service": "foobar",
|
2019-03-22 14:16:06 +00:00
|
|
|
"traefik.HTTP.Routers.Router0.TLS": "true",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.HTTP.Routers.Router1.EntryPoints": "foobar, fiibar",
|
|
|
|
"traefik.HTTP.Routers.Router1.Middlewares": "foobar, fiibar",
|
|
|
|
"traefik.HTTP.Routers.Router1.Priority": "42",
|
|
|
|
"traefik.HTTP.Routers.Router1.Rule": "foobar",
|
|
|
|
"traefik.HTTP.Routers.Router1.Service": "foobar",
|
2018-12-04 13:24:04 +00:00
|
|
|
|
2022-12-09 08:58:05 +00:00
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.HealthCheck.Headers.name0": "foobar",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.HealthCheck.Headers.name1": "foobar",
|
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.HealthCheck.Hostname": "foobar",
|
2022-11-16 10:38:07 +00:00
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.HealthCheck.Interval": "1000000000",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.HealthCheck.Path": "foobar",
|
2022-08-08 13:22:07 +00:00
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.HealthCheck.Method": "foobar",
|
2022-11-24 10:40:05 +00:00
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.HealthCheck.Status": "401",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.HealthCheck.Port": "42",
|
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.HealthCheck.Scheme": "foobar",
|
2022-11-16 10:38:07 +00:00
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.HealthCheck.Timeout": "1000000000",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.PassHostHeader": "true",
|
2022-11-16 10:38:07 +00:00
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.ResponseForwarding.FlushInterval": "1000000000",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.server.Port": "8080",
|
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.server.Scheme": "foobar",
|
2019-08-26 08:30:05 +00:00
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.Sticky.Cookie.Name": "foobar",
|
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.Sticky.Cookie.HTTPOnly": "true",
|
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.Sticky.Cookie.Secure": "false",
|
2024-01-18 08:30:06 +00:00
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.Sticky.Cookie.MaxAge": "0",
|
2022-12-09 08:58:05 +00:00
|
|
|
"traefik.HTTP.Services.Service0.LoadBalancer.ServersTransport": "foobar",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.Headers.name0": "foobar",
|
|
|
|
"traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.Headers.name1": "foobar",
|
|
|
|
"traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.Hostname": "foobar",
|
2022-11-16 10:38:07 +00:00
|
|
|
"traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.Interval": "1000000000",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.Path": "foobar",
|
2022-08-08 13:22:07 +00:00
|
|
|
"traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.Method": "foobar",
|
2022-11-24 10:40:05 +00:00
|
|
|
"traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.Status": "401",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.Port": "42",
|
|
|
|
"traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.Scheme": "foobar",
|
2022-11-16 10:38:07 +00:00
|
|
|
"traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.Timeout": "1000000000",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.HTTP.Services.Service1.LoadBalancer.PassHostHeader": "true",
|
2022-11-16 10:38:07 +00:00
|
|
|
"traefik.HTTP.Services.Service1.LoadBalancer.ResponseForwarding.FlushInterval": "1000000000",
|
2019-03-14 08:30:04 +00:00
|
|
|
"traefik.HTTP.Services.Service1.LoadBalancer.server.Port": "8080",
|
|
|
|
"traefik.HTTP.Services.Service1.LoadBalancer.server.Scheme": "foobar",
|
2022-12-09 08:58:05 +00:00
|
|
|
"traefik.HTTP.Services.Service1.LoadBalancer.ServersTransport": "foobar",
|
2019-04-15 16:22:07 +00:00
|
|
|
|
2022-10-26 15:16:05 +00:00
|
|
|
"traefik.TCP.Middlewares.Middleware0.IPAllowList.SourceRange": "foobar, fiibar",
|
2021-11-29 16:12:06 +00:00
|
|
|
"traefik.TCP.Middlewares.Middleware2.InFlightConn.Amount": "42",
|
2020-02-20 21:24:05 +00:00
|
|
|
"traefik.TCP.Routers.Router0.Rule": "foobar",
|
2022-03-17 17:02:08 +00:00
|
|
|
"traefik.TCP.Routers.Router0.Priority": "42",
|
2020-02-20 21:24:05 +00:00
|
|
|
"traefik.TCP.Routers.Router0.EntryPoints": "foobar, fiibar",
|
|
|
|
"traefik.TCP.Routers.Router0.Service": "foobar",
|
|
|
|
"traefik.TCP.Routers.Router0.TLS.Passthrough": "false",
|
|
|
|
"traefik.TCP.Routers.Router0.TLS.Options": "foo",
|
|
|
|
"traefik.TCP.Routers.Router1.Rule": "foobar",
|
2022-03-17 17:02:08 +00:00
|
|
|
"traefik.TCP.Routers.Router1.Priority": "42",
|
2020-02-20 21:24:05 +00:00
|
|
|
"traefik.TCP.Routers.Router1.EntryPoints": "foobar, fiibar",
|
|
|
|
"traefik.TCP.Routers.Router1.Service": "foobar",
|
|
|
|
"traefik.TCP.Routers.Router1.TLS.Passthrough": "false",
|
|
|
|
"traefik.TCP.Routers.Router1.TLS.Options": "foo",
|
|
|
|
"traefik.TCP.Services.Service0.LoadBalancer.server.Port": "42",
|
2022-12-09 08:58:05 +00:00
|
|
|
"traefik.TCP.Services.Service0.LoadBalancer.server.TLS": "false",
|
|
|
|
"traefik.TCP.Services.Service0.LoadBalancer.ServersTransport": "foo",
|
2020-02-20 21:24:05 +00:00
|
|
|
"traefik.TCP.Services.Service1.LoadBalancer.server.Port": "42",
|
2022-12-09 08:58:05 +00:00
|
|
|
"traefik.TCP.Services.Service1.LoadBalancer.server.TLS": "false",
|
|
|
|
"traefik.TCP.Services.Service1.LoadBalancer.ServersTransport": "foo",
|
2020-02-20 21:24:05 +00:00
|
|
|
|
|
|
|
"traefik.UDP.Routers.Router0.EntryPoints": "foobar, fiibar",
|
|
|
|
"traefik.UDP.Routers.Router0.Service": "foobar",
|
|
|
|
"traefik.UDP.Routers.Router1.EntryPoints": "foobar, fiibar",
|
|
|
|
"traefik.UDP.Routers.Router1.Service": "foobar",
|
|
|
|
"traefik.UDP.Services.Service0.LoadBalancer.server.Port": "42",
|
|
|
|
"traefik.UDP.Services.Service1.LoadBalancer.server.Port": "42",
|
2018-12-04 13:24:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for key, val := range expected {
|
|
|
|
if _, ok := labels[key]; !ok {
|
|
|
|
fmt.Println("missing in labels:", key, val)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for key, val := range labels {
|
|
|
|
if _, ok := expected[key]; !ok {
|
|
|
|
fmt.Println("missing in expected:", key, val)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
assert.Equal(t, expected, labels)
|
|
|
|
}
|