Skip to content

Commit 9ababf4

Browse files
committed
Rename to ServerOAuth2AuthorizedClientExchangeFilterFunction
Rename OAuth2AuthorizedClientExchangeFilterFunction to ServerOAuth2AuthorizedClientExchangeFilterFunction-> Issue: gh-5386
1 parent 1b79bbe commit 9ababf4

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
* @author Rob Winch
5858
* @since 5.1
5959
*/
60-
public final class OAuth2AuthorizedClientExchangeFilterFunction implements ExchangeFilterFunction {
60+
public final class ServerOAuth2AuthorizedClientExchangeFilterFunction implements ExchangeFilterFunction {
6161
/**
6262
* The request attribute name used to locate the {@link OAuth2AuthorizedClient}.
6363
*/
@@ -69,9 +69,9 @@ public final class OAuth2AuthorizedClientExchangeFilterFunction implements Excha
6969

7070
private ReactiveOAuth2AuthorizedClientService authorizedClientService;
7171

72-
public OAuth2AuthorizedClientExchangeFilterFunction() {}
72+
public ServerOAuth2AuthorizedClientExchangeFilterFunction() {}
7373

74-
public OAuth2AuthorizedClientExchangeFilterFunction(ReactiveOAuth2AuthorizedClientService authorizedClientService) {
74+
public ServerOAuth2AuthorizedClientExchangeFilterFunction(ReactiveOAuth2AuthorizedClientService authorizedClientService) {
7575
this.authorizedClientService = authorizedClientService;
7676
}
7777

@@ -97,7 +97,7 @@ public OAuth2AuthorizedClientExchangeFilterFunction(ReactiveOAuth2AuthorizedClie
9797
*
9898
* <ul>
9999
* <li>The ReactiveOAuth2AuthorizedClientService on the
100-
* {@link OAuth2AuthorizedClientExchangeFilterFunction} is not null</li>
100+
* {@link ServerOAuth2AuthorizedClientExchangeFilterFunction} is not null</li>
101101
* <li>A refresh token is present on the OAuth2AuthorizedClient</li>
102102
* <li>The access token will be expired in
103103
* {@link #setAccessTokenExpiresSkew(Duration)}</li>
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,18 @@
6262
import static org.mockito.Mockito.verify;
6363
import static org.mockito.Mockito.when;
6464
import static org.springframework.http.HttpMethod.GET;
65-
import static org.springframework.security.oauth2.client.web.reactive.function.client.OAuth2AuthorizedClientExchangeFilterFunction.oauth2AuthorizedClient;
65+
import static org.springframework.security.oauth2.client.web.reactive.function.client.ServerOAuth2AuthorizedClientExchangeFilterFunction.oauth2AuthorizedClient;
6666

6767
/**
6868
* @author Rob Winch
6969
* @since 5.1
7070
*/
7171
@RunWith(MockitoJUnitRunner.class)
72-
public class OAuth2AuthorizedClientExchangeFilterFunctionTests {
72+
public class ServerOAuth2AuthorizedClientExchangeFilterFunctionTests {
7373
@Mock
7474
private ReactiveOAuth2AuthorizedClientService authorizedClientService;
7575

76-
private OAuth2AuthorizedClientExchangeFilterFunction function = new OAuth2AuthorizedClientExchangeFilterFunction();
76+
private ServerOAuth2AuthorizedClientExchangeFilterFunction function = new ServerOAuth2AuthorizedClientExchangeFilterFunction();
7777

7878
private MockExchangeFunction exchange = new MockExchangeFunction();
7979

@@ -151,7 +151,7 @@ public void filterWhenRefreshRequiredThenRefresh() {
151151
this.accessToken.getTokenValue(),
152152
issuedAt,
153153
accessTokenExpiresAt);
154-
this.function = new OAuth2AuthorizedClientExchangeFilterFunction(this.authorizedClientService);
154+
this.function = new ServerOAuth2AuthorizedClientExchangeFilterFunction(this.authorizedClientService);
155155

156156
OAuth2RefreshToken refreshToken = new OAuth2RefreshToken("refresh-token", issuedAt, refreshTokenExpiresAt);
157157
OAuth2AuthorizedClient authorizedClient = new OAuth2AuthorizedClient(this.github,
@@ -200,7 +200,7 @@ public void filterWhenRefreshRequiredAndEmptyReactiveSecurityContextThenSaved()
200200
this.accessToken.getTokenValue(),
201201
issuedAt,
202202
accessTokenExpiresAt);
203-
this.function = new OAuth2AuthorizedClientExchangeFilterFunction(this.authorizedClientService);
203+
this.function = new ServerOAuth2AuthorizedClientExchangeFilterFunction(this.authorizedClientService);
204204

205205
OAuth2RefreshToken refreshToken = new OAuth2RefreshToken("refresh-token", issuedAt, refreshTokenExpiresAt);
206206
OAuth2AuthorizedClient authorizedClient = new OAuth2AuthorizedClient(this.github,
@@ -232,7 +232,7 @@ public void filterWhenRefreshRequiredAndEmptyReactiveSecurityContextThenSaved()
232232

233233
@Test
234234
public void filterWhenRefreshTokenNullThenShouldRefreshFalse() {
235-
this.function = new OAuth2AuthorizedClientExchangeFilterFunction(this.authorizedClientService);
235+
this.function = new ServerOAuth2AuthorizedClientExchangeFilterFunction(this.authorizedClientService);
236236

237237
OAuth2AuthorizedClient authorizedClient = new OAuth2AuthorizedClient(this.github,
238238
"principalName", this.accessToken);
@@ -254,7 +254,7 @@ public void filterWhenRefreshTokenNullThenShouldRefreshFalse() {
254254

255255
@Test
256256
public void filterWhenNotExpiredThenShouldRefreshFalse() {
257-
this.function = new OAuth2AuthorizedClientExchangeFilterFunction(this.authorizedClientService);
257+
this.function = new ServerOAuth2AuthorizedClientExchangeFilterFunction(this.authorizedClientService);
258258

259259
OAuth2RefreshToken refreshToken = new OAuth2RefreshToken("refresh-token", this.accessToken.getIssuedAt(), this.accessToken.getExpiresAt());
260260
OAuth2AuthorizedClient authorizedClient = new OAuth2AuthorizedClient(this.github,

samples/boot/authcodegrant/src/main/java/sample/config/WebClientConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import org.springframework.context.annotation.Bean;
2020
import org.springframework.context.annotation.Configuration;
21-
import org.springframework.security.oauth2.client.web.reactive.function.client.OAuth2AuthorizedClientExchangeFilterFunction;
21+
import org.springframework.security.oauth2.client.web.reactive.function.client.ServletOAuth2AuthorizedClientExchangeFilterFunction;
2222
import org.springframework.web.reactive.function.client.WebClient;
2323

2424
/**
@@ -31,7 +31,7 @@ public class WebClientConfig {
3131
@Bean
3232
WebClient webClient() {
3333
return WebClient.builder()
34-
.filter(new OAuth2AuthorizedClientExchangeFilterFunction())
34+
.filter(new ServletOAuth2AuthorizedClientExchangeFilterFunction())
3535
.build();
3636
}
3737
}

samples/boot/authcodegrant/src/main/java/sample/web/GitHubReposController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import java.util.List;
2626

27-
import static org.springframework.security.oauth2.client.web.reactive.function.client.OAuth2AuthorizedClientExchangeFilterFunction.oauth2AuthorizedClient;
27+
import static org.springframework.security.oauth2.client.web.reactive.function.client.ServletOAuth2AuthorizedClientExchangeFilterFunction.oauth2AuthorizedClient;
2828

2929
/**
3030
* @author Joe Grandja

0 commit comments

Comments
 (0)