mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-10-24 03:08:49 +00:00
Simplify Error Message for Unsupported Security XSD Versions
Closes gh-17153 Signed-off-by: Deep Dhamala <dhamaladeep2@gmail.com>
This commit is contained in:
parent
2fbe8dd8f6
commit
ca557a9880
@ -94,9 +94,7 @@ public final class SecurityNamespaceHandler implements NamespaceHandler {
|
|||||||
public BeanDefinition parse(Element element, ParserContext pc) {
|
public BeanDefinition parse(Element element, ParserContext pc) {
|
||||||
if (!namespaceMatchesVersion(element)) {
|
if (!namespaceMatchesVersion(element)) {
|
||||||
pc.getReaderContext()
|
pc.getReaderContext()
|
||||||
.fatal("You cannot use a spring-security-2.0.xsd or spring-security-3.0.xsd or "
|
.fatal("You cannot use any XSD older than spring-security-7.0.xsd. Either change to spring-security.xsd or spring-security-7.0.xsd",
|
||||||
+ "spring-security-3.1.xsd schema or spring-security-3.2.xsd schema or spring-security-4.0.xsd schema "
|
|
||||||
+ "with Spring Security 7.0. Please update your schema declarations to the 7.0 schema.",
|
|
||||||
element);
|
element);
|
||||||
}
|
}
|
||||||
String name = pc.getDelegate().getLocalName(element);
|
String name = pc.getDelegate().getLocalName(element);
|
||||||
|
|||||||
@ -77,7 +77,8 @@ public class SecurityNamespaceHandlerTests {
|
|||||||
.isThrownBy(() -> new InMemoryXmlApplicationContext(
|
.isThrownBy(() -> new InMemoryXmlApplicationContext(
|
||||||
"<user-service id='us'><user name='bob' password='bobspassword' authorities='ROLE_A' /></user-service>",
|
"<user-service id='us'><user name='bob' password='bobspassword' authorities='ROLE_A' /></user-service>",
|
||||||
"3.0.3", null))
|
"3.0.3", null))
|
||||||
.withMessageContaining("You cannot use a spring-security-2.0.xsd");
|
.withMessageContaining(
|
||||||
|
"You cannot use any XSD older than spring-security-7.0.xsd. Either change to spring-security.xsd or spring-security-7.0.xsd");
|
||||||
}
|
}
|
||||||
|
|
||||||
// SEC-1868
|
// SEC-1868
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user