Skip to content
This repository was archived by the owner on May 31, 2022. It is now read-only.

Commit fb3073b

Browse files
committed
URL Cleanup
1 parent 003efaf commit fb3073b

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

spring-security-oauth2-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/OAuth2AutoConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ public void resourceServerConditionWhenJwkConfigurationPresentShouldMatch()
399399
throws Exception {
400400
this.context = new AnnotationConfigServletWebServerApplicationContext();
401401
TestPropertyValues
402-
.of("security.oauth2.resource.jwk.key-set-uri:http://my-auth-server/token_keys")
402+
.of("security.oauth2.resource.jwk.key-set-uri:https://idp.example.com/token_keys")
403403
.applyTo(this.context);
404404
this.context.register(ResourceServerConfiguration.class,
405405
MinimalSecureWebApplication.class);

spring-security-oauth2-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/ResourceServerPropertiesTests.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public void validateWhenClientIdNullShouldNotFail() throws Exception {
7474

7575
@Test
7676
public void validateWhenBothJwtAndJwkKeyUrisPresentShouldFail() throws Exception {
77-
this.properties.getJwk().setKeySetUri("http://my-auth-server/token_keys");
78-
this.properties.getJwt().setKeyUri("http://my-auth-server/token_key");
77+
this.properties.getJwk().setKeySetUri("https://idp.example.com/token_keys");
78+
this.properties.getJwt().setKeyUri("https://idp.example.com/token_key");
7979
setListableBeanFactory();
8080
this.thrown.expect(IllegalStateException.class);
8181
this.thrown.expect(getMatcher("Only one of jwt.keyUri (or jwt.keyValue) "
@@ -86,7 +86,7 @@ public void validateWhenBothJwtAndJwkKeyUrisPresentShouldFail() throws Exception
8686
@Test
8787
public void validateWhenBothJwtKeyValueAndJwkKeyUriPresentShouldFail()
8888
throws Exception {
89-
this.properties.getJwk().setKeySetUri("http://my-auth-server/token_keys");
89+
this.properties.getJwk().setKeySetUri("https://idp.example.com/token_keys");
9090
this.properties.getJwt().setKeyValue("my-key");
9191
setListableBeanFactory();
9292
this.thrown.expect(IllegalStateException.class);
@@ -97,7 +97,7 @@ public void validateWhenBothJwtKeyValueAndJwkKeyUriPresentShouldFail()
9797

9898
@Test
9999
public void validateWhenJwkKeySetUriProvidedShouldSucceed() throws Exception {
100-
this.properties.getJwk().setKeySetUri("http://my-auth-server/token_keys");
100+
this.properties.getJwk().setKeySetUri("https://idp.example.com/token_keys");
101101
setListableBeanFactory();
102102
this.properties.validate();
103103
verifyZeroInteractions(this.errors);
@@ -115,7 +115,7 @@ public void validateWhenKeyValuePresentShouldSucceed() throws Exception {
115115
public void validateWhenKeysUriOrValuePresentAndUserInfoAbsentShouldNotFail()
116116
throws Exception {
117117
this.properties = new ResourceServerProperties("client", "");
118-
this.properties.getJwk().setKeySetUri("http://my-auth-server/token_keys");
118+
this.properties.getJwk().setKeySetUri("https://idp.example.com/token_keys");
119119
setListableBeanFactory();
120120
this.properties.validate();
121121
verifyZeroInteractions(this.errors);
@@ -133,15 +133,15 @@ public void validateWhenKeyConfigAbsentAndInfoUrisNotConfiguredShouldFail()
133133

134134
@Test
135135
public void validateWhenTokenUriConfiguredShouldNotFail() throws Exception {
136-
this.properties.setTokenInfoUri("http://my-auth-server/userinfo");
136+
this.properties.setTokenInfoUri("https://idp.example.com/userinfo");
137137
setListableBeanFactory();
138138
this.properties.validate();
139139
verifyZeroInteractions(this.errors);
140140
}
141141

142142
@Test
143143
public void validateWhenUserInfoUriConfiguredShouldNotFail() throws Exception {
144-
this.properties.setUserInfoUri("http://my-auth-server/userinfo");
144+
this.properties.setUserInfoUri("https://idp.example.com/userinfo");
145145
setListableBeanFactory();
146146
this.properties.validate();
147147
verifyZeroInteractions(this.errors);
@@ -151,8 +151,8 @@ public void validateWhenUserInfoUriConfiguredShouldNotFail() throws Exception {
151151
public void validateWhenTokenUriPreferredAndClientSecretAbsentShouldFail()
152152
throws Exception {
153153
this.properties = new ResourceServerProperties("client", "");
154-
this.properties.setTokenInfoUri("http://my-auth-server/check_token");
155-
this.properties.setUserInfoUri("http://my-auth-server/userinfo");
154+
this.properties.setTokenInfoUri("https://idp.example.com/check_token");
155+
this.properties.setUserInfoUri("https://idp.example.com/userinfo");
156156
setListableBeanFactory();
157157
this.thrown.expect(IllegalStateException.class);
158158
this.thrown.expect(getMatcher("Missing client secret", "clientSecret"));
@@ -163,7 +163,7 @@ public void validateWhenTokenUriPreferredAndClientSecretAbsentShouldFail()
163163
public void validateWhenTokenUriAbsentAndClientSecretAbsentShouldNotFail()
164164
throws Exception {
165165
this.properties = new ResourceServerProperties("client", "");
166-
this.properties.setUserInfoUri("http://my-auth-server/userinfo");
166+
this.properties.setUserInfoUri("https://idp.example.com/userinfo");
167167
setListableBeanFactory();
168168
this.properties.validate();
169169
verifyZeroInteractions(this.errors);
@@ -174,8 +174,8 @@ public void validateWhenTokenUriNotPreferredAndClientSecretAbsentShouldNotFail()
174174
throws Exception {
175175
this.properties = new ResourceServerProperties("client", "");
176176
this.properties.setPreferTokenInfo(false);
177-
this.properties.setTokenInfoUri("http://my-auth-server/check_token");
178-
this.properties.setUserInfoUri("http://my-auth-server/userinfo");
177+
this.properties.setTokenInfoUri("https://idp.example.com/check_token");
178+
this.properties.setUserInfoUri("https://idp.example.com/userinfo");
179179
setListableBeanFactory();
180180
this.properties.validate();
181181
verifyZeroInteractions(this.errors);

spring-security-oauth2-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/ResourceServerTokenServicesConfigurationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public void asymmetricJwt() {
210210
@Test
211211
public void jwkConfiguration() throws Exception {
212212
TestPropertyValues
213-
.of("security.oauth2.resource.jwk.key-set-uri=http://my-auth-server/token_keys")
213+
.of("security.oauth2.resource.jwk.key-set-uri=https://idp.example.com/token_keys")
214214
.applyTo(this.environment);
215215
this.context = new SpringApplicationBuilder(ResourceConfiguration.class)
216216
.environment(this.environment).web(WebApplicationType.NONE).run();
@@ -264,7 +264,7 @@ public void jwtAccessTokenConverterIsConfiguredWhenKeyUriIsProvided() {
264264
@Test
265265
public void jwkTokenStoreShouldBeConditionalOnMissingBean() throws Exception {
266266
TestPropertyValues
267-
.of("security.oauth2.resource.jwk.key-set-uri=http://my-auth-server/token_keys")
267+
.of("security.oauth2.resource.jwk.key-set-uri=https://idp.example.com/token_keys")
268268
.applyTo(this.environment);
269269
this.context = new SpringApplicationBuilder(JwkTokenStoreConfiguration.class,
270270
ResourceConfiguration.class).environment(this.environment)

0 commit comments

Comments
 (0)