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 {
protected String type;
protected List<String> scope;
protected List<String> scopes;
public String getType() {
return type;
@ -69,12 +69,12 @@ public class ClientScopesCondition extends AbstractClientPolicyConditionProvider
this.type = type;
}
public List<String> getScope() {
return scope;
public List<String> getScopes() {
return scopes;
}
public void setScope(List<String> scope) {
this.scope = scope;
public void setScopes(List<String> scope) {
this.scopes = scope;
}
}
@ -155,7 +155,7 @@ public class ClientScopesCondition extends AbstractClientPolicyConditionProvider
}
private Set<String> getScopesForMatching() {
List<String> scopes = configuration.getScope();
List<String> scopes = configuration.getScopes();
if (scopes == null) return null;
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) {
ClientScopesCondition.Configuration cfg = getConfigAsExpectedType(policyRep, ClientScopesConditionFactory.PROVIDER_ID, ClientScopesCondition.Configuration.class);
Assert.assertEquals(cfg.getType(), type);
Assert.assertEquals(cfg.getScope(), scopes);
Assert.assertEquals(cfg.getScopes(), scopes);
}
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) {
ClientScopesCondition.Configuration config = new ClientScopesCondition.Configuration();
config.setType(type);
config.setScope(scopes);
config.setScopes(scopes);
return config;
}