mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
Remove hyphen from asserting-party
spring.security.saml2.relyingparty.registration.*.asserting-party.* is now named spring.security.saml2.relyingparty.registration.*.assertingparty.* Closes gh-30785
This commit is contained in:
parent
3c5cea47d0
commit
b406971094
@ -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));
|
||||
}
|
||||
|
@ -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() {
|
||||
|
@ -203,7 +203,7 @@ class Saml2RelyingPartyRegistrationConfiguration {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private <T> T get(String name, Function<AssertingParty, T> 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;
|
||||
}
|
||||
|
@ -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",
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user