mirror of
https://github.com/openziti/zrok.git
synced 2025-02-17 18:50:54 +01:00
iteration (#704)
This commit is contained in:
parent
2e3d6a627f
commit
2755422a29
@ -159,13 +159,15 @@ 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 {
|
||||||
skip := r.Header.Get("skip_zrok_interstitial")
|
if istlEnabled, ok := v.(bool); ok && istlEnabled {
|
||||||
_, zrokOkErr := r.Cookie("zrok_interstitial")
|
skip := r.Header.Get("skip_zrok_interstitial")
|
||||||
if skip == "" && zrokOkErr != nil {
|
_, zrokOkErr := r.Cookie("zrok_interstitial")
|
||||||
logrus.Debugf("forcing interstitial for '%v'", r.URL)
|
if skip == "" && zrokOkErr != nil {
|
||||||
interstitialUi.WriteInterstitialAnnounce(w)
|
logrus.Debugf("forcing interstitial for '%v'", r.URL)
|
||||||
return
|
interstitialUi.WriteInterstitialAnnounce(w)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
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 {
|
||||||
AuthScheme AuthScheme `json:"auth_scheme"`
|
Interstitial bool `json:"interstitial"`
|
||||||
BasicAuth *BasicAuthConfig `json:"basic_auth"`
|
AuthScheme AuthScheme `json:"auth_scheme"`
|
||||||
OauthAuth *OauthConfig `json:"oauth"`
|
BasicAuth *BasicAuthConfig `json:"basic_auth"`
|
||||||
|
OauthAuth *OauthConfig `json:"oauth"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type BasicAuthConfig struct {
|
type BasicAuthConfig struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user