fix: Getting branding assets from Eclipse Che Dashboard should not require authentiction (#1708)
Signed-off-by: Anatolii Bazko <abazko@redhat.com>pull/1709/head
parent
4b5a62a523
commit
94934bfe17
|
|
@ -162,7 +162,7 @@ func TestOauthProxyConfigUnauthorizedPaths(t *testing.T) {
|
|||
|
||||
configmap := getGatewayOauthProxyConfigSpec(ctx, "blabol")
|
||||
config := configmap.Data["oauth-proxy.cfg"]
|
||||
if !strings.Contains(config, "skip_auth_regex = \"^/$|/healthz$|^/dashboard/static/preload\"") {
|
||||
if !strings.Contains(config, "skip_auth_regex = \"^/$|/healthz$|^/dashboard/static/preload|^/dashboard/assets/branding/loader.svg$\"") {
|
||||
t.Errorf("oauth config shold not contain any skip auth when both registries are external")
|
||||
}
|
||||
})
|
||||
|
|
@ -183,7 +183,7 @@ func TestOauthProxyConfigUnauthorizedPaths(t *testing.T) {
|
|||
|
||||
configmap := getGatewayOauthProxyConfigSpec(ctx, "blabol")
|
||||
config := configmap.Data["oauth-proxy.cfg"]
|
||||
if !strings.Contains(config, "skip_auth_regex = \"^/devfile-registry|^/$|/healthz$|^/dashboard/static/preload\"") {
|
||||
if !strings.Contains(config, "skip_auth_regex = \"^/devfile-registry|^/$|/healthz$|^/dashboard/static/preload|^/dashboard/assets/branding/loader.svg$\"") {
|
||||
t.Error("oauth config should skip auth for devfile registry", config)
|
||||
}
|
||||
})
|
||||
|
|
@ -204,7 +204,7 @@ func TestOauthProxyConfigUnauthorizedPaths(t *testing.T) {
|
|||
|
||||
configmap := getGatewayOauthProxyConfigSpec(ctx, "blabol")
|
||||
config := configmap.Data["oauth-proxy.cfg"]
|
||||
if !strings.Contains(config, "skip_auth_regex = \"^/plugin-registry|^/$|/healthz$|^/dashboard/static/preload\"") {
|
||||
if !strings.Contains(config, "skip_auth_regex = \"^/plugin-registry|^/$|/healthz$|^/dashboard/static/preload|^/dashboard/assets/branding/loader.svg$\"") {
|
||||
t.Error("oauth config should skip auth for plugin registry", config)
|
||||
}
|
||||
})
|
||||
|
|
@ -225,7 +225,7 @@ func TestOauthProxyConfigUnauthorizedPaths(t *testing.T) {
|
|||
|
||||
configmap := getGatewayOauthProxyConfigSpec(ctx, "blabol")
|
||||
config := configmap.Data["oauth-proxy.cfg"]
|
||||
if !strings.Contains(config, "skip_auth_regex = \"^/plugin-registry|^/devfile-registry|^/$|/healthz$|^/dashboard/static/preload\"") {
|
||||
if !strings.Contains(config, "skip_auth_regex = \"^/plugin-registry|^/devfile-registry|^/$|/healthz$|^/dashboard/static/preload|^/dashboard/assets/branding/loader.svg$\"") {
|
||||
t.Error("oauth config should skip auth for plugin and devfile registry.", config)
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -146,6 +146,7 @@ func skipAuthConfig(instance *chev2.CheCluster) string {
|
|||
skipAuthPaths = append(skipAuthPaths, "^/$")
|
||||
skipAuthPaths = append(skipAuthPaths, "/healthz$")
|
||||
skipAuthPaths = append(skipAuthPaths, "^/dashboard/static/preload")
|
||||
skipAuthPaths = append(skipAuthPaths, fmt.Sprintf("^%s$", defaults.GetConsoleLinkImage()))
|
||||
if len(skipAuthPaths) > 0 {
|
||||
propName := "skip_auth_routes"
|
||||
if infrastructure.IsOpenShift() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue