You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by mm...@apache.org on 2022/09/05 09:26:08 UTC

[syncope] branch master updated: Upgrade CAS/WA in prep for the final 6.6 release (#369)

This is an automated email from the ASF dual-hosted git repository.

mmoayyed pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/master by this push:
     new 5758aa8e33 Upgrade CAS/WA in prep for the final 6.6 release (#369)
5758aa8e33 is described below

commit 5758aa8e332bf48d5db687a09c424fda01cc7aa8
Author: Misagh Moayyed <mm...@gmail.com>
AuthorDate: Mon Sep 5 13:26:03 2022 +0400

    Upgrade CAS/WA in prep for the final 6.6 release (#369)
---
 pom.xml                                                      |  2 +-
 .../syncope/wa/starter/mapping/OIDCRPClientAppTOMapper.java  | 12 ++++++------
 .../starter/surrogate/WASurrogateAuthenticationService.java  |  4 ++--
 .../surrogate/WASurrogateAuthenticationServiceTest.java      |  6 +++---
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/pom.xml b/pom.xml
index 7a3b4620d5..4d957fe380 100644
--- a/pom.xml
+++ b/pom.xml
@@ -450,7 +450,7 @@ under the License.
 
     <pac4j.version>5.4.6</pac4j.version>
 
-    <cas.version>6.6.0-RC5</cas.version>
+    <cas.version>6.6.0</cas.version>
     <cas-client.version>3.6.4</cas-client.version>
 
     <h2.version>2.1.214</h2.version>
diff --git a/wa/starter/src/main/java/org/apache/syncope/wa/starter/mapping/OIDCRPClientAppTOMapper.java b/wa/starter/src/main/java/org/apache/syncope/wa/starter/mapping/OIDCRPClientAppTOMapper.java
index 458faabc04..913999d849 100644
--- a/wa/starter/src/main/java/org/apache/syncope/wa/starter/mapping/OIDCRPClientAppTOMapper.java
+++ b/wa/starter/src/main/java/org/apache/syncope/wa/starter/mapping/OIDCRPClientAppTOMapper.java
@@ -87,13 +87,13 @@ public class OIDCRPClientAppTOMapper extends AbstractClientAppMapper {
         } else {
             chain = new ChainingAttributeReleasePolicy();
             if (attributeReleasePolicy != null) {
-                chain.addPolicy(attributeReleasePolicy);
+                chain.addPolicies(attributeReleasePolicy);
             }
 
-            chain.addPolicy(new OidcProfileScopeAttributeReleasePolicy());
-            chain.addPolicy(new OidcEmailScopeAttributeReleasePolicy());
-            chain.addPolicy(new OidcAddressScopeAttributeReleasePolicy());
-            chain.addPolicy(new OidcPhoneScopeAttributeReleasePolicy());
+            chain.addPolicies(new OidcProfileScopeAttributeReleasePolicy(),
+                new OidcEmailScopeAttributeReleasePolicy(),
+                new OidcAddressScopeAttributeReleasePolicy(),
+                new OidcPhoneScopeAttributeReleasePolicy());
 
             Set<String> customClaims = clientApp.getReleaseAttrs().values().stream().
                     map(Objects::toString).collect(Collectors.toCollection(HashSet::new));
@@ -110,7 +110,7 @@ public class OIDCRPClientAppTOMapper extends AbstractClientAppMapper {
                                     distinct().collect(Collectors.toList()));
                 }
 
-                chain.addPolicy(new OidcCustomScopeAttributeReleasePolicy(
+                chain.addPolicies(new OidcCustomScopeAttributeReleasePolicy(
                         CUSTOM_SCOPE, customClaims.stream().collect(Collectors.toList())));
             }
         }
diff --git a/wa/starter/src/main/java/org/apache/syncope/wa/starter/surrogate/WASurrogateAuthenticationService.java b/wa/starter/src/main/java/org/apache/syncope/wa/starter/surrogate/WASurrogateAuthenticationService.java
index b5fe2f997c..ad4c0833f2 100644
--- a/wa/starter/src/main/java/org/apache/syncope/wa/starter/surrogate/WASurrogateAuthenticationService.java
+++ b/wa/starter/src/main/java/org/apache/syncope/wa/starter/surrogate/WASurrogateAuthenticationService.java
@@ -41,7 +41,7 @@ public class WASurrogateAuthenticationService implements SurrogateAuthentication
     }
 
     @Override
-    public boolean canAuthenticateAs(
+    public boolean canImpersonate(
             final String surrogate, final Principal principal, final Optional<Service> service) {
 
         try {
@@ -55,7 +55,7 @@ public class WASurrogateAuthenticationService implements SurrogateAuthentication
     }
 
     @Override
-    public Collection<String> getEligibleAccountsForSurrogateToProxy(final String username) {
+    public Collection<String> getImpersonationAccounts(final String username) {
         return getImpersonationService().read(username).
                 stream().
                 map(ImpersonationAccount::getImpersonated).
diff --git a/wa/starter/src/test/java/org/apache/syncope/wa/starter/surrogate/WASurrogateAuthenticationServiceTest.java b/wa/starter/src/test/java/org/apache/syncope/wa/starter/surrogate/WASurrogateAuthenticationServiceTest.java
index a9c10d2b00..fd99d9e45b 100644
--- a/wa/starter/src/test/java/org/apache/syncope/wa/starter/surrogate/WASurrogateAuthenticationServiceTest.java
+++ b/wa/starter/src/test/java/org/apache/syncope/wa/starter/surrogate/WASurrogateAuthenticationServiceTest.java
@@ -51,10 +51,10 @@ public class WASurrogateAuthenticationServiceTest extends AbstractTest {
 
         impersonationService.create(owner, account);
 
-        assertFalse(surrogateService.getEligibleAccountsForSurrogateToProxy(owner).isEmpty());
+        assertFalse(surrogateService.getImpersonationAccounts(owner).isEmpty());
 
         Principal principal = PrincipalFactoryUtils.newPrincipalFactory().createPrincipal(owner);
-        assertFalse(surrogateService.canAuthenticateAs("unknown", principal, Optional.empty()));
-        assertTrue(surrogateService.canAuthenticateAs(account.getImpersonated(), principal, Optional.empty()));
+        assertFalse(surrogateService.canImpersonate("unknown", principal, Optional.empty()));
+        assertTrue(surrogateService.canImpersonate(account.getImpersonated(), principal, Optional.empty()));
     }
 }