Prepare for Spring Security 5.8

This commit is contained in:
Josh Cummings 2022-05-02 16:13:07 -06:00
parent 5ac5edc2e6
commit 0e9228d10a
No known key found for this signature in database
GPG Key ID: A306A51F43B8E5A5
13 changed files with 5105 additions and 48 deletions

View File

@ -95,7 +95,7 @@ public final class SecurityNamespaceHandler implements NamespaceHandler {
if (!namespaceMatchesVersion(element)) { if (!namespaceMatchesVersion(element)) {
pc.getReaderContext().fatal("You cannot use a spring-security-2.0.xsd or spring-security-3.0.xsd or " pc.getReaderContext().fatal("You cannot use a spring-security-2.0.xsd or spring-security-3.0.xsd or "
+ "spring-security-3.1.xsd schema or spring-security-3.2.xsd schema or spring-security-4.0.xsd schema " + "spring-security-3.1.xsd schema or spring-security-3.2.xsd schema or spring-security-4.0.xsd schema "
+ "with Spring Security 5.7. Please update your schema declarations to the 5.7 schema.", element); + "with Spring Security 5.8. Please update your schema declarations to the 5.8 schema.", element);
} }
String name = pc.getDelegate().getLocalName(element); String name = pc.getDelegate().getLocalName(element);
BeanDefinitionParser parser = this.parsers.get(name); BeanDefinitionParser parser = this.parsers.get(name);
@ -217,7 +217,7 @@ public final class SecurityNamespaceHandler implements NamespaceHandler {
private boolean matchesVersionInternal(Element element) { private boolean matchesVersionInternal(Element element) {
String schemaLocation = element.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "schemaLocation"); String schemaLocation = element.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "schemaLocation");
return schemaLocation.matches("(?m).*spring-security-5\\.7.*.xsd.*") return schemaLocation.matches("(?m).*spring-security-5\\.8.*.xsd.*")
|| schemaLocation.matches("(?m).*spring-security.xsd.*") || schemaLocation.matches("(?m).*spring-security.xsd.*")
|| !schemaLocation.matches("(?m).*spring-security.*"); || !schemaLocation.matches("(?m).*spring-security.*");
} }

View File

@ -1,4 +1,5 @@
http\://www.springframework.org/schema/security/spring-security.xsd=org/springframework/security/config/spring-security-5.7.xsd http\://www.springframework.org/schema/security/spring-security.xsd=org/springframework/security/config/spring-security-5.8.xsd
http\://www.springframework.org/schema/security/spring-security-5.8.xsd=org/springframework/security/config/spring-security-5.8.xsd
http\://www.springframework.org/schema/security/spring-security-5.7.xsd=org/springframework/security/config/spring-security-5.7.xsd http\://www.springframework.org/schema/security/spring-security-5.7.xsd=org/springframework/security/config/spring-security-5.7.xsd
http\://www.springframework.org/schema/security/spring-security-5.6.xsd=org/springframework/security/config/spring-security-5.6.xsd http\://www.springframework.org/schema/security/spring-security-5.6.xsd=org/springframework/security/config/spring-security-5.6.xsd
http\://www.springframework.org/schema/security/spring-security-5.5.xsd=org/springframework/security/config/spring-security-5.5.xsd http\://www.springframework.org/schema/security/spring-security-5.5.xsd=org/springframework/security/config/spring-security-5.5.xsd
@ -18,7 +19,8 @@ http\://www.springframework.org/schema/security/spring-security-2.0.xsd=org/spri
http\://www.springframework.org/schema/security/spring-security-2.0.1.xsd=org/springframework/security/config/spring-security-2.0.1.xsd http\://www.springframework.org/schema/security/spring-security-2.0.1.xsd=org/springframework/security/config/spring-security-2.0.1.xsd
http\://www.springframework.org/schema/security/spring-security-2.0.2.xsd=org/springframework/security/config/spring-security-2.0.2.xsd http\://www.springframework.org/schema/security/spring-security-2.0.2.xsd=org/springframework/security/config/spring-security-2.0.2.xsd
http\://www.springframework.org/schema/security/spring-security-2.0.4.xsd=org/springframework/security/config/spring-security-2.0.4.xsd http\://www.springframework.org/schema/security/spring-security-2.0.4.xsd=org/springframework/security/config/spring-security-2.0.4.xsd
https\://www.springframework.org/schema/security/spring-security.xsd=org/springframework/security/config/spring-security-5.7.xsd https\://www.springframework.org/schema/security/spring-security.xsd=org/springframework/security/config/spring-security-5.8.xsd
https\://www.springframework.org/schema/security/spring-security-5.8.xsd=org/springframework/security/config/spring-security-5.8.xsd
https\://www.springframework.org/schema/security/spring-security-5.7.xsd=org/springframework/security/config/spring-security-5.7.xsd https\://www.springframework.org/schema/security/spring-security-5.7.xsd=org/springframework/security/config/spring-security-5.7.xsd
https\://www.springframework.org/schema/security/spring-security-5.6.xsd=org/springframework/security/config/spring-security-5.6.xsd https\://www.springframework.org/schema/security/spring-security-5.6.xsd=org/springframework/security/config/spring-security-5.6.xsd
https\://www.springframework.org/schema/security/spring-security-5.5.xsd=org/springframework/security/config/spring-security-5.5.xsd https\://www.springframework.org/schema/security/spring-security-5.5.xsd=org/springframework/security/config/spring-security-5.5.xsd

View File

@ -65,7 +65,7 @@ public class XsdDocumentedTests {
String schema31xDocumentLocation = "org/springframework/security/config/spring-security-3.1.xsd"; String schema31xDocumentLocation = "org/springframework/security/config/spring-security-3.1.xsd";
String schemaDocumentLocation = "org/springframework/security/config/spring-security-5.7.xsd"; String schemaDocumentLocation = "org/springframework/security/config/spring-security-5.8.xsd";
XmlSupport xml = new XmlSupport(); XmlSupport xml = new XmlSupport();
@ -150,8 +150,8 @@ public class XsdDocumentedTests {
.getParentFile() .getParentFile()
.list((dir, name) -> name.endsWith(".xsd")); .list((dir, name) -> name.endsWith(".xsd"));
// @formatter:on // @formatter:on
assertThat(schemas.length).isEqualTo(19) assertThat(schemas.length).isEqualTo(20)
.withFailMessage("the count is equal to 19, if not then schemaDocument needs updating"); .withFailMessage("the count is equal to 20, if not then schemaDocument needs updating");
} }
/** /**

View File

@ -43,7 +43,7 @@ public final class SpringSecurityCoreVersion {
* N.B. Classes are not intended to be serializable between different versions. See * N.B. Classes are not intended to be serializable between different versions. See
* SEC-1709 for why we still need a serial version. * SEC-1709 for why we still need a serial version.
*/ */
public static final long SERIAL_VERSION_UID = 570L; public static final long SERIAL_VERSION_UID = 580L;
static final String MIN_SPRING_VERSION = getSpringVersion(); static final String MIN_SPRING_VERSION = getSpringVersion();

View File

@ -9,8 +9,8 @@ content:
- url: https://github.com/spring-io/spring-generated-docs - url: https://github.com/spring-io/spring-generated-docs
branches: [spring-projects/spring-security/*] branches: [spring-projects/spring-security/*]
- url: https://github.com/spring-projects/spring-security - url: https://github.com/spring-projects/spring-security
branches: [main,5.6.x,5.7.x] branches: [main,5.6.x,5.7.x,5.8.x]
tags: ['5.6.*','!5.6.0-M*','5.7.*','6.0.*'] tags: ['5.6.*','!5.6.0-M*','5.7.*','5.8.*','6.0.*']
start_path: docs start_path: docs
urls: urls:
latest_version_segment_strategy: redirect:to latest_version_segment_strategy: redirect:to

View File

@ -1,3 +1,3 @@
name: ROOT name: ROOT
version: '5.7.0' version: '5.8.0'
prerelease: '-SNAPSHOT' prerelease: '-SNAPSHOT'

View File

@ -7,7 +7,7 @@ asciidoc:
content: content:
sources: sources:
- url: https://github.com/spring-io/spring-generated-docs - url: https://github.com/spring-io/spring-generated-docs
branches: [spring-projects/spring-security/5.7.x] branches: [spring-projects/spring-security/5.8.x]
- url: ../ - url: ../
branches: HEAD branches: HEAD
start_path: docs start_path: docs
@ -23,4 +23,4 @@ ui:
antora: antora:
extensions: extensions:
- require: ./antora/extensions/version-fix.js - require: ./antora/extensions/version-fix.js
- require: ./antora/extensions/major-minor-segment.js - require: ./antora/extensions/major-minor-segment.js

View File

@ -6,4 +6,4 @@ This appendix provides a reference to the elements available in the security nam
If you haven't used the namespace before, please read the xref:servlet/configuration/xml-namespace.adoc#ns-config[introductory chapter] on namespace configuration, as this is intended as a supplement to the information there. If you haven't used the namespace before, please read the xref:servlet/configuration/xml-namespace.adoc#ns-config[introductory chapter] on namespace configuration, as this is intended as a supplement to the information there.
Using a good quality XML editor while editing a configuration based on the schema is recommended as this will provide contextual information on which elements and attributes are available as well as comments explaining their purpose. Using a good quality XML editor while editing a configuration based on the schema is recommended as this will provide contextual information on which elements and attributes are available as well as comments explaining their purpose.
The namespace is written in https://relaxng.org/[RELAX NG] Compact format and later converted into an XSD schema. The namespace is written in https://relaxng.org/[RELAX NG] Compact format and later converted into an XSD schema.
If you are familiar with this format, you may wish to examine the https://raw.githubusercontent.com/spring-projects/spring-security/main/config/src/main/resources/org/springframework/security/config/spring-security-5.7.rnc[schema file] directly. If you are familiar with this format, you may wish to examine the https://raw.githubusercontent.com/spring-projects/spring-security/main/config/src/main/resources/org/springframework/security/config/spring-security-5.8.rnc[schema file] directly.

View File

@ -1,37 +1,7 @@
[[new]] [[new]]
= What's New in Spring Security 5.7 = What's New in Spring Security 5.8
Spring Security 5.7 provides a number of new features. Spring Security 5.8 provides a number of new features.
Below are the highlights of the release. Below are the highlights of the release.
[[whats-new-servlet]] [[whats-new-servlet]]
== Servlet
* Web
** Introduced xref:servlet/authentication/persistence.adoc#requestattributesecuritycontextrepository[`RequestAttributeSecurityContextRepository`]
** Introduced xref:servlet/authentication/persistence.adoc#securitycontextholderfilter[`SecurityContextHolderFilter`] - Ability to require explicit saving of the `SecurityContext`
** Added DSL support for xref:servlet/exploits/headers.adoc#servlet-headers-cross-origin-policies[Cross Origin Policies headers]
* OAuth 2.0 Client
** Allow configuring https://github.com/spring-projects/spring-security/issues/6548[PKCE for confidential clients]
** Allow configuring a https://github.com/spring-projects/spring-security/issues/9812[JWT assertion resolver] in `JwtBearerOAuth2AuthorizedClientProvider`
** Allow customizing claims on https://github.com/spring-projects/spring-security/issues/9855[JWT client assertions]
* SAML 2.0
** Added xref:servlet/appendix/namespace/http.adoc#nsa-saml2-login[SAML 2.0 Login & Single Logout XML support]
[[whats-new-webflux]]
== WebFlux
* Web
** Allow customizing https://github.com/spring-projects/spring-security/issues/10903[charset] in `ServerHttpBasicAuthenticationConverter`
** Added DSL support for xref:reactive/exploits/headers.adoc#webflux-headers-cross-origin-policies[Cross Origin Policies headers]
* OAuth 2.0 Client
** Allow configuring https://github.com/spring-projects/spring-security/issues/6548[PKCE for confidential clients]
** Allow configuring a https://github.com/spring-projects/spring-security/issues/9812[JWT assertion resolver] in `JwtBearerReactiveOAuth2AuthorizedClientProvider`

View File

@ -3,7 +3,7 @@ springJavaformatVersion=0.0.31
springBootVersion=2.4.2 springBootVersion=2.4.2
springFrameworkVersion=5.3.19 springFrameworkVersion=5.3.19
openSamlVersion=3.4.6 openSamlVersion=3.4.6
version=5.7.0-SNAPSHOT version=5.8.0-SNAPSHOT
kotlinVersion=1.6.20 kotlinVersion=1.6.20
samplesBranch=5.7.x samplesBranch=5.7.x
org.gradle.jvmargs=-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError org.gradle.jvmargs=-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError

View File

@ -20,7 +20,7 @@
version="2.0"> version="2.0">
<description>Spring Security Authorization Tag Library</description> <description>Spring Security Authorization Tag Library</description>
<tlib-version>5.7</tlib-version> <tlib-version>5.8</tlib-version>
<short-name>security</short-name> <short-name>security</short-name>
<uri>http://www.springframework.org/security/tags</uri> <uri>http://www.springframework.org/security/tags</uri>