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

ilgrosso pushed a commit to branch 4_2_X
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/4_2_X by this push:
     new e8f76c708f Upgrading Swagger Core
e8f76c708f is described below

commit e8f76c708fed7648dfc753066efe7476e09bdd8e
Author: Francesco Chicchiriccò <[email protected]>
AuthorDate: Wed Oct 28 15:10:25 2026 +0100

    Upgrading Swagger Core
---
 common/idrepo/lib/pom.xml                          |  2 +-
 pom.xml                                            |  9 ++------
 .../webauthn/WAWebAuthnCredentialRepository.java   | 24 +++++++++++++---------
 3 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/common/idrepo/lib/pom.xml b/common/idrepo/lib/pom.xml
index 505f2b4fe6..fee39c6e83 100644
--- a/common/idrepo/lib/pom.xml
+++ b/common/idrepo/lib/pom.xml
@@ -49,7 +49,7 @@ under the License.
 
     <dependency>
       <groupId>io.swagger.core.v3</groupId>
-      <artifactId>swagger-annotations-jakarta</artifactId>
+      <artifactId>swagger-annotations</artifactId>
     </dependency>      
 
     <dependency>
diff --git a/pom.xml b/pom.xml
index 3bf50caf05..2e9ffdf326 100644
--- a/pom.xml
+++ b/pom.xml
@@ -468,7 +468,7 @@ under the License.
     <cas.version>8.0.3</cas.version>
     <cas-client.version>4.1.1</cas-client.version>
 
-    <swagger-core.version>2.2.55</swagger-core.version>
+    <swagger-core.version>3.0.0</swagger-core.version>
     <swagger-ui.version>5.34.0</swagger-ui.version>
 
     <jquery-slimscroll.version>1.3.8</jquery-slimscroll.version>
@@ -626,12 +626,7 @@ under the License.
       <!-- Swagger -->
       <dependency>
         <groupId>io.swagger.core.v3</groupId>
-        <artifactId>swagger-annotations-jakarta</artifactId>
-        <version>${swagger-core.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>io.swagger.core.v3</groupId>
-        <artifactId>swagger-jaxrs2-jakarta</artifactId>
+        <artifactId>swagger-annotations</artifactId>
         <version>${swagger-core.version}</version>
       </dependency>
       <dependency>
diff --git 
a/wa/starter/src/main/java/org/apache/syncope/wa/starter/webauthn/WAWebAuthnCredentialRepository.java
 
b/wa/starter/src/main/java/org/apache/syncope/wa/starter/webauthn/WAWebAuthnCredentialRepository.java
index 9df770ea98..d0c2e5b713 100644
--- 
a/wa/starter/src/main/java/org/apache/syncope/wa/starter/webauthn/WAWebAuthnCredentialRepository.java
+++ 
b/wa/starter/src/main/java/org/apache/syncope/wa/starter/webauthn/WAWebAuthnCredentialRepository.java
@@ -43,8 +43,10 @@ public class WAWebAuthnCredentialRepository extends 
BaseWebAuthnCredentialReposi
 
     protected final WARestClient waRestClient;
 
-    public WAWebAuthnCredentialRepository(final CasConfigurationProperties 
properties,
+    public WAWebAuthnCredentialRepository(
+            final CasConfigurationProperties properties,
             final WARestClient waRestClient) {
+
         super(properties, CipherExecutor.noOpOfStringToString());
         this.waRestClient = waRestClient;
     }
@@ -96,15 +98,17 @@ public class WAWebAuthnCredentialRepository extends 
BaseWebAuthnCredentialReposi
                     })).
                     toList();
 
-            WebAuthnAccount account = service().read(username);
-            if (account != null) {
+            try {
+                WebAuthnAccount account = service().read(username);
                 account.getCredentials().addAll(credentials);
                 service().update(username, account);
-            } else {
-                account = new 
WebAuthnAccount.Builder().credentials(credentials).build();
-                service().create(username, account);
+            } catch (SyncopeClientException e) {
+                if (e.getType() == ClientExceptionType.NotFound) {
+                    WebAuthnAccount account = new 
WebAuthnAccount.Builder().credentials(credentials).build();
+                    service().create(username, account);
+                }
             }
-        } catch (final Exception e) {
+        } catch (Exception e) {
             LOG.error(e.getMessage(), e);
         }
     }
@@ -115,9 +119,9 @@ public class WAWebAuthnCredentialRepository extends 
BaseWebAuthnCredentialReposi
             return service().read(username).getCredentials().stream().
                     map(Unchecked.function(record -> {
                         String json = 
getCipherExecutor().decode(record.getJson());
-                        return WebAuthnUtils.getObjectMapper()
-                                .readValue(json, new 
TypeReference<CredentialRegistration>() {
-                                });
+                        return WebAuthnUtils.getObjectMapper().readValue(
+                                json, new 
TypeReference<CredentialRegistration>() {
+                        });
                     })).
                     toList();
         } catch (SyncopeClientException e) {

Reply via email to