This is an automated email from the ASF dual-hosted git repository. ilgrosso pushed a commit to branch 4_1_X in repository https://gitbox.apache.org/repos/asf/syncope.git
commit 1e79c84a50fbb99aa89553d9d3ec3d13fa40c977 Author: Francesco Chicchiriccò <[email protected]> AuthorDate: Sat Apr 4 06:13:04 2026 +0200 Upgrading CAS --- pom.xml | 2 +- .../syncope/wa/starter/config/WAContext.java | 10 --- .../oidc/WAOidcAttributeReleasePolicyFactory.java | 89 ---------------------- 3 files changed, 1 insertion(+), 100 deletions(-) diff --git a/pom.xml b/pom.xml index 6f001b8674..6cc4dfe173 100644 --- a/pom.xml +++ b/pom.xml @@ -463,7 +463,7 @@ under the License. <pac4j.version>6.3.3</pac4j.version> - <cas.version>7.3.5</cas.version> + <cas.version>7.3.6</cas.version> <cas-client.version>4.0.4</cas-client.version> <swagger-core.version>2.2.46</swagger-core.version> diff --git a/wa/starter/src/main/java/org/apache/syncope/wa/starter/config/WAContext.java b/wa/starter/src/main/java/org/apache/syncope/wa/starter/config/WAContext.java index b2c3688fe5..bad09c3947 100644 --- a/wa/starter/src/main/java/org/apache/syncope/wa/starter/config/WAContext.java +++ b/wa/starter/src/main/java/org/apache/syncope/wa/starter/config/WAContext.java @@ -61,7 +61,6 @@ import org.apache.syncope.wa.starter.mapping.SAML2SPClientAppTOMapper; import org.apache.syncope.wa.starter.mapping.TicketExpirationMapper; import org.apache.syncope.wa.starter.mapping.TimeBasedAccessMapper; import org.apache.syncope.wa.starter.mfa.WAMultifactorAuthenticationTrustStorage; -import org.apache.syncope.wa.starter.oidc.WAOidcAttributeReleasePolicyFactory; import org.apache.syncope.wa.starter.oidc.WAOidcJsonWebKeystoreGeneratorService; import org.apache.syncope.wa.starter.pac4j.saml.WASAML2ClientCustomizer; import org.apache.syncope.wa.starter.saml.idp.metadata.WASamlIdPMetadataCacheRefresher; @@ -81,7 +80,6 @@ import org.apereo.cas.configuration.model.support.pm.PasswordManagementPropertie import org.apereo.cas.gauth.CasGoogleAuthenticator; import org.apereo.cas.gauth.credential.LdapGoogleAuthenticatorTokenCredentialRepository; import org.apereo.cas.oidc.jwks.generator.OidcJsonWebKeystoreGeneratorService; -import org.apereo.cas.oidc.scopes.OidcAttributeReleasePolicyFactory; import org.apereo.cas.otp.repository.credentials.OneTimeTokenCredentialRepository; import org.apereo.cas.pm.LdapPasswordManagementService; import org.apereo.cas.pm.PasswordHistoryService; @@ -537,14 +535,6 @@ public class WAContext { applicationContext); } - @Bean - @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT) - public OidcAttributeReleasePolicyFactory oidcAttributeReleasePolicyFactory( - final CasConfigurationProperties casProperties) { - - return new WAOidcAttributeReleasePolicyFactory(casProperties); - } - @Bean public WebAuthnCredentialRepository webAuthnCredentialRepository( final CasConfigurationProperties casProperties, diff --git a/wa/starter/src/main/java/org/apache/syncope/wa/starter/oidc/WAOidcAttributeReleasePolicyFactory.java b/wa/starter/src/main/java/org/apache/syncope/wa/starter/oidc/WAOidcAttributeReleasePolicyFactory.java deleted file mode 100644 index b9bc7a7f10..0000000000 --- a/wa/starter/src/main/java/org/apache/syncope/wa/starter/oidc/WAOidcAttributeReleasePolicyFactory.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.wa.starter.oidc; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import org.apereo.cas.configuration.CasConfigurationProperties; -import org.apereo.cas.oidc.claims.BaseOidcScopeAttributeReleasePolicy; -import org.apereo.cas.oidc.claims.OidcCustomScopeAttributeReleasePolicy; -import org.apereo.cas.oidc.claims.OidcRegisteredServiceAttributeReleasePolicy; -import org.apereo.cas.oidc.claims.OidcScopeFreeAttributeReleasePolicy; -import org.apereo.cas.oidc.scopes.DefaultOidcAttributeReleasePolicyFactory; -import org.apereo.cas.services.ChainingAttributeReleasePolicy; -import org.apereo.cas.services.OidcRegisteredService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class WAOidcAttributeReleasePolicyFactory extends DefaultOidcAttributeReleasePolicyFactory { - - protected static final Logger LOG = LoggerFactory.getLogger(WAOidcAttributeReleasePolicyFactory.class); - - public WAOidcAttributeReleasePolicyFactory(final CasConfigurationProperties casProperties) { - super(casProperties); - } - - @Override - public Map<String, BaseOidcScopeAttributeReleasePolicy> resolvePolicies( - final OidcRegisteredService registeredService) { - - Map<String, BaseOidcScopeAttributeReleasePolicy> policies = new HashMap<>(attributeReleasePoliciesByScope); - - Collection<OidcCustomScopeAttributeReleasePolicy> userScopes = getUserDefinedScopes(); - LOG.debug("Configuring attributes release policies for user-defined scopes [{}]", userScopes); - userScopes.forEach(us -> policies.put(us.getScopeName(), us)); - - LOG.debug("Configuring attributes release policies for user-defined scopes specified for service [{}]", - registeredService.getName()); - - List<OidcRegisteredServiceAttributeReleasePolicy> listOfOidcPolicies = new ArrayList<>(); - switch (registeredService.getAttributeReleasePolicy()) { - case ChainingAttributeReleasePolicy chain -> - listOfOidcPolicies.addAll(chain.getPolicies().stream(). - filter(OidcRegisteredServiceAttributeReleasePolicy.class::isInstance). - map(OidcRegisteredServiceAttributeReleasePolicy.class::cast). - toList()); - - case OidcRegisteredServiceAttributeReleasePolicy policy -> - listOfOidcPolicies.add(policy); - - case null -> { - } - - default -> { - } - } - - listOfOidcPolicies.stream(). - filter(OidcCustomScopeAttributeReleasePolicy.class::isInstance). - map(OidcCustomScopeAttributeReleasePolicy.class::cast). - forEach(policy -> policies.put(policy.getScopeName(), policy)); - listOfOidcPolicies.stream(). - filter(OidcScopeFreeAttributeReleasePolicy.class::isInstance). - map(OidcScopeFreeAttributeReleasePolicy.class::cast). - forEach(policy -> policies.put(UUID.randomUUID().toString(), policy)); - - LOG.debug("Final set of scopes mapped to attribute release policies are [{}]", policies.keySet()); - return policies; - } -}
