From 9b7a1107045338de76443fa7f9f51a904b671b2a Mon Sep 17 00:00:00 2001 From: Steve Riesenberg Date: Tue, 12 Sep 2023 15:59:32 -0500 Subject: [PATCH 1/3] Fix OAuth2AuthenticationExceptionMixinTests on JDK 17 Closes gh-11893 --- .../jackson2/OAuth2AuthenticationExceptionMixin.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/jackson2/OAuth2AuthenticationExceptionMixin.java b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/jackson2/OAuth2AuthenticationExceptionMixin.java index 9fa810c1ac..cf2e4818b9 100644 --- a/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/jackson2/OAuth2AuthenticationExceptionMixin.java +++ b/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/jackson2/OAuth2AuthenticationExceptionMixin.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,16 +30,23 @@ import org.springframework.security.oauth2.core.OAuth2Error; * {@link OAuth2AuthenticationException}. * * @author Dennis Neufeld + * @author Steve Riesenberg * @since 5.3.4 * @see OAuth2AuthenticationException * @see OAuth2ClientJackson2Module */ @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS) -@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE, +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.NONE, isGetterVisibility = JsonAutoDetect.Visibility.NONE) @JsonIgnoreProperties(ignoreUnknown = true, value = { "cause", "stackTrace", "suppressedExceptions" }) abstract class OAuth2AuthenticationExceptionMixin { + @JsonProperty("error") + abstract OAuth2Error getError(); + + @JsonProperty("detailMessage") + abstract String getMessage(); + @JsonCreator OAuth2AuthenticationExceptionMixin(@JsonProperty("error") OAuth2Error error, @JsonProperty("detailMessage") String message) { From a580856bb2ec0d244de772be21c13c17ddb09b01 Mon Sep 17 00:00:00 2001 From: Steve Riesenberg Date: Tue, 12 Sep 2023 13:59:03 -0500 Subject: [PATCH 2/3] Update jacoco tool version to 0.8.9 Closes gh-13798 --- .../main/groovy/io/spring/gradle/convention/JacocoPlugin.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/groovy/io/spring/gradle/convention/JacocoPlugin.groovy b/buildSrc/src/main/groovy/io/spring/gradle/convention/JacocoPlugin.groovy index 8f558eabbe..7a8def2b6d 100644 --- a/buildSrc/src/main/groovy/io/spring/gradle/convention/JacocoPlugin.groovy +++ b/buildSrc/src/main/groovy/io/spring/gradle/convention/JacocoPlugin.groovy @@ -34,7 +34,7 @@ class JacocoPlugin implements Plugin { project.tasks.check.dependsOn project.tasks.jacocoTestReport project.jacoco { - toolVersion = '0.8.7' + toolVersion = '0.8.9' } } } From 3feb809b354ade3c6de9dd89a3e75ac1267ac9af Mon Sep 17 00:00:00 2001 From: Steve Riesenberg Date: Tue, 12 Sep 2023 18:33:36 -0500 Subject: [PATCH 3/3] Fix Saml2AuthenticationExceptionMixin on JDK 17 Closes gh-13804 --- .../jackson2/Saml2AuthenticationExceptionMixin.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/jackson2/Saml2AuthenticationExceptionMixin.java b/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/jackson2/Saml2AuthenticationExceptionMixin.java index 3bbee42f24..1e739c38f4 100644 --- a/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/jackson2/Saml2AuthenticationExceptionMixin.java +++ b/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/jackson2/Saml2AuthenticationExceptionMixin.java @@ -34,10 +34,16 @@ import org.springframework.security.saml2.provider.service.authentication.Saml2A * @see Saml2Jackson2Module */ @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS) -@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE, +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.NONE, isGetterVisibility = JsonAutoDetect.Visibility.NONE) @JsonIgnoreProperties(ignoreUnknown = true, value = { "cause", "stackTrace", "suppressedExceptions" }) -class Saml2AuthenticationExceptionMixin { +abstract class Saml2AuthenticationExceptionMixin { + + @JsonProperty("error") + abstract Saml2Error getSaml2Error(); + + @JsonProperty("detailMessage") + abstract String getMessage(); @JsonCreator Saml2AuthenticationExceptionMixin(@JsonProperty("error") Saml2Error error,