You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2026/04/02 07:20:41 UTC
(syncope) 03/03: Upgrading pac4j and MariaDB JDBC driver
This is an automated email from the ASF dual-hosted git repository.
ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git
commit 81cea66cedf4202274ca25b99eff5990b2dcb782
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Thu Apr 2 09:19:43 2026 +0200
Upgrading pac4j and MariaDB JDBC driver
---
.../apache/syncope/core/logic/OIDCC4UILogic.java | 4 +-
.../syncope/core/logic/oidc/OIDCClientCache.java | 11 +--
pom.xml | 6 +-
.../syncope/wa/starter/config/WAContext.java | 10 ---
.../oidc/WAOidcAttributeReleasePolicyFactory.java | 89 ----------------------
.../starter/pac4j/saml/BaseWASAML2ClientTest.java | 2 +
6 files changed, 13 insertions(+), 109 deletions(-)
diff --git a/ext/oidcc4ui/logic/src/main/java/org/apache/syncope/core/logic/OIDCC4UILogic.java b/ext/oidcc4ui/logic/src/main/java/org/apache/syncope/core/logic/OIDCC4UILogic.java
index 82098752d4..7818bb100b 100644
--- a/ext/oidcc4ui/logic/src/main/java/org/apache/syncope/core/logic/OIDCC4UILogic.java
+++ b/ext/oidcc4ui/logic/src/main/java/org/apache/syncope/core/logic/OIDCC4UILogic.java
@@ -140,8 +140,8 @@ public class OIDCC4UILogic extends AbstractTransactionalLogic<EntityTO> {
protected Params buildParams(final WebContext webContext) {
Params params = super.buildParams(webContext);
if (reauth) {
- params.main().put(OidcConfiguration.PROMPT, "login");
- params.main().put(OidcConfiguration.MAX_AGE, "0");
+ params.url().put(OidcConfiguration.PROMPT, "login");
+ params.url().put(OidcConfiguration.MAX_AGE, "0");
}
return params;
}
diff --git a/ext/oidcc4ui/logic/src/main/java/org/apache/syncope/core/logic/oidc/OIDCClientCache.java b/ext/oidcc4ui/logic/src/main/java/org/apache/syncope/core/logic/oidc/OIDCClientCache.java
index 3613e497b4..466df3092d 100644
--- a/ext/oidcc4ui/logic/src/main/java/org/apache/syncope/core/logic/oidc/OIDCClientCache.java
+++ b/ext/oidcc4ui/logic/src/main/java/org/apache/syncope/core/logic/oidc/OIDCClientCache.java
@@ -132,12 +132,13 @@ public class OIDCClientCache {
}
@Override
- public ClientAuthentication getClientAuthentication() {
- if (clientAuthenticationBuilder == null) {
- clientAuthenticationBuilder = new DefaultClientAuthenticationBuilder(configuration, metadata);
- clientAuthenticationBuilder.buildClientAuthentication();
+ public ClientAuthentication getClientAuthenticationTokenEndpoint() {
+ if (clientAuthToken == null) {
+ clientAuthToken = new DefaultClientAuthenticationBuilder(
+ configuration, metadata, metadata.getTokenEndpointURI());
+ clientAuthToken.buildClientAuthentication();
}
- return super.getClientAuthentication();
+ return super.getClientAuthenticationTokenEndpoint();
}
@Override
diff --git a/pom.xml b/pom.xml
index b37a0295c9..efe7178d98 100644
--- a/pom.xml
+++ b/pom.xml
@@ -461,9 +461,9 @@ under the License.
<commons-jexl.version>3.6.2</commons-jexl.version>
<commons-text.version>1.15.0</commons-text.version>
- <pac4j.version>6.4.0-RC1</pac4j.version>
+ <pac4j.version>6.4.1</pac4j.version>
- <cas.version>8.0.0-RC3</cas.version>
+ <cas.version>8.0.0-SNAPSHOT</cas.version>
<cas-client.version>4.1.0</cas-client.version>
<swagger-core.version>2.2.46</swagger-core.version>
@@ -536,7 +536,7 @@ under the License.
<jdbc.postgresql.version>42.7.10</jdbc.postgresql.version>
<jdbc.mysql.version>9.6.0</jdbc.mysql.version>
- <jdbc.mariadb.version>3.5.7</jdbc.mariadb.version>
+ <jdbc.mariadb.version>3.5.8</jdbc.mariadb.version>
<jdbc.oracle.version>23.26.1.0.0</jdbc.oracle.version>
<bundles.directory>${project.build.directory}/bundles</bundles.directory>
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 75ccbec7ed..6aba695972 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;
@@ -535,14 +533,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;
- }
-}
diff --git a/wa/starter/src/test/java/org/apache/syncope/wa/starter/pac4j/saml/BaseWASAML2ClientTest.java b/wa/starter/src/test/java/org/apache/syncope/wa/starter/pac4j/saml/BaseWASAML2ClientTest.java
index 0d7c941a27..d4dfd639bd 100644
--- a/wa/starter/src/test/java/org/apache/syncope/wa/starter/pac4j/saml/BaseWASAML2ClientTest.java
+++ b/wa/starter/src/test/java/org/apache/syncope/wa/starter/pac4j/saml/BaseWASAML2ClientTest.java
@@ -58,6 +58,7 @@ import org.bouncycastle.asn1.x509.Time;
import org.bouncycastle.asn1.x509.V3TBSCertificateGenerator;
import org.pac4j.saml.config.SAML2Configuration;
import org.pac4j.saml.metadata.SAML2IdentityProviderMetadataResolver;
+import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.FileSystemResource;
@@ -99,6 +100,7 @@ public abstract class BaseWASAML2ClientTest {
protected static SAML2Configuration getSAML2Configuration() throws Exception {
SAML2Configuration cfg = new SAML2Configuration();
+ cfg.getKeystore().setKeystoreResource(new ByteArrayResource(new byte[0]));
cfg.getKeystore().setKeystorePassword("password");
cfg.getKeystore().setPrivateKeyPassword("password");