Expected Scopes of ClientScopesCondition created on Admin UI are not saved onto ClientScopesCondition.Configuration

Closes #9371
This commit is contained in:
Takashi Norimatsu 2022-01-04 12:25:42 +09:00 committed by Marek Posolda
parent b2fd379a2a
commit 07d43f31f3
3 changed files with 8 additions and 8 deletions

View file

@ -59,7 +59,7 @@ public class ClientScopesCondition extends AbstractClientPolicyConditionProvider
public static class Configuration extends ClientPolicyConditionConfigurationRepresentation { public static class Configuration extends ClientPolicyConditionConfigurationRepresentation {
protected String type; protected String type;
protected List<String> scope; protected List<String> scopes;
public String getType() { public String getType() {
return type; return type;
@ -69,12 +69,12 @@ public class ClientScopesCondition extends AbstractClientPolicyConditionProvider
this.type = type; this.type = type;
} }
public List<String> getScope() { public List<String> getScopes() {
return scope; return scopes;
} }
public void setScope(List<String> scope) { public void setScopes(List<String> scope) {
this.scope = scope; this.scopes = scope;
} }
} }
@ -155,7 +155,7 @@ public class ClientScopesCondition extends AbstractClientPolicyConditionProvider
} }
private Set<String> getScopesForMatching() { private Set<String> getScopesForMatching() {
List<String> scopes = configuration.getScope(); List<String> scopes = configuration.getScopes();
if (scopes == null) return null; if (scopes == null) return null;
return new HashSet<>(scopes); return new HashSet<>(scopes);
} }

View file

@ -1140,7 +1140,7 @@ public abstract class AbstractClientPoliciesTest extends AbstractKeycloakTest {
protected void assertExpectedClientScopesCondition(String type, List<String> scopes, ClientPolicyRepresentation policyRep) { protected void assertExpectedClientScopesCondition(String type, List<String> scopes, ClientPolicyRepresentation policyRep) {
ClientScopesCondition.Configuration cfg = getConfigAsExpectedType(policyRep, ClientScopesConditionFactory.PROVIDER_ID, ClientScopesCondition.Configuration.class); ClientScopesCondition.Configuration cfg = getConfigAsExpectedType(policyRep, ClientScopesConditionFactory.PROVIDER_ID, ClientScopesCondition.Configuration.class);
Assert.assertEquals(cfg.getType(), type); Assert.assertEquals(cfg.getType(), type);
Assert.assertEquals(cfg.getScope(), scopes); Assert.assertEquals(cfg.getScopes(), scopes);
} }
protected void assertExpectedClientUpdateContextCondition(List<String> updateClientSources, ClientPolicyRepresentation policyRep) { protected void assertExpectedClientUpdateContextCondition(List<String> updateClientSources, ClientPolicyRepresentation policyRep) {

View file

@ -331,7 +331,7 @@ public final class ClientPoliciesUtil {
public static ClientScopesCondition.Configuration createClientScopesConditionConfig(String type, List<String> scopes) { public static ClientScopesCondition.Configuration createClientScopesConditionConfig(String type, List<String> scopes) {
ClientScopesCondition.Configuration config = new ClientScopesCondition.Configuration(); ClientScopesCondition.Configuration config = new ClientScopesCondition.Configuration();
config.setType(type); config.setType(type);
config.setScope(scopes); config.setScopes(scopes);
return config; return config;
} }