Skip to content

Commit

Permalink
Merge pull request #34649 from michalvavrik/feature/fix-oidc-dev-ui-r…
Browse files Browse the repository at this point in the history
…eload

Fix OIDC DEV UI Live Reload
  • Loading branch information
geoand authored Jul 10, 2023
2 parents 2649e7c + 1a64161 commit b71789b
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.quarkus.oidc.deployment.devservices;

import java.time.Duration;
import java.util.List;
import java.util.Map;

import jakarta.inject.Singleton;
Expand Down Expand Up @@ -109,7 +110,7 @@ protected static CardPageBuildItem createProviderWebComponent(OidcDevUiRecorder
ConfigurationBuildItem configurationBuildItem,
String keycloakAdminUrl,
Map<String, String> keycloakUsers,
Object keycloakRealms,
List<String> keycloakRealms,
boolean alwaysLogoutUserInDevUiOnReload) {
final CardPageBuildItem cardPage = new CardPageBuildItem();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.quarkus.oidc.deployment.devservices.keycloak;

import java.util.List;
import java.util.Map;
import java.util.Optional;

Expand Down Expand Up @@ -84,6 +85,9 @@ void produceProviderComponent(Optional<KeycloakDevServicesConfigBuildItem> confi

String keycloakAdminUrl = configProps.get().getConfig().get("keycloak.url");

@SuppressWarnings("unchecked")
final List<String> keycloakRealms = (List<String>) configProps.get().getProperties().get("keycloak.realms");

CardPageBuildItem cardPageBuildItem = createProviderWebComponent(
recorder,
capabilities,
Expand All @@ -102,7 +106,7 @@ void produceProviderComponent(Optional<KeycloakDevServicesConfigBuildItem> confi
configurationBuildItem,
keycloakAdminUrl,
users,
configProps.get().getProperties().get("keycloak.realms"),
keycloakRealms,
configProps.get().isContainerRestarted());

// Also add Admin page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static io.quarkus.oidc.runtime.devui.OidcDevServicesUtils.getTokens;

import java.time.Duration;
import java.util.List;
import java.util.Map;

import io.quarkus.arc.Arc;
Expand Down Expand Up @@ -30,7 +31,7 @@ public class OidcDevJsonRpcService {
private final String oidcGrantType;
private final boolean introspectionIsAvailable;
private final String keycloakAdminUrl;
private final Object keycloakRealms;
private final List<String> keycloakRealms;
private final boolean swaggerIsAvailable;
private final boolean graphqlIsAvailable;
private final String swaggerUiPath;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.quarkus.oidc.runtime.devui;

import java.time.Duration;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;

Expand All @@ -11,7 +12,7 @@ public class OidcDevUiRecorder {
public Supplier<OidcDevUiRpcSvcPropertiesBean> prepareRpcServiceProperties(String authorizationUrl, String tokenUrl,
String logoutUrl, Duration webClientTimeout, Map<String, Map<String, String>> grantOptions,
Map<String, String> oidcUsers, String oidcProviderName, String oidcApplicationType, String oidcGrantType,
boolean introspectionIsAvailable, String keycloakAdminUrl, Object keycloakRealms, boolean swaggerIsAvailable,
boolean introspectionIsAvailable, String keycloakAdminUrl, List<String> keycloakRealms, boolean swaggerIsAvailable,
boolean graphqlIsAvailable, String swaggerUiPath, String graphqlUiPath, boolean alwaysLogoutUserInDevUiOnReload) {
return new Supplier<OidcDevUiRpcSvcPropertiesBean>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.quarkus.oidc.runtime.devui;

import java.time.Duration;
import java.util.List;
import java.util.Map;
import java.util.UUID;

Expand All @@ -17,7 +18,7 @@ public class OidcDevUiRpcSvcPropertiesBean {
private final String oidcGrantType;
private final boolean introspectionIsAvailable;
private final String keycloakAdminUrl;
private final Object keycloakRealms;
private final List<String> keycloakRealms;
private final boolean swaggerIsAvailable;
private final boolean graphqlIsAvailable;
private final String swaggerUiPath;
Expand All @@ -33,7 +34,7 @@ public class OidcDevUiRpcSvcPropertiesBean {
Duration webClientTimeout, Map<String, Map<String, String>> grantOptions,
Map<String, String> oidcUsers, String oidcProviderName, String oidcApplicationType,
String oidcGrantType, boolean introspectionIsAvailable, String keycloakAdminUrl,
Object keycloakRealms, boolean swaggerIsAvailable, boolean graphqlIsAvailable,
List<String> keycloakRealms, boolean swaggerIsAvailable, boolean graphqlIsAvailable,
String swaggerUiPath, String graphqlUiPath, boolean alwaysLogoutUserInDevUiOnReload) {
this.authorizationUrl = authorizationUrl;
this.tokenUrl = tokenUrl;
Expand Down Expand Up @@ -95,7 +96,7 @@ String getKeycloakAdminUrl() {
return keycloakAdminUrl;
}

Object getKeycloakRealms() {
List<String> getKeycloakRealms() {
return keycloakRealms;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.quarkus.oidc.runtime.devui;

import java.util.List;

import org.eclipse.microprofile.config.Config;

import io.quarkus.oidc.runtime.OidcConfigPropertySupplier;
Expand All @@ -26,7 +28,7 @@ public class OidcDevUiRuntimePropertiesDTO {
private final String oidcGrantType;
private final boolean introspectionIsAvailable;
private final String keycloakAdminUrl;
private final Object keycloakRealms;
private final List<String> keycloakRealms;
private final boolean swaggerIsAvailable;
private final boolean graphqlIsAvailable;
private final String swaggerUiPath;
Expand All @@ -36,7 +38,7 @@ public class OidcDevUiRuntimePropertiesDTO {

OidcDevUiRuntimePropertiesDTO(String authorizationUrl, String tokenUrl, String logoutUrl, Config config, int httpPort,
String oidcProviderName, String oidcApplicationType, String oidcGrantType,
boolean introspectionIsAvailable, String keycloakAdminUrl, Object keycloakRealms,
boolean introspectionIsAvailable, String keycloakAdminUrl, List<String> keycloakRealms,
boolean swaggerIsAvailable, boolean graphqlIsAvailable, String swaggerUiPath,
String graphqlUiPath, boolean alwaysLogoutUserInDevUiOnReload, String propertiesStateId) {
this.clientId = new OidcConfigPropertySupplier(CLIENT_ID_CONFIG_KEY).get(config);
Expand Down Expand Up @@ -114,7 +116,7 @@ public String getKeycloakAdminUrl() {
return keycloakAdminUrl;
}

public Object getKeycloakRealms() {
public List<String> getKeycloakRealms() {
return keycloakRealms;
}

Expand Down

0 comments on commit b71789b

Please sign in to comment.