iteration (#704)

This commit is contained in:
Michael Quigley 2024-07-24 10:47:12 -04:00
parent 2e3d6a627f
commit 2755422a29
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
2 changed files with 16 additions and 11 deletions

View File

@ -159,7 +159,8 @@ func shareHandler(handler http.Handler, pcfg *Config, key []byte, ctx ziti.Conte
if svc, found := endpoints.GetRefreshedService(shrToken, ctx); found { if svc, found := endpoints.GetRefreshedService(shrToken, ctx); found {
if cfg, found := svc.Config[sdk.ZrokProxyConfig]; found { if cfg, found := svc.Config[sdk.ZrokProxyConfig]; found {
if pcfg.Interstitial { if pcfg.Interstitial {
if _, istlFound := cfg["interstitial"]; istlFound { if v, istlFound := cfg["interstitial"]; istlFound {
if istlEnabled, ok := v.(bool); ok && istlEnabled {
skip := r.Header.Get("skip_zrok_interstitial") skip := r.Header.Get("skip_zrok_interstitial")
_, zrokOkErr := r.Cookie("zrok_interstitial") _, zrokOkErr := r.Cookie("zrok_interstitial")
if skip == "" && zrokOkErr != nil { if skip == "" && zrokOkErr != nil {
@ -169,6 +170,7 @@ func shareHandler(handler http.Handler, pcfg *Config, key []byte, ctx ziti.Conte
} }
} }
} }
}
if scheme, found := cfg["auth_scheme"]; found { if scheme, found := cfg["auth_scheme"]; found {
switch scheme { switch scheme {

View File

@ -1,10 +1,13 @@
package sdk package sdk
import "github.com/pkg/errors" import (
"github.com/pkg/errors"
)
const ZrokProxyConfig = "zrok.proxy.v1" const ZrokProxyConfig = "zrok.proxy.v1"
type FrontendConfig struct { type FrontendConfig struct {
Interstitial bool `json:"interstitial"`
AuthScheme AuthScheme `json:"auth_scheme"` AuthScheme AuthScheme `json:"auth_scheme"`
BasicAuth *BasicAuthConfig `json:"basic_auth"` BasicAuth *BasicAuthConfig `json:"basic_auth"`
OauthAuth *OauthConfig `json:"oauth"` OauthAuth *OauthConfig `json:"oauth"`