diff --git a/quarkus/config-api/src/main/java/org/keycloak/config/CachingOptions.java b/quarkus/config-api/src/main/java/org/keycloak/config/CachingOptions.java index c082045288..4725b9ab9b 100644 --- a/quarkus/config-api/src/main/java/org/keycloak/config/CachingOptions.java +++ b/quarkus/config-api/src/main/java/org/keycloak/config/CachingOptions.java @@ -9,7 +9,7 @@ public class CachingOptions { local } - public static final Option CACHE = new OptionBuilder<>("cache", Mechanism.class) + public static final Option CACHE = new OptionBuilder<>("cache", Mechanism.class) .category(OptionCategory.CACHE) .description("Defines the cache mechanism for high-availability. " + "By default in production mode, a 'ispn' cache is used to create a cluster between multiple server nodes. " @@ -27,7 +27,7 @@ public class CachingOptions { google; } - public static final Option CACHE_STACK = new OptionBuilder<>("cache-stack", Stack.class) + public static final Option CACHE_STACK = new OptionBuilder<>("cache-stack", Stack.class) .category(OptionCategory.CACHE) .description("Define the default stack to use for cluster communication and node discovery. This option only takes effect " + "if 'cache' is set to 'ispn'. Default: udp.") diff --git a/quarkus/config-api/src/main/java/org/keycloak/config/FeatureOptions.java b/quarkus/config-api/src/main/java/org/keycloak/config/FeatureOptions.java index 1db5ae9a73..def3a450e1 100644 --- a/quarkus/config-api/src/main/java/org/keycloak/config/FeatureOptions.java +++ b/quarkus/config-api/src/main/java/org/keycloak/config/FeatureOptions.java @@ -18,7 +18,7 @@ public class FeatureOptions { .buildTime(true) .build(); - public static final Option FEATURES_DISABLED = new OptionBuilder("features-disabled", List.class, Profile.Feature.class) + public static final Option FEATURES_DISABLED = new OptionBuilder("features-disabled", List.class, Profile.Feature.class) .category(OptionCategory.FEATURE) .description("Disables a set of one or more features.") .expectedValues(() -> getFeatureValues(false)) diff --git a/quarkus/config-api/src/main/java/org/keycloak/config/HostnameOptions.java b/quarkus/config-api/src/main/java/org/keycloak/config/HostnameOptions.java index 50b3860b7c..23a56ae1f2 100644 --- a/quarkus/config-api/src/main/java/org/keycloak/config/HostnameOptions.java +++ b/quarkus/config-api/src/main/java/org/keycloak/config/HostnameOptions.java @@ -2,56 +2,56 @@ package org.keycloak.config; public class HostnameOptions { - public static final Option HOSTNAME = new OptionBuilder<>("hostname", String.class) + public static final Option HOSTNAME = new OptionBuilder<>("hostname", String.class) .category(OptionCategory.HOSTNAME) .description("Hostname for the Keycloak server.") .build(); - public static final Option HOSTNAME_URL = new OptionBuilder<>("hostname-url", String.class) + public static final Option HOSTNAME_URL = new OptionBuilder<>("hostname-url", String.class) .category(OptionCategory.HOSTNAME) .description("Set the base URL for frontend URLs, including scheme, host, port and path.") .build(); - public static final Option HOSTNAME_ADMIN = new OptionBuilder<>("hostname-admin", String.class) + public static final Option HOSTNAME_ADMIN = new OptionBuilder<>("hostname-admin", String.class) .category(OptionCategory.HOSTNAME) .description("The hostname for accessing the administration console. Use this option if you are exposing the administration console using a hostname other than the value set to the 'hostname' option.") .build(); - public static final Option HOSTNAME_ADMIN_URL = new OptionBuilder<>("hostname-admin-url", String.class) + public static final Option HOSTNAME_ADMIN_URL = new OptionBuilder<>("hostname-admin-url", String.class) .category(OptionCategory.HOSTNAME) .description("Set the base URL for accessing the administration console, including scheme, host, port and path") .build(); - public static final Option HOSTNAME_STRICT = new OptionBuilder<>("hostname-strict", Boolean.class) + public static final Option HOSTNAME_STRICT = new OptionBuilder<>("hostname-strict", Boolean.class) .category(OptionCategory.HOSTNAME) .description("Disables dynamically resolving the hostname from request headers. Should always be set to true in production, unless proxy verifies the Host header.") .defaultValue(Boolean.TRUE) .build(); - public static final Option HOSTNAME_STRICT_HTTPS = new OptionBuilder<>("hostname-strict-https", Boolean.class) + public static final Option HOSTNAME_STRICT_HTTPS = new OptionBuilder<>("hostname-strict-https", Boolean.class) .category(OptionCategory.HOSTNAME) .description("Forces frontend URLs to use the 'https' scheme. If set to false, the HTTP scheme is inferred from requests.") .hidden() .defaultValue(Boolean.TRUE) .build(); - public static final Option HOSTNAME_STRICT_BACKCHANNEL = new OptionBuilder<>("hostname-strict-backchannel", Boolean.class) + public static final Option HOSTNAME_STRICT_BACKCHANNEL = new OptionBuilder<>("hostname-strict-backchannel", Boolean.class) .category(OptionCategory.HOSTNAME) .description("By default backchannel URLs are dynamically resolved from request headers to allow internal and external applications. If all applications use the public URL this option should be enabled.") .build(); - public static final Option HOSTNAME_PATH = new OptionBuilder<>("hostname-path", String.class) + public static final Option HOSTNAME_PATH = new OptionBuilder<>("hostname-path", String.class) .category(OptionCategory.HOSTNAME) .description("This should be set if proxy uses a different context-path for Keycloak.") .build(); - public static final Option HOSTNAME_PORT = new OptionBuilder<>("hostname-port", Integer.class) + public static final Option HOSTNAME_PORT = new OptionBuilder<>("hostname-port", Integer.class) .category(OptionCategory.HOSTNAME) .description("The port used by the proxy when exposing the hostname. Set this option if the proxy uses a port other than the default HTTP and HTTPS ports.") .defaultValue(-1) .build(); - public static final Option HOSTNAME_DEBUG = new OptionBuilder<>("hostname-debug", Boolean.class) + public static final Option HOSTNAME_DEBUG = new OptionBuilder<>("hostname-debug", Boolean.class) .category(OptionCategory.HOSTNAME) .description("Toggle the hostname debug page that is accessible at /realms/master/hostname-debug") .defaultValue(Boolean.FALSE) diff --git a/quarkus/config-api/src/main/java/org/keycloak/config/HttpOptions.java b/quarkus/config-api/src/main/java/org/keycloak/config/HttpOptions.java index 5966f29db9..137f74a36c 100644 --- a/quarkus/config-api/src/main/java/org/keycloak/config/HttpOptions.java +++ b/quarkus/config-api/src/main/java/org/keycloak/config/HttpOptions.java @@ -11,13 +11,13 @@ public class HttpOptions { .defaultValue(Boolean.FALSE) .build(); - public static final Option HTTP_HOST = new OptionBuilder<>("http-host", String.class) + public static final Option HTTP_HOST = new OptionBuilder<>("http-host", String.class) .category(OptionCategory.HTTP) .description("The used HTTP Host.") .defaultValue("0.0.0.0") .build(); - public static final Option HTTP_RELATIVE_PATH = new OptionBuilder<>("http-relative-path", String.class) + public static final Option HTTP_RELATIVE_PATH = new OptionBuilder<>("http-relative-path", String.class) .category(OptionCategory.HTTP) .description("Set the path relative to '/' for serving resources. The path must start with a '/'.") .defaultValue("/") @@ -42,19 +42,19 @@ public class HttpOptions { required } - public static final Option HTTPS_CLIENT_AUTH = new OptionBuilder<>("https-client-auth", ClientAuth.class) + public static final Option HTTPS_CLIENT_AUTH = new OptionBuilder<>("https-client-auth", ClientAuth.class) .category(OptionCategory.HTTP) .description("Configures the server to require/request client authentication.") .defaultValue(ClientAuth.none) .buildTime(true) .build(); - public static final Option HTTPS_CIPHER_SUITES = new OptionBuilder<>("https-cipher-suites", String.class) + public static final Option HTTPS_CIPHER_SUITES = new OptionBuilder<>("https-cipher-suites", String.class) .category(OptionCategory.HTTP) .description("The cipher suites to use. If none is given, a reasonable default is selected.") .build(); - public static final Option HTTPS_PROTOCOLS = new OptionBuilder<>("https-protocols", String.class) + public static final Option HTTPS_PROTOCOLS = new OptionBuilder<>("https-protocols", String.class) .category(OptionCategory.HTTP) .description("The list of protocols to explicitly enable.") .defaultValue("TLSv1.3,TLSv1.2") @@ -70,12 +70,12 @@ public class HttpOptions { .description("The file path to a private key in PEM format.") .build(); - public static final Option HTTPS_KEY_STORE_FILE = new OptionBuilder<>("https-key-store-file", File.class) + public static final Option HTTPS_KEY_STORE_FILE = new OptionBuilder<>("https-key-store-file", File.class) .category(OptionCategory.HTTP) .description("The key store which holds the certificate information instead of specifying separate files.") .build(); - public static final Option HTTPS_KEY_STORE_PASSWORD = new OptionBuilder<>("https-key-store-password", String.class) + public static final Option HTTPS_KEY_STORE_PASSWORD = new OptionBuilder<>("https-key-store-password", String.class) .category(OptionCategory.HTTP) .description("The password of the key store file.") .defaultValue("password") @@ -88,13 +88,13 @@ public class HttpOptions { "If '" + SecurityOptions.FIPS_MODE.getKey() + "' is set to '" + FipsMode.STRICT + "' and no value is set, it defaults to 'BCFKS'.") .build(); - public static final Option HTTPS_TRUST_STORE_FILE = new OptionBuilder<>("https-trust-store-file", File.class) + public static final Option HTTPS_TRUST_STORE_FILE = new OptionBuilder<>("https-trust-store-file", File.class) .category(OptionCategory.HTTP) .description("The trust store which holds the certificate information of the certificates to trust.") .deprecated("Use the System Truststore instead, see the docs for details.") .build(); - public static final Option HTTPS_TRUST_STORE_PASSWORD = new OptionBuilder<>("https-trust-store-password", String.class) + public static final Option HTTPS_TRUST_STORE_PASSWORD = new OptionBuilder<>("https-trust-store-password", String.class) .category(OptionCategory.HTTP) .description("The password of the trust store file.") .deprecated("Use the System Truststore instead, see the docs for details.") diff --git a/quarkus/config-api/src/main/java/org/keycloak/config/LoggingOptions.java b/quarkus/config-api/src/main/java/org/keycloak/config/LoggingOptions.java index be32b0ad9d..8a95729148 100644 --- a/quarkus/config-api/src/main/java/org/keycloak/config/LoggingOptions.java +++ b/quarkus/config-api/src/main/java/org/keycloak/config/LoggingOptions.java @@ -30,7 +30,7 @@ public class LoggingOptions { .toList(); } - public static final Option LOG = new OptionBuilder("log", List.class, Handler.class) + public static final Option LOG = new OptionBuilder("log", List.class, Handler.class) .category(OptionCategory.LOGGING) .description("Enable one or more log handlers in a comma-separated list.") .expectedValues(() -> getAvailableHandlerNames()) diff --git a/quarkus/config-api/src/main/java/org/keycloak/config/MetricsOptions.java b/quarkus/config-api/src/main/java/org/keycloak/config/MetricsOptions.java index 6fd93d9012..2971c9d6af 100644 --- a/quarkus/config-api/src/main/java/org/keycloak/config/MetricsOptions.java +++ b/quarkus/config-api/src/main/java/org/keycloak/config/MetricsOptions.java @@ -2,7 +2,7 @@ package org.keycloak.config; public class MetricsOptions { - public static final Option METRICS_ENABLED = new OptionBuilder<>("metrics-enabled", Boolean.class) + public static final Option METRICS_ENABLED = new OptionBuilder<>("metrics-enabled", Boolean.class) .category(OptionCategory.METRICS) .description("If the server should expose metrics. If enabled, metrics are available at the '/metrics' endpoint.") .buildTime(true) diff --git a/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/KeycloakProcessor.java b/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/KeycloakProcessor.java index 3bb27a0c64..6df206abbb 100644 --- a/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/KeycloakProcessor.java +++ b/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/KeycloakProcessor.java @@ -466,7 +466,7 @@ class KeycloakProcessor { Map configProperties = dbConfig.getDefaultDatasource().getConfigProperties(); for (Entry dbConfigProperty : configProperties.entrySet()) { - PropertyMapper mapper = PropertyMappers.getMapper(dbConfigProperty.getKey()); + PropertyMapper mapper = PropertyMappers.getMapper(dbConfigProperty.getKey()); if (mapper == null) { continue; @@ -525,7 +525,7 @@ class KeycloakProcessor { } private void putPersistedProperty(Properties properties, String name) { - PropertyMapper mapper = PropertyMappers.getMapper(name); + PropertyMapper mapper = PropertyMappers.getMapper(name); ConfigValue value = null; if (mapper == null) { diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/Picocli.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/Picocli.java index 1a08745561..f1f72bdb39 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/Picocli.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/Picocli.java @@ -194,7 +194,7 @@ public final class Picocli { parseConfigArgs(new BiConsumer() { @Override public void accept(String key, String value) { - PropertyMapper mapper = PropertyMappers.getMapper(key); + PropertyMapper mapper = PropertyMappers.getMapper(key); if (mapper != null && mapper.isBuildTime()) { return; @@ -280,7 +280,7 @@ public final class Picocli { List ignoredRunTime = new ArrayList<>(); Set deprecatedInUse = new HashSet<>(); for (OptionCategory category : abstractCommand.getOptionCategories()) { - List mappers = new ArrayList<>(); + List> mappers = new ArrayList<>(); Optional.ofNullable(PropertyMappers.getRuntimeMappers().get(category)).ifPresent(mappers::addAll); Optional.ofNullable(PropertyMappers.getBuildTimeMappers().get(category)).ifPresent(mappers::addAll); for (PropertyMapper mapper : mappers) { @@ -388,7 +388,7 @@ public final class Picocli { // compare only the relevant options for this command, as not all options might be set for this command if (cmdCommand.getCommand() instanceof AbstractCommand) { AbstractCommand abstractCommand = cmdCommand.getCommand(); - PropertyMapper mapper = PropertyMappers.getMapper(propertyName); + PropertyMapper mapper = PropertyMappers.getMapper(propertyName); if (mapper != null) { if (!abstractCommand.getOptionCategories().contains(mapper.getCategory())) { continue; @@ -397,7 +397,7 @@ public final class Picocli { } if (runtimeValue == null && isNotBlank(persistedValue)) { - PropertyMapper mapper = PropertyMappers.getMapper(propertyName); + PropertyMapper mapper = PropertyMappers.getMapper(propertyName); if (mapper != null && persistedValue.equals(mapper.getDefaultValue().map(Object::toString).orElse(null))) { // same as default @@ -551,16 +551,16 @@ public final class Picocli { } private static void addOptionsToCli(CommandLine commandLine, boolean includeBuildTime, boolean includeRuntime) { - Map> mappers = new EnumMap<>(OptionCategory.class); + Map>> mappers = new EnumMap<>(OptionCategory.class); if (includeRuntime) { mappers.putAll(PropertyMappers.getRuntimeMappers()); } if (includeBuildTime) { - for (Map.Entry> entry : PropertyMappers.getBuildTimeMappers() + for (Map.Entry>> entry : PropertyMappers.getBuildTimeMappers() .entrySet()) { - List result = new ArrayList<>(mappers.getOrDefault(entry.getKey(), Collections.emptyList())); + List> result = new ArrayList<>(mappers.getOrDefault(entry.getKey(), Collections.emptyList())); result.addAll(entry.getValue()); @@ -571,10 +571,10 @@ public final class Picocli { addMappedOptionsToArgGroups(commandLine, mappers); } - private static void addMappedOptionsToArgGroups(CommandLine commandLine, Map> propertyMappers) { + private static void addMappedOptionsToArgGroups(CommandLine commandLine, Map>> propertyMappers) { CommandSpec cSpec = commandLine.getCommandSpec(); for(OptionCategory category : ((AbstractCommand) commandLine.getCommand()).getOptionCategories()) { - List mappersInCategory = propertyMappers.get(category); + List> mappersInCategory = propertyMappers.get(category); if (mappersInCategory == null) { //picocli raises an exception when an ArgGroup is empty, so ignore it when no mappings found for a category. @@ -586,7 +586,7 @@ public final class Picocli { .order(category.getOrder()) .validate(false); - for (PropertyMapper mapper: mappersInCategory) { + for (PropertyMapper mapper: mappersInCategory) { String name = mapper.getCliFormat(); String description = mapper.getDescription(); @@ -725,7 +725,7 @@ public final class Picocli { private static void checkChangesInBuildOptionsDuringAutoBuild() { if (Configuration.isOptimized()) { - List buildOptions = stream(Configuration.getPropertyNames(true).spliterator(), false) + List> buildOptions = stream(Configuration.getPropertyNames(true).spliterator(), false) .sorted() .map(PropertyMappers::getMapper) .filter(Objects::nonNull).collect(Collectors.toList()); @@ -736,7 +736,7 @@ public final class Picocli { StringBuilder options = new StringBuilder(); - for (PropertyMapper mapper : buildOptions) { + for (PropertyMapper mapper : buildOptions) { String newValue = ofNullable(getCurrentBuiltTimeProperty(mapper.getFrom())) .map(ConfigValue::getValue) .orElse(""); diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/ShowConfig.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/ShowConfig.java index 55352d6464..12555c8514 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/ShowConfig.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/ShowConfig.java @@ -142,7 +142,7 @@ public final class ShowConfig extends AbstractCommand implements Runnable { value = configValue.getValue(); } - PropertyMapper mapper = PropertyMappers.getMapper(property); + PropertyMapper mapper = PropertyMappers.getMapper(property); if (mapper != null && mapper.isRunTime()) { value = getRuntimeProperty(property).orElse(value); diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/ConfigArgsConfigSource.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/ConfigArgsConfigSource.java index 24cb2e256a..693be04e6f 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/ConfigArgsConfigSource.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/ConfigArgsConfigSource.java @@ -114,7 +114,7 @@ public class ConfigArgsConfigSource extends PropertiesConfigSource { properties.put(key, value); - PropertyMapper mapper = PropertyMappers.getMapper(key); + PropertyMapper mapper = PropertyMappers.getMapper(key); if (mapper != null) { String to = mapper.getTo(); diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/Configuration.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/Configuration.java index 67e26da337..0a462b4763 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/Configuration.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/Configuration.java @@ -130,7 +130,7 @@ public final class Configuration { } public static String getMappedPropertyName(String key) { - PropertyMapper mapper = PropertyMappers.getMapper(key); + PropertyMapper mapper = PropertyMappers.getMapper(key); if (mapper == null) { return key; diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/KcEnvConfigSource.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/KcEnvConfigSource.java index 3c87e9ac14..84b0a3c105 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/KcEnvConfigSource.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/KcEnvConfigSource.java @@ -44,7 +44,7 @@ public class KcEnvConfigSource extends EnvConfigSource { if (key.startsWith(kcPrefix)) { properties.put(key, value); - PropertyMapper mapper = PropertyMappers.getMapper(key); + PropertyMapper mapper = PropertyMappers.getMapper(key); if (mapper != null) { String to = mapper.getTo(); diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/KeycloakPropertiesConfigSource.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/KeycloakPropertiesConfigSource.java index 44a7d72995..fefe5d38cf 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/KeycloakPropertiesConfigSource.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/KeycloakPropertiesConfigSource.java @@ -144,7 +144,7 @@ public class KeycloakPropertiesConfigSource extends AbstractLocationConfigSource Map result = new HashMap<>(properties.size()); properties.keySet().forEach(k -> { String key = transformKey(k); - PropertyMapper mapper = PropertyMappers.getMapper(key); + PropertyMapper mapper = PropertyMappers.getMapper(key); //TODO: remove explicit checks for spi and feature options once we have proper support in our config mappers if (mapper != null diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/CachingPropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/CachingPropertyMappers.java index a6de02c2b8..db89faa4dd 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/CachingPropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/CachingPropertyMappers.java @@ -16,7 +16,7 @@ final class CachingPropertyMappers { private CachingPropertyMappers() { } - public static PropertyMapper[] getClusteringPropertyMappers() { + public static PropertyMapper[] getClusteringPropertyMappers() { return new PropertyMapper[] { fromOption(CachingOptions.CACHE) .paramLabel("type") diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/ClassLoaderPropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/ClassLoaderPropertyMappers.java index 814e19e8d6..520461e2af 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/ClassLoaderPropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/ClassLoaderPropertyMappers.java @@ -14,7 +14,7 @@ final class ClassLoaderPropertyMappers { private ClassLoaderPropertyMappers(){} - public static PropertyMapper[] getMappers() { + public static PropertyMapper[] getMappers() { return new PropertyMapper[] { fromOption(ClassLoaderOptions.IGNORE_ARTIFACTS) .to(QUARKUS_REMOVED_ARTIFACTS_PROPERTY) diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/ConfigKeystorePropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/ConfigKeystorePropertyMappers.java index 711c384a25..c450505457 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/ConfigKeystorePropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/ConfigKeystorePropertyMappers.java @@ -18,7 +18,7 @@ final class ConfigKeystorePropertyMappers { private ConfigKeystorePropertyMappers() { } - public static PropertyMapper[] getConfigKeystorePropertyMappers() { + public static PropertyMapper[] getConfigKeystorePropertyMappers() { return new PropertyMapper[] { fromOption(ConfigKeystoreOptions.CONFIG_KEYSTORE) .to(SMALLRYE_KEYSTORE_PATH) diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/DatabasePropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/DatabasePropertyMappers.java index bb46658033..199d4f3495 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/DatabasePropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/DatabasePropertyMappers.java @@ -18,7 +18,7 @@ final class DatabasePropertyMappers { private DatabasePropertyMappers(){} - public static PropertyMapper[] getDatabasePropertyMappers() { + public static PropertyMapper[] getDatabasePropertyMappers() { return new PropertyMapper[] { fromOption(DatabaseOptions.DB_DIALECT) .mapFrom("db") diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/FeaturePropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/FeaturePropertyMappers.java index 63ed7a5d36..4829bc4d3c 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/FeaturePropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/FeaturePropertyMappers.java @@ -15,12 +15,12 @@ import static org.keycloak.quarkus.runtime.configuration.mappers.PropertyMapper. public final class FeaturePropertyMappers { - private static Pattern VERSIONED_PATTERN = Pattern.compile("([^:]+):v(\\d+)"); + private static final Pattern VERSIONED_PATTERN = Pattern.compile("([^:]+):v(\\d+)"); private FeaturePropertyMappers() { } - public static PropertyMapper[] getMappers() { + public static PropertyMapper[] getMappers() { return new PropertyMapper[] { fromOption(FeatureOptions.FEATURES) .paramLabel("feature") @@ -57,7 +57,7 @@ public final class FeaturePropertyMappers { feature, FeatureOptions.getFeatureValues(false))); } int version = Integer.parseInt(matcher.group(2)); - if (!featureVersions.stream().anyMatch(f -> f.getVersion() == version)) { + if (featureVersions.stream().noneMatch(f -> f.getVersion() == version)) { throw new PropertyException( String.format("%s has an unrecognized feature version, it should be one of %s", feature, featureVersions.stream().map(Feature::getVersion).map(String::valueOf).collect(Collectors.toList()))); diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/HealthPropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/HealthPropertyMappers.java index e1a348501b..75186e88eb 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/HealthPropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/HealthPropertyMappers.java @@ -9,7 +9,7 @@ final class HealthPropertyMappers { private HealthPropertyMappers(){} - public static PropertyMapper[] getHealthPropertyMappers() { + public static PropertyMapper[] getHealthPropertyMappers() { return new PropertyMapper[] { fromOption(HealthOptions.HEALTH_ENABLED) .to("quarkus.health.extensions.enabled") diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/HostnamePropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/HostnamePropertyMappers.java index 83bd2ab320..770f44272a 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/HostnamePropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/HostnamePropertyMappers.java @@ -8,7 +8,7 @@ final class HostnamePropertyMappers { private HostnamePropertyMappers(){} - public static PropertyMapper[] getHostnamePropertyMappers() { + public static PropertyMapper[] getHostnamePropertyMappers() { return new PropertyMapper[] { fromOption(HostnameOptions.HOSTNAME) .to("kc.spi-hostname-default-hostname") diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/HttpPropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/HttpPropertyMappers.java index c1cb23be1a..d2d8b27315 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/HttpPropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/HttpPropertyMappers.java @@ -27,7 +27,7 @@ final class HttpPropertyMappers { private HttpPropertyMappers(){} - public static PropertyMapper[] getHttpPropertyMappers() { + public static PropertyMapper[] getHttpPropertyMappers() { return new PropertyMapper[] { fromOption(HttpOptions.HTTP_ENABLED) .to("quarkus.http.insecure-requests") @@ -142,14 +142,14 @@ final class HttpPropertyMappers { return of(enabled ? "enabled" : "disabled"); } - private static String getDefaultKeystorePathValue() { + private static File getDefaultKeystorePathValue() { String homeDir = Environment.getHomeDir(); if (homeDir != null) { File file = Paths.get(homeDir, "conf", "server.keystore").toFile(); if (file.exists()) { - return file.getAbsolutePath(); + return file; } } diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/LoggingPropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/LoggingPropertyMappers.java index 1484fe9820..965ee4853a 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/LoggingPropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/LoggingPropertyMappers.java @@ -23,8 +23,8 @@ public final class LoggingPropertyMappers { private LoggingPropertyMappers(){} - public static PropertyMapper[] getMappers() { - PropertyMapper[] defaultMappers = new PropertyMapper[]{ + public static PropertyMapper[] getMappers() { + PropertyMapper[] defaultMappers = new PropertyMapper[]{ fromOption(LoggingOptions.LOG) .paramLabel("") .build(), @@ -74,7 +74,7 @@ public final class LoggingPropertyMappers { return GELF_ACTIVATED ? ArrayUtils.addAll(defaultMappers, getGelfMappers()) : defaultMappers; } - public static PropertyMapper[] getGelfMappers() { + public static PropertyMapper[] getGelfMappers() { return new PropertyMapper[]{ fromOption(LoggingOptions.LOG_GELF_ENABLED) .mapFrom("log") diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/MetricsPropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/MetricsPropertyMappers.java index c399d2000a..8d5fb03670 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/MetricsPropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/MetricsPropertyMappers.java @@ -9,7 +9,7 @@ final class MetricsPropertyMappers { private MetricsPropertyMappers(){} - public static PropertyMapper[] getMetricsPropertyMappers() { + public static PropertyMapper[] getMetricsPropertyMappers() { return new PropertyMapper[] { fromOption(MetricsOptions.METRICS_ENABLED) .to("quarkus.micrometer.enabled") diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/PropertyMapper.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/PropertyMapper.java index 8aa8ace49f..bf99bf5feb 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/PropertyMapper.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/PropertyMapper.java @@ -45,8 +45,8 @@ import org.keycloak.quarkus.runtime.configuration.MicroProfileConfigProvider; public class PropertyMapper { - static PropertyMapper IDENTITY = new PropertyMapper( - new OptionBuilder(null, String.class).build(), + static PropertyMapper IDENTITY = new PropertyMapper<>( + new OptionBuilder<>(null, String.class).build(), null, null, null, @@ -116,7 +116,7 @@ public class PropertyMapper { if (parentValue == null) { // parent value not explicitly set, try to resolve the default value set to the parent property - PropertyMapper parentMapper = PropertyMappers.getMapper(parentKey); + PropertyMapper parentMapper = PropertyMappers.getMapper(parentKey); if (parentMapper != null && parentMapper.getDefaultValue().isPresent()) { parentValue = ConfigValue.builder().withValue(parentMapper.getDefaultValue().get().toString()).build(); diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/PropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/PropertyMappers.java index 9ceadbad6d..f0d88fdd6f 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/PropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/PropertyMappers.java @@ -44,7 +44,7 @@ public final class PropertyMappers { } public static ConfigValue getValue(ConfigSourceInterceptorContext context, String name) { - PropertyMapper mapper = MAPPERS.getOrDefault(name, PropertyMapper.IDENTITY); + PropertyMapper mapper = MAPPERS.getOrDefault(name, PropertyMapper.IDENTITY); return mapper.getConfigValue(name, context); } @@ -53,7 +53,7 @@ public final class PropertyMappers { return true; } - PropertyMapper mapper = MAPPERS.get(name); + PropertyMapper mapper = MAPPERS.get(name); boolean isBuildTimeProperty = mapper == null ? false : mapper.isBuildTime(); return isBuildTimeProperty @@ -75,17 +75,17 @@ public final class PropertyMappers { return name.startsWith("kc.features"); } - public static Map> getRuntimeMappers() { + public static Map>> getRuntimeMappers() { return MAPPERS.getRuntimeMappers(); } - public static Map> getBuildTimeMappers() { + public static Map>> getBuildTimeMappers() { return MAPPERS.getBuildTimeMappers(); } public static String formatValue(String property, String value) { property = removeProfilePrefixIfNeeded(property); - PropertyMapper mapper = getMapper(property); + PropertyMapper mapper = getMapper(property); if (mapper != null && mapper.isMask()) { return VALUE_MASK; @@ -102,28 +102,28 @@ public final class PropertyMappers { return property; } - public static PropertyMapper getMapper(String property) { + public static PropertyMapper getMapper(String property) { if (property.startsWith("%")) { return MAPPERS.get(property.substring(property.indexOf('.') + 1)); } return MAPPERS.get(property); } - public static Collection getMappers() { + public static Collection> getMappers() { return MAPPERS.values(); } - public static boolean isSupported(PropertyMapper mapper) { + public static boolean isSupported(PropertyMapper mapper) { return mapper.getCategory().getSupportLevel().equals(ConfigSupportLevel.SUPPORTED); } - private static class MappersConfig extends HashMap { + private static class MappersConfig extends HashMap> { - private Map> buildTimeMappers = new EnumMap<>(OptionCategory.class); - private Map> runtimeTimeMappers = new EnumMap<>(OptionCategory.class); + private Map>> buildTimeMappers = new EnumMap<>(OptionCategory.class); + private Map>> runtimeTimeMappers = new EnumMap<>(OptionCategory.class); - public void addAll(PropertyMapper[] mappers) { - for (PropertyMapper mapper : mappers) { + public void addAll(PropertyMapper[] mappers) { + for (PropertyMapper mapper : mappers) { super.put(mapper.getTo(), mapper); super.put(mapper.getFrom(), mapper); super.put(mapper.getCliFormat(), mapper); @@ -137,29 +137,29 @@ public final class PropertyMappers { } } - private void addMapperByStage(PropertyMapper mapper, Map> mappers) { + private void addMapperByStage(PropertyMapper mapper, Map>> mappers) { mappers.computeIfAbsent(mapper.getCategory(), - new Function>() { + new Function>>() { @Override - public List apply(OptionCategory c) { + public List> apply(OptionCategory c) { return new ArrayList<>(); } }).add(mapper); } @Override - public PropertyMapper put(String key, PropertyMapper value) { + public PropertyMapper put(String key, PropertyMapper value) { if (containsKey(key)) { throw new IllegalArgumentException("Duplicated mapper for key [" + key + "]"); } return super.put(key, value); } - public Map> getRuntimeMappers() { + public Map>> getRuntimeMappers() { return runtimeTimeMappers; } - public Map> getBuildTimeMappers() { + public Map>> getBuildTimeMappers() { return buildTimeMappers; } } diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/ProxyPropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/ProxyPropertyMappers.java index fd69ab2d61..3e83243f8f 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/ProxyPropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/ProxyPropertyMappers.java @@ -13,7 +13,7 @@ final class ProxyPropertyMappers { private ProxyPropertyMappers(){} - public static PropertyMapper[] getProxyPropertyMappers() { + public static PropertyMapper[] getProxyPropertyMappers() { return new PropertyMapper[] { fromOption(ProxyOptions.PROXY_HEADERS) .to("quarkus.http.proxy.proxy-address-forwarding") diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/SecurityPropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/SecurityPropertyMappers.java index 88dfce60e8..d1ce65408f 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/SecurityPropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/SecurityPropertyMappers.java @@ -17,7 +17,7 @@ final class SecurityPropertyMappers { private SecurityPropertyMappers() { } - public static PropertyMapper[] getMappers() { + public static PropertyMapper[] getMappers() { return new PropertyMapper[] { fromOption(SecurityOptions.FIPS_MODE).transformer(SecurityPropertyMappers::resolveFipsMode) .paramLabel("mode") diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/TransactionPropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/TransactionPropertyMappers.java index 5dc7285d90..7f19181d97 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/TransactionPropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/TransactionPropertyMappers.java @@ -15,7 +15,7 @@ public class TransactionPropertyMappers { private TransactionPropertyMappers(){} - public static PropertyMapper[] getTransactionPropertyMappers() { + public static PropertyMapper[] getTransactionPropertyMappers() { return new PropertyMapper[] { fromOption(TransactionOptions.TRANSACTION_XA_ENABLED) .to(QUARKUS_TXPROP_TARGET) diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/TruststorePropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/TruststorePropertyMappers.java index 626ed80dd9..3fddf74d5c 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/TruststorePropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/TruststorePropertyMappers.java @@ -6,7 +6,7 @@ import static org.keycloak.quarkus.runtime.configuration.mappers.PropertyMapper. public class TruststorePropertyMappers { - public static PropertyMapper[] getMappers() { + public static PropertyMapper[] getMappers() { return new PropertyMapper[] { fromOption(TruststoreOptions.TRUSTSTORE_PATHS) .paramLabel(TruststoreOptions.TRUSTSTORE_PATHS.getKey()) diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/VaultPropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/VaultPropertyMappers.java index 78e60d2558..1cc4d33f57 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/VaultPropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/mappers/VaultPropertyMappers.java @@ -9,7 +9,7 @@ final class VaultPropertyMappers { private VaultPropertyMappers() { } - public static PropertyMapper[] getVaultPropertyMappers() { + public static PropertyMapper[] getVaultPropertyMappers() { return new PropertyMapper[] { fromOption(VaultOptions.VAULT) .paramLabel("provider") diff --git a/quarkus/tests/junit5/src/main/java/org/keycloak/it/utils/RawKeycloakDistribution.java b/quarkus/tests/junit5/src/main/java/org/keycloak/it/utils/RawKeycloakDistribution.java index 2de3316c31..e56f0d164e 100644 --- a/quarkus/tests/junit5/src/main/java/org/keycloak/it/utils/RawKeycloakDistribution.java +++ b/quarkus/tests/junit5/src/main/java/org/keycloak/it/utils/RawKeycloakDistribution.java @@ -134,8 +134,8 @@ public final class RawKeycloakDistribution implements KeycloakDistribution { throw new RuntimeException("Failed to start the server", cause); } finally { if (arguments.contains(Build.NAME) && removeBuildOptionsAfterBuild) { - for (List mappers : PropertyMappers.getBuildTimeMappers().values()) { - for (PropertyMapper mapper : mappers) { + for (List> mappers : PropertyMappers.getBuildTimeMappers().values()) { + for (PropertyMapper mapper : mappers) { removeProperty(mapper.getFrom().substring(3)); } } @@ -180,9 +180,9 @@ public final class RawKeycloakDistribution implements KeycloakDistribution { return; } - CompletableFuture allProcesses = CompletableFuture.completedFuture(null); + CompletableFuture allProcesses = CompletableFuture.completedFuture(null); - for (ProcessHandle process : parent.descendants().collect(Collectors.toList())) { + for (ProcessHandle process : parent.descendants().toList()) { if (force) { process.destroyForcibly(); } else {