From b406971094ce5c39b99d9f49ce1f00d484a80a58 Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Mon, 25 Apr 2022 15:25:21 +0200 Subject: [PATCH] Remove hyphen from asserting-party spring.security.saml2.relyingparty.registration.*.asserting-party.* is now named spring.security.saml2.relyingparty.registration.*.assertingparty.* Closes gh-30785 --- ...agementWebSecurityAutoConfigurationTests.java | 8 ++++---- .../saml2/Saml2RelyingPartyProperties.java | 10 +++++----- ...ml2RelyingPartyRegistrationConfiguration.java | 4 ++-- .../Saml2RelyingPartyAutoConfigurationTests.java | 14 +++++++------- .../saml2/Saml2RelyingPartyPropertiesTests.java | 16 ++++++++-------- .../src/docs/asciidoc/web/spring-security.adoc | 4 ++-- .../src/main/resources/application.yml | 4 ++-- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java index dbe6167992..f1c3df7acf 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/ManagementWebSecurityAutoConfigurationTests.java @@ -136,10 +136,10 @@ class ManagementWebSecurityAutoConfigurationTests { void backOffIfSaml2RelyingPartyAutoConfigurationPresent() { this.contextRunner.withConfiguration(AutoConfigurations.of(Saml2RelyingPartyAutoConfiguration.class)) .withPropertyValues( - "spring.security.saml2.relyingparty.registration.simplesamlphp.asserting-party.single-sign-on.url=https://simplesaml-for-spring-saml/SSOService.php", - "spring.security.saml2.relyingparty.registration.simplesamlphp.asserting-party.single-sign-on.sign-request=false", - "spring.security.saml2.relyingparty.registration.simplesamlphp.asserting-party.entity-id=https://simplesaml-for-spring-saml.cfapps.io/saml2/idp/metadata.php", - "spring.security.saml2.relyingparty.registration.simplesamlphp.asserting-party.verification.credentials[0].certificate-location=classpath:saml/certificate-location") + "spring.security.saml2.relyingparty.registration.simplesamlphp.assertingparty.single-sign-on.url=https://simplesaml-for-spring-saml/SSOService.php", + "spring.security.saml2.relyingparty.registration.simplesamlphp.assertingparty.single-sign-on.sign-request=false", + "spring.security.saml2.relyingparty.registration.simplesamlphp.assertingparty.entity-id=https://simplesaml-for-spring-saml.cfapps.io/saml2/idp/metadata.php", + "spring.security.saml2.relyingparty.registration.simplesamlphp.assertingparty.verification.credentials[0].certificate-location=classpath:saml/certificate-location") .run((context) -> assertThat(context).doesNotHaveBean(ManagementWebSecurityAutoConfiguration.class) .doesNotHaveBean(MANAGEMENT_SECURITY_FILTER_CHAIN_BEAN)); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyProperties.java index 56ce6510aa..29a866f56f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyProperties.java @@ -68,11 +68,11 @@ public class Saml2RelyingPartyProperties { /** * Remote SAML Identity Provider. */ - private final AssertingParty assertingParty = new AssertingParty(); + private final AssertingParty assertingparty = new AssertingParty(); /** * Remote SAML Identity Provider. - * @deprecated use {@link #assertingParty} + * @deprecated use {@link #assertingparty} */ @Deprecated private final AssertingParty identityprovider = new AssertingParty(); @@ -97,14 +97,14 @@ public class Saml2RelyingPartyProperties { return this.decryption; } - public AssertingParty getAssertingParty() { - return this.assertingParty; + public AssertingParty getAssertingparty() { + return this.assertingparty; } /** * Remote SAML Identity Provider. * @return remote SAML Identity Provider - * @deprecated use {@link #getAssertingParty()} + * @deprecated use {@link #getAssertingparty()} */ @Deprecated public AssertingParty getIdentityprovider() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyRegistrationConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyRegistrationConfiguration.java index 6b22cea867..6d09a91715 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyRegistrationConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyRegistrationConfiguration.java @@ -203,7 +203,7 @@ class Saml2RelyingPartyRegistrationConfiguration { @SuppressWarnings("deprecation") private T get(String name, Function getter) { - T newValue = getter.apply(this.registration.getAssertingParty()); + T newValue = getter.apply(this.registration.getAssertingparty()); if (newValue != null) { return newValue; } @@ -211,7 +211,7 @@ class Saml2RelyingPartyRegistrationConfiguration { if (deprecatedValue != null) { logger.warn(LogMessage.format( "Property 'spring.security.saml2.relyingparty.registration.identityprovider.%1$s.%2$s' is deprecated, " - + "please use 'spring.security.saml2.relyingparty.registration.asserting-party.%1$s.%2$s' instead", + + "please use 'spring.security.saml2.relyingparty.registration.assertingparty.%1$s.%2$s' instead", this.id, name)); return deprecatedValue; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyAutoConfigurationTests.java index 8f908de316..0ea9f63075 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyAutoConfigurationTests.java @@ -186,7 +186,7 @@ class Saml2RelyingPartyAutoConfigurationTests { server.start(); String metadataUrl = server.url("").toString(); setupMockResponse(server, new ClassPathResource("saml/idp-metadata")); - this.contextRunner.withPropertyValues(PREFIX + ".foo.asserting-party.metadata-uri=" + metadataUrl) + this.contextRunner.withPropertyValues(PREFIX + ".foo.assertingparty.metadata-uri=" + metadataUrl) .run((context) -> { assertThat(context).hasSingleBean(RelyingPartyRegistrationRepository.class); assertThat(server.getRequestCount()).isEqualTo(1); @@ -215,7 +215,7 @@ class Saml2RelyingPartyAutoConfigurationTests { server.start(); String metadataUrl = server.url("").toString(); setupMockResponse(server, new ClassPathResource("saml/idp-metadata")); - this.contextRunner.withPropertyValues(PREFIX + ".foo.asserting-party.metadata-uri=" + metadataUrl) + this.contextRunner.withPropertyValues(PREFIX + ".foo.assertingparty.metadata-uri=" + metadataUrl) .run((context) -> { RelyingPartyRegistrationRepository repository = context .getBean(RelyingPartyRegistrationRepository.class); @@ -250,8 +250,8 @@ class Saml2RelyingPartyAutoConfigurationTests { server.start(); String metadataUrl = server.url("").toString(); setupMockResponse(server, new ClassPathResource("saml/idp-metadata")); - this.contextRunner.withPropertyValues(PREFIX + ".foo.asserting-party.metadata-uri=" + metadataUrl, - PREFIX + ".foo.asserting-party.singlesignon.binding=redirect").run((context) -> { + this.contextRunner.withPropertyValues(PREFIX + ".foo.assertingparty.metadata-uri=" + metadataUrl, + PREFIX + ".foo.assertingparty.singlesignon.binding=redirect").run((context) -> { RelyingPartyRegistrationRepository repository = context .getBean(RelyingPartyRegistrationRepository.class); RelyingPartyRegistration registration = repository.findByRegistrationId("foo"); @@ -378,7 +378,7 @@ class Saml2RelyingPartyAutoConfigurationTests { } private String[] getPropertyValuesWithoutSigningCredentials(boolean signRequests, boolean useDeprecated) { - String assertingParty = useDeprecated ? "identityprovider" : "asserting-party"; + String assertingParty = useDeprecated ? "identityprovider" : "assertingparty"; return new String[] { PREFIX + ".foo." + assertingParty + ".singlesignon.url=https://simplesaml-for-spring-saml.cfapps.io/saml2/idp/SSOService.php", @@ -391,7 +391,7 @@ class Saml2RelyingPartyAutoConfigurationTests { } private String[] getPropertyValuesWithoutSsoBinding(boolean useDeprecated) { - String assertingParty = useDeprecated ? "identityprovider" : "asserting-party"; + String assertingParty = useDeprecated ? "identityprovider" : "assertingparty"; return new String[] { PREFIX + ".foo." + assertingParty + ".singlesignon.url=https://simplesaml-for-spring-saml.cfapps.io/saml2/idp/SSOService.php", @@ -403,7 +403,7 @@ class Saml2RelyingPartyAutoConfigurationTests { } private String[] getPropertyValues(boolean useDeprecated) { - String assertingParty = useDeprecated ? "identityprovider" : "asserting-party"; + String assertingParty = useDeprecated ? "identityprovider" : "assertingparty"; return new String[] { PREFIX + ".foo.signing.credentials[0].private-key-location=classpath:saml/private-key-location", PREFIX + ".foo.signing.credentials[0].certificate-location=classpath:saml/certificate-location", diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyPropertiesTests.java index e395e7d639..4788203026 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/saml2/Saml2RelyingPartyPropertiesTests.java @@ -41,26 +41,26 @@ class Saml2RelyingPartyPropertiesTests { @Test void customizeSsoUrl() { - bind("spring.security.saml2.relyingparty.registration.simplesamlphp.asserting-party.single-sign-on.url", + bind("spring.security.saml2.relyingparty.registration.simplesamlphp.assertingparty.single-sign-on.url", "https://simplesaml-for-spring-saml/SSOService.php"); assertThat( - this.properties.getRegistration().get("simplesamlphp").getAssertingParty().getSinglesignon().getUrl()) + this.properties.getRegistration().get("simplesamlphp").getAssertingparty().getSinglesignon().getUrl()) .isEqualTo("https://simplesaml-for-spring-saml/SSOService.php"); } @Test void customizeSsoBinding() { - bind("spring.security.saml2.relyingparty.registration.simplesamlphp.asserting-party.single-sign-on.binding", + bind("spring.security.saml2.relyingparty.registration.simplesamlphp.assertingparty.single-sign-on.binding", "post"); - assertThat(this.properties.getRegistration().get("simplesamlphp").getAssertingParty().getSinglesignon() + assertThat(this.properties.getRegistration().get("simplesamlphp").getAssertingparty().getSinglesignon() .getBinding()).isEqualTo(Saml2MessageBinding.POST); } @Test void customizeSsoSignRequests() { - bind("spring.security.saml2.relyingparty.registration.simplesamlphp.asserting-party.single-sign-on.sign-request", + bind("spring.security.saml2.relyingparty.registration.simplesamlphp.assertingparty.single-sign-on.sign-request", "false"); - assertThat(this.properties.getRegistration().get("simplesamlphp").getAssertingParty().getSinglesignon() + assertThat(this.properties.getRegistration().get("simplesamlphp").getAssertingparty().getSinglesignon() .getSignRequest()).isEqualTo(false); } @@ -80,9 +80,9 @@ class Saml2RelyingPartyPropertiesTests { @Test void customizeAssertingPartyMetadataUri() { - bind("spring.security.saml2.relyingparty.registration.simplesamlphp.asserting-party.metadata-uri", + bind("spring.security.saml2.relyingparty.registration.simplesamlphp.assertingparty.metadata-uri", "https://idp.example.org/metadata"); - assertThat(this.properties.getRegistration().get("simplesamlphp").getAssertingParty().getMetadataUri()) + assertThat(this.properties.getRegistration().get("simplesamlphp").getAssertingparty().getMetadataUri()) .isEqualTo("https://idp.example.org/metadata"); } diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/spring-security.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/spring-security.adoc index c7c95443d1..e82be55180 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/spring-security.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/spring-security.adoc @@ -262,7 +262,7 @@ You can register multiple relying parties under the `spring.security.saml2.relyi credentials: - private-key-location: "path-to-private-key" certificate-location: "path-to-certificate" - asserting-party: + assertingparty: verification: credentials: - certificate-location: "path-to-verification-cert" @@ -278,7 +278,7 @@ You can register multiple relying parties under the `spring.security.saml2.relyi credentials: - private-key-location: "path-to-private-key" certificate-location: "path-to-certificate" - asserting-party: + assertingparty: verification: credentials: - certificate-location: "path-to-other-verification-cert" diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-saml2-service-provider/src/main/resources/application.yml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-saml2-service-provider/src/main/resources/application.yml index 83ac8e90b3..2f40f2db78 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-saml2-service-provider/src/main/resources/application.yml +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-saml2-service-provider/src/main/resources/application.yml @@ -8,7 +8,7 @@ spring: credentials: - private-key-location: "classpath:saml/privatekey.txt" certificate-location: "classpath:saml/certificate.txt" - asserting-party: + assertingparty: verification: credentials: - certificate-location: "classpath:saml/certificate.txt" @@ -21,7 +21,7 @@ spring: credentials: - private-key-location: "classpath:saml/privatekey.txt" certificate-location: "classpath:saml/certificate.txt" - asserting-party: + assertingparty: verification: credentials: - certificate-location: "classpath:saml/certificate.txt"