Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pkg/deploy/gateway/traefik_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ type TraefikConfigStripPrefix struct {
}

type TraefikConfigForwardAuth struct {
Address string `json:"address"`
TrustForwardHeader bool `json:"trustForwardHeader"`
TLS *TraefikConfigTLS `json:"tls,omitempty"`
Address string `json:"address"`
TrustForwardHeader bool `json:"trustForwardHeader"`
TLS *TraefikConfigTLS `json:"tls,omitempty"`
MaxResponseBodySize *int `json:"maxResponseBodySize,omitempty"`
}

type TraefikConfigErrors struct {
Expand Down
10 changes: 7 additions & 3 deletions pkg/deploy/gateway/traefik_config_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package gateway

import "k8s.io/utils/pointer"

const (
StripPrefixMiddlewareSuffix = "-strip-prefix"
HeaderRewriteMiddlewareSuffix = "-header-rewrite"
Expand Down Expand Up @@ -88,8 +90,9 @@ func (cfg *TraefikConfig) AddOpenShiftTokenCheck(componentName string) {
cfg.HTTP.Routers[componentName].Middlewares = append(cfg.HTTP.Routers[componentName].Middlewares, middlewareName)
cfg.HTTP.Middlewares[middlewareName] = &TraefikConfigMiddleware{
ForwardAuth: &TraefikConfigForwardAuth{
Address: "https://kubernetes.default.svc/apis/user.openshift.io/v1/users/~",
TrustForwardHeader: true,
Address: "https://kubernetes.default.svc/apis/user.openshift.io/v1/users/~",
TrustForwardHeader: true,
MaxResponseBodySize: pointer.Int(16384), // 16KB
TLS: &TraefikConfigTLS{
InsecureSkipVerify: true,
},
Expand All @@ -102,7 +105,8 @@ func (cfg *TraefikConfig) AddAuth(componentName string, authAddress string) {
cfg.HTTP.Routers[componentName].Middlewares = append(cfg.HTTP.Routers[componentName].Middlewares, middlewareName)
cfg.HTTP.Middlewares[middlewareName] = &TraefikConfigMiddleware{
ForwardAuth: &TraefikConfigForwardAuth{
Address: authAddress,
Address: authAddress,
MaxResponseBodySize: pointer.Int(16384), // 16KB
},
}
}
Expand Down
Loading