From 8646d0668ad7c8fd5b899e082f7389a604fcc713 Mon Sep 17 00:00:00 2001 From: Agniswar Mandal <39838328+agniswarm@users.noreply.github.com> Date: Thu, 7 May 2020 01:03:18 +0530 Subject: [PATCH] KEYCLOAK-14072 docker-compose.yaml file generated creates an invalid urls * Updated Invalid URLs The docker-compose.yaml file generated creates an invalid url for REGISTRY_AUTH_TOKEN_REALM and REGISTRY_AUTH_TOKEN_ISSUER. Fixed * KEYCLOAK-14072 JIRA#14072 Test coverage fix for the the JIRA#14072 --- .../docker/installation/compose/DockerComposeYamlFile.java | 4 ++-- .../DockerComposeYamlInstallationProviderTest.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/src/main/java/org/keycloak/protocol/docker/installation/compose/DockerComposeYamlFile.java b/services/src/main/java/org/keycloak/protocol/docker/installation/compose/DockerComposeYamlFile.java index 1630ffaec0..aa93bef181 100644 --- a/services/src/main/java/org/keycloak/protocol/docker/installation/compose/DockerComposeYamlFile.java +++ b/services/src/main/java/org/keycloak/protocol/docker/installation/compose/DockerComposeYamlFile.java @@ -54,9 +54,9 @@ public class DockerComposeYamlFile { writer.print(" REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /" + registryDataDirName + "\n"); writer.print(" REGISTRY_HTTP_TLS_CERTIFICATE: " + containerCertPath + "/" + localhostCrtFileName + "\n"); writer.print(" REGISTRY_HTTP_TLS_KEY: " + containerCertPath + "/" + localhostKeyFileName + "\n"); - writer.print(" REGISTRY_AUTH_TOKEN_REALM: " + authServerUrl + "/realms/" + realmName + "/protocol/docker-v2/auth\n"); + writer.print(" REGISTRY_AUTH_TOKEN_REALM: " + authServerUrl + "realms/" + realmName + "/protocol/docker-v2/auth\n"); writer.print(" REGISTRY_AUTH_TOKEN_SERVICE: " + serviceId + "\n"); - writer.print(" REGISTRY_AUTH_TOKEN_ISSUER: " + authServerUrl + "/realms/" + realmName + "\n"); + writer.print(" REGISTRY_AUTH_TOKEN_ISSUER: " + authServerUrl + "realms/" + realmName + "\n"); writer.print(" REGISTRY_AUTH_TOKEN_ROOTCERTBUNDLE: " + containerCertPath + "/" + authServerTrustChainFileName + "\n"); writer.print(" volumes:\n"); writer.print(" - ./" + registryDataDirName + ":/" + registryDataDirName + ":z\n"); diff --git a/services/src/test/java/org/keycloak/procotol/docker/installation/DockerComposeYamlInstallationProviderTest.java b/services/src/test/java/org/keycloak/procotol/docker/installation/DockerComposeYamlInstallationProviderTest.java index ecf8c4d53b..7207b1fbc4 100644 --- a/services/src/test/java/org/keycloak/procotol/docker/installation/DockerComposeYamlInstallationProviderTest.java +++ b/services/src/test/java/org/keycloak/procotol/docker/installation/DockerComposeYamlInstallationProviderTest.java @@ -64,7 +64,7 @@ public class DockerComposeYamlInstallationProviderTest { byteStream = new ByteArrayOutputStream(); zipOutput = new ZipOutputStream(byteStream); - return installationProvider.generateInstallation(zipOutput, byteStream, certificate, new URL("http://localhost:8080/auth"), "docker-test", "docker-registry"); + return installationProvider.generateInstallation(zipOutput, byteStream, certificate, new URL("http://localhost:8080/auth/"), "docker-test", "docker-registry"); } @Test