-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for opensaml version on OpenSaml support classes #10693
Conversation
In OpenSaml support classes the Saml2VersionUtils class is used to check whether a supported version of OpenSaml is found on the classpath. Closes spring-projectsgh-10567
Hi @igorpele, just a heads up that we are discussing this solution and I should get back to you soon. |
Waiting for #10817 to get merged, since the way to verify the OpenSAML version may change |
private static String getVersion() { | ||
String version = Version.getVersion(); | ||
if (version != null) { | ||
return version; | ||
} | ||
return Version.class.getModule().getDescriptor().version().map(Object::toString) | ||
.orElseThrow(() -> new IllegalStateException("cannot determine OpenSAML version")); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have changed the way we check the version, can you change it to:
private static String getVersion() { | |
String version = Version.getVersion(); | |
if (version != null) { | |
return version; | |
} | |
return Version.class.getModule().getDescriptor().version().map(Object::toString) | |
.orElseThrow(() -> new IllegalStateException("cannot determine OpenSAML version")); | |
} | |
private static String getVersion() { | |
String version = Version.getVersion(); | |
if (StringUtils.hasText(version)) { | |
return version; | |
} | |
boolean openSaml4ClassPresent = ClassUtils | |
.isPresent("org.opensaml.core.xml.persist.impl.PassthroughSourceStrategy", null); | |
if (openSaml4ClassPresent) { | |
return OPEN_SAML_4_VERSION; | |
} | |
throw new IllegalStateException("cannot determine OpenSAML version"); | |
} |
There is more detail here
* classpath. | ||
* | ||
* @author Igor Pelesić | ||
* @since 5.7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change it to @since 5.8
?
In OpenSaml support classes the Saml2VersionUtils class is used to check whether a supported version of OpenSaml is found on the classpath. Closes spring-projectsgh-10567
Hi @marcusdacoregio is this ok now? Or can I assume that if the class "org.opensaml.core.xml.persist.impl.PassthroughSourceStrategy" is present on the classpath that the OpenSaml version is higher than 4.1.0? |
Hey @igorpele, thanks for your contribution. Unfortunately, this has not made it into our 5.8 release and we do not have another release planned for the 5.x line. We might still do something like this if we add OpenSAML5 #11658. |
In OpenSaml support classes the Saml2VersionUtils class is used to check whether a supported version of OpenSaml is found on the classpath.
Closes gh-10567