mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-09 23:12:06 -03:30
closes: #41677 (cherry picked from commit 5731cdf6738bc4344d495bd1193fe531f4f7ed7a) Signed-off-by: Steve Hawkins <shawkins@redhat.com>
This commit is contained in:
parent
1b5e05c8f5
commit
d7630b0cea
@ -180,10 +180,10 @@ public final class Configuration {
|
||||
|
||||
for (int i = 0; i < key.length(); i++) {
|
||||
char c = key.charAt(i);
|
||||
if (c == ',') {
|
||||
c = '-'; // should not happen, but was allowed by the previous logic
|
||||
}
|
||||
if (l && Character.isUpperCase(c)) {
|
||||
if (c == '.') {
|
||||
c = '-'; // this is not documented, but was in the previous logic
|
||||
l = false;
|
||||
} else if (l && Character.isUpperCase(c)) {
|
||||
sb.append('-');
|
||||
c = Character.toLowerCase(c);
|
||||
l = false;
|
||||
|
||||
@ -52,7 +52,7 @@ public class MicroProfileConfigProvider implements Config.ConfigProvider {
|
||||
|
||||
@Override
|
||||
public String getDefaultProvider(String spi) {
|
||||
return scope(spi).get("provider.default");
|
||||
return scope(spi).get("provider-default");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -187,6 +187,20 @@ public class ConfigurationTest extends AbstractConfigurationTest {
|
||||
assertEquals("true", createConfig().getConfigValue("kc.proxy-allow-forwarded-header").getValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProviderDefault() {
|
||||
ConfigArgsConfigSource.setCliArgs("--spi-client-registration--provider-default=openid-connect");
|
||||
initConfig("client-registration");
|
||||
assertEquals("openid-connect", Config.getDefaultProvider("client-registration"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testScopePropertyWithPeriod() {
|
||||
ConfigArgsConfigSource.setCliArgs("--spi-client-registration--openid-connect--some-property=value");
|
||||
Config.Scope scope = initConfig("client-registration", "openid-connect");
|
||||
assertEquals("value", scope.get("some.property"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPropertyNamesFromConfig() {
|
||||
ConfigArgsConfigSource.setCliArgs("--spi-client-registration-openid-connect-static-jwk-url=http://c.jwk.url");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user