Skip to content

Commit 543dbdc

Browse files
committed
Create spring-boot-security-saml2 module
1 parent 55868b5 commit 543dbdc

File tree

25 files changed

+72
-21
lines changed

25 files changed

+72
-21
lines changed

Diff for: settings.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ include "spring-boot-project:spring-boot-security"
104104
include "spring-boot-project:spring-boot-security-oauth2-authorization-server"
105105
include "spring-boot-project:spring-boot-security-oauth2-client"
106106
include "spring-boot-project:spring-boot-security-oauth2-resource-server"
107+
include "spring-boot-project:spring-boot-security-saml2"
107108
include "spring-boot-project:spring-boot-sendgrid"
108109
include "spring-boot-project:spring-boot-test"
109110
include "spring-boot-project:spring-boot-test-autoconfigure"

Diff for: spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle

+9
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ plugins {
99

1010
description = "Spring Boot Actuator AutoConfigure"
1111

12+
configurations.all {
13+
resolutionStrategy.eachDependency {
14+
if (it.requested.group == 'org.opensaml') {
15+
it.useVersion '4.0.1'
16+
}
17+
}
18+
}
19+
1220
dependencies {
1321
api(project(":spring-boot-project:spring-boot-actuator"))
1422
api(project(":spring-boot-project:spring-boot-all"))
@@ -50,6 +58,7 @@ dependencies {
5058
optional(project(":spring-boot-project:spring-boot-reactor-netty"))
5159
optional(project(":spring-boot-project:spring-boot-security-oauth2-client"))
5260
optional(project(":spring-boot-project:spring-boot-security-oauth2-resource-server"))
61+
optional(project(":spring-boot-project:spring-boot-security-saml2"))
5362
optional(project(":spring-boot-project:spring-boot-tomcat"))
5463
optional(project(":spring-boot-project:spring-boot-undertow"))
5564
optional(project(":spring-boot-project:spring-boot-validation"))

Diff for: spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
*/
5050
@AutoConfiguration(before = SecurityAutoConfiguration.class,
5151
after = { HealthEndpointAutoConfiguration.class, InfoEndpointAutoConfiguration.class },
52-
afterName = { "org.springframework.boot.security.autoconfigure.saml2.Saml2RelyingPartyAutoConfiguration",
52+
afterName = { "org.springframework.boot.security.saml2.autoconfigure.Saml2RelyingPartyAutoConfiguration",
5353
"org.springframework.boot.security.oauth2.client.autoconfigure.servlet.OAuth2ClientAutoConfiguration",
5454
"org.springframework.boot.security.oauth2.server.resource.autoconfigure.servlet.OAuth2ResourceServerAutoConfiguration" })
5555
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)

Diff for: spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
import org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration;
3131
import org.springframework.boot.autoconfigure.AutoConfigurations;
3232
import org.springframework.boot.security.autoconfigure.SecurityProperties;
33-
import org.springframework.boot.security.autoconfigure.saml2.Saml2RelyingPartyAutoConfiguration;
3433
import org.springframework.boot.security.autoconfigure.servlet.SecurityAutoConfiguration;
3534
import org.springframework.boot.security.oauth2.server.resource.autoconfigure.servlet.OAuth2ResourceServerAutoConfiguration;
35+
import org.springframework.boot.security.saml2.autoconfigure.Saml2RelyingPartyAutoConfiguration;
3636
import org.springframework.boot.test.context.FilteredClassLoader;
3737
import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext;
3838
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;

Diff for: spring-boot-project/spring-boot-docs/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ dependencies {
109109
autoConfiguration(project(path: ":spring-boot-project:spring-boot-security-oauth2-authorization-server", configuration: "autoConfigurationMetadata"))
110110
autoConfiguration(project(path: ":spring-boot-project:spring-boot-security-oauth2-client", configuration: "autoConfigurationMetadata"))
111111
autoConfiguration(project(path: ":spring-boot-project:spring-boot-security-oauth2-resource-server", configuration: "autoConfigurationMetadata"))
112+
autoConfiguration(project(path: ":spring-boot-project:spring-boot-security-saml2", configuration: "autoConfigurationMetadata"))
112113
autoConfiguration(project(path: ":spring-boot-project:spring-boot-sendgrid", configuration: "autoConfigurationMetadata"))
113114
autoConfiguration(project(path: ":spring-boot-project:spring-boot-testcontainers", configuration: "autoConfigurationMetadata"))
114115
autoConfiguration(project(path: ":spring-boot-project:spring-boot-thymeleaf", configuration: "autoConfigurationMetadata"))
@@ -176,6 +177,7 @@ dependencies {
176177
configurationProperties(project(path: ":spring-boot-project:spring-boot-security-oauth2-authorization-server", configuration: "configurationPropertiesMetadata"))
177178
configurationProperties(project(path: ":spring-boot-project:spring-boot-security-oauth2-client", configuration: "configurationPropertiesMetadata"))
178179
configurationProperties(project(path: ":spring-boot-project:spring-boot-security-oauth2-resource-server", configuration: "configurationPropertiesMetadata"))
180+
configurationProperties(project(path: ":spring-boot-project:spring-boot-security-saml2", configuration: "configurationPropertiesMetadata"))
179181
configurationProperties(project(path: ":spring-boot-project:spring-boot-sendgrid", configuration: "configurationPropertiesMetadata"))
180182
configurationProperties(project(path: ":spring-boot-project:spring-boot-test-autoconfigure", configuration: "configurationPropertiesMetadata"))
181183
configurationProperties(project(path: ":spring-boot-project:spring-boot-testcontainers", configuration: "configurationPropertiesMetadata"))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
plugins {
2+
id "java-library"
3+
id "org.springframework.boot.auto-configuration"
4+
id "org.springframework.boot.configuration-properties"
5+
id "org.springframework.boot.deployed"
6+
id "org.springframework.boot.optional-dependencies"
7+
}
8+
9+
description = "Spring Boot Security SAML2"
10+
11+
configurations.all {
12+
resolutionStrategy.eachDependency {
13+
if (it.requested.group == 'org.opensaml') {
14+
it.useVersion '4.0.1'
15+
}
16+
}
17+
}
18+
19+
dependencies {
20+
api(project(":spring-boot-project:spring-boot"))
21+
api("org.springframework.security:spring-security-saml2-service-provider")
22+
23+
implementation(project(":spring-boot-project:spring-boot-security"))
24+
25+
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
26+
27+
testImplementation(project(":spring-boot-project:spring-boot-test"))
28+
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
29+
testImplementation(project(":spring-boot-project:spring-boot-webmvc"))
30+
testImplementation("com.fasterxml.jackson.core:jackson-databind")
31+
testImplementation("com.squareup.okhttp3:mockwebserver")
32+
testImplementation("jakarta.servlet:jakarta.servlet-api")
33+
34+
testRuntimeOnly("ch.qos.logback:logback-classic")
35+
}
+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.security.autoconfigure.saml2;
17+
package org.springframework.boot.security.saml2.autoconfigure;
1818

1919
import java.util.Collections;
2020
import java.util.Map;
@@ -24,7 +24,7 @@
2424
import org.springframework.boot.autoconfigure.condition.SpringBootCondition;
2525
import org.springframework.boot.context.properties.bind.Bindable;
2626
import org.springframework.boot.context.properties.bind.Binder;
27-
import org.springframework.boot.security.autoconfigure.saml2.Saml2RelyingPartyProperties.Registration;
27+
import org.springframework.boot.security.saml2.autoconfigure.Saml2RelyingPartyProperties.Registration;
2828
import org.springframework.context.annotation.ConditionContext;
2929
import org.springframework.core.env.Environment;
3030
import org.springframework.core.type.AnnotatedTypeMetadata;
+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.security.autoconfigure.saml2;
17+
package org.springframework.boot.security.saml2.autoconfigure;
1818

1919
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
2020
import org.springframework.boot.security.autoconfigure.ConditionalOnDefaultWebSecurity;
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.security.autoconfigure.saml2;
17+
package org.springframework.boot.security.saml2.autoconfigure;
1818

1919
import org.springframework.boot.autoconfigure.AutoConfiguration;
2020
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.security.autoconfigure.saml2;
17+
package org.springframework.boot.security.saml2.autoconfigure;
1818

1919
import java.util.ArrayList;
2020
import java.util.LinkedHashMap;
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.security.autoconfigure.saml2;
17+
package org.springframework.boot.security.saml2.autoconfigure;
1818

1919
import java.io.InputStream;
2020
import java.security.PrivateKey;
@@ -27,11 +27,11 @@
2727

2828
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
2929
import org.springframework.boot.context.properties.PropertyMapper;
30-
import org.springframework.boot.security.autoconfigure.saml2.Saml2RelyingPartyProperties.AssertingParty;
31-
import org.springframework.boot.security.autoconfigure.saml2.Saml2RelyingPartyProperties.AssertingParty.Verification;
32-
import org.springframework.boot.security.autoconfigure.saml2.Saml2RelyingPartyProperties.Decryption;
33-
import org.springframework.boot.security.autoconfigure.saml2.Saml2RelyingPartyProperties.Registration;
34-
import org.springframework.boot.security.autoconfigure.saml2.Saml2RelyingPartyProperties.Registration.Signing;
30+
import org.springframework.boot.security.saml2.autoconfigure.Saml2RelyingPartyProperties.AssertingParty;
31+
import org.springframework.boot.security.saml2.autoconfigure.Saml2RelyingPartyProperties.AssertingParty.Verification;
32+
import org.springframework.boot.security.saml2.autoconfigure.Saml2RelyingPartyProperties.Decryption;
33+
import org.springframework.boot.security.saml2.autoconfigure.Saml2RelyingPartyProperties.Registration;
34+
import org.springframework.boot.security.saml2.autoconfigure.Saml2RelyingPartyProperties.Registration.Signing;
3535
import org.springframework.boot.ssl.pem.PemContent;
3636
import org.springframework.context.annotation.Bean;
3737
import org.springframework.context.annotation.Conditional;

Diff for: spring-boot-project/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/saml2/package-info.java renamed to spring-boot-project/spring-boot-security-saml2/src/main/java/org/springframework/boot/security/saml2/autoconfigure/package-info.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
/**
1818
* Auto-configuration for Spring Security's SAML 2.0.
1919
*/
20-
package org.springframework.boot.security.autoconfigure.saml2;
20+
package org.springframework.boot.security.saml2.autoconfigure;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"groups": [],
3+
"properties": []
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.springframework.boot.security.saml2.autoconfigure.Saml2RelyingPartyAutoConfiguration
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.security.autoconfigure.saml2;
17+
package org.springframework.boot.security.saml2.autoconfigure;
1818

1919
import java.io.InputStream;
2020
import java.util.List;
@@ -280,8 +280,8 @@ void signRequestShouldApplyIfMetadataUriIsSet() throws Exception {
280280
setupMockResponse(server, new ClassPathResource("idp-metadata"));
281281
this.contextRunner.withPropertyValues(PREFIX + ".foo.assertingparty.metadata-uri=" + metadataUrl,
282282
PREFIX + ".foo.assertingparty.singlesignon.sign-request=true",
283-
PREFIX + ".foo.signing.credentials[0].private-key-location=classpath:org/springframework/boot/security/autoconfigure/saml2/rsa.key",
284-
PREFIX + ".foo.signing.credentials[0].certificate-location=classpath:org/springframework/boot/security/autoconfigure/saml2/rsa.crt")
283+
PREFIX + ".foo.signing.credentials[0].private-key-location=classpath:org/springframework/boot/security/saml2/autoconfigure/rsa.key",
284+
PREFIX + ".foo.signing.credentials[0].certificate-location=classpath:org/springframework/boot/security/saml2/autoconfigure/rsa.crt")
285285
.run((context) -> {
286286
RelyingPartyRegistrationRepository repository = context
287287
.getBean(RelyingPartyRegistrationRepository.class);
+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.security.autoconfigure.saml2;
17+
package org.springframework.boot.security.saml2.autoconfigure;
1818

1919
import java.util.Collections;
2020
import java.util.Map;

Diff for: spring-boot-project/spring-boot-security/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ dependencies {
3232
optional("org.springframework.security:spring-security-data")
3333
optional("org.springframework.security:spring-security-messaging")
3434
optional("org.springframework.security:spring-security-rsocket")
35-
optional("org.springframework.security:spring-security-saml2-service-provider")
3635

3736
testImplementation(project(":spring-boot-project:spring-boot-http"))
3837
testImplementation(project(":spring-boot-project:spring-boot-jackson"))
@@ -46,6 +45,7 @@ dependencies {
4645
testImplementation("org.springframework.security:spring-security-oauth2-client")
4746
testImplementation("org.springframework.security:spring-security-oauth2-jose")
4847
testImplementation("org.springframework.security:spring-security-oauth2-resource-server")
48+
testImplementation("org.springframework.security:spring-security-saml2-service-provider")
4949

5050
testRuntimeOnly("ch.qos.logback:logback-classic")
5151
testRuntimeOnly("com.zaxxer:HikariCP")
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
org.springframework.boot.security.autoconfigure.reactive.ReactiveSecurityAutoConfiguration
22
org.springframework.boot.security.autoconfigure.reactive.ReactiveUserDetailsServiceAutoConfiguration
33
org.springframework.boot.security.autoconfigure.rsocket.RSocketSecurityAutoConfiguration
4-
org.springframework.boot.security.autoconfigure.saml2.Saml2RelyingPartyAutoConfiguration
54
org.springframework.boot.security.autoconfigure.servlet.SecurityAutoConfiguration
65
org.springframework.boot.security.autoconfigure.servlet.UserDetailsServiceAutoConfiguration
76
org.springframework.boot.security.autoconfigure.servlet.SecurityFilterAutoConfiguration

Diff for: spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-saml2-service-provider/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ configurations.all {
1515
dependencies {
1616
implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-security"))
1717
implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web"))
18-
implementation("org.springframework.security:spring-security-saml2-service-provider")
18+
implementation(project(":spring-boot-project:spring-boot-security-saml2"))
1919

2020
testImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
2121
testImplementation("org.apache.httpcomponents.client5:httpclient5")

0 commit comments

Comments
 (0)