Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
9fc3ac7d
Commit
9fc3ac7d
authored
Mar 26, 2019
by
Spring Operator
Committed by
Andy Wilkinson
Mar 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use HTTPS for external links wherever possible
See gh-16320
parent
864942ad
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
48 additions
and
48 deletions
+48
-48
WebClientMetricsConfigurationTests.java
...etrics/web/client/WebClientMetricsConfigurationTests.java
+2
-2
DefaultWebClientExchangeTagsProviderTests.java
...ive/client/DefaultWebClientExchangeTagsProviderTests.java
+3
-3
MetricsWebClientFilterFunctionTests.java
.../reactive/client/MetricsWebClientFilterFunctionTests.java
+5
-5
WebClientExchangeTagsTests.java
...trics/web/reactive/client/WebClientExchangeTagsTests.java
+4
-4
OAuth2ClientPropertiesRegistrationAdapterTests.java
...lient/OAuth2ClientPropertiesRegistrationAdapterTests.java
+10
-10
ReactiveOAuth2ClientAutoConfigurationTests.java
.../reactive/ReactiveOAuth2ClientAutoConfigurationTests.java
+4
-4
ReactiveOAuth2ResourceServerAutoConfigurationTests.java
...e/ReactiveOAuth2ResourceServerAutoConfigurationTests.java
+8
-8
OAuth2ResourceServerAutoConfigurationTests.java
...e/servlet/OAuth2ResourceServerAutoConfigurationTests.java
+7
-7
howto.adoc
...oot-project/spring-boot-docs/src/main/asciidoc/howto.adoc
+1
-1
production-ready-features.adoc
...oot-docs/src/main/asciidoc/production-ready-features.adoc
+2
-2
spring-boot-features.adoc
...ing-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+1
-1
README.adoc
spring-boot-project/spring-boot-starters/README.adoc
+1
-1
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/WebClientMetricsConfigurationTests.java
View file @
9fc3ac7d
...
@@ -108,7 +108,7 @@ public class WebClientMetricsConfigurationTests {
...
@@ -108,7 +108,7 @@ public class WebClientMetricsConfigurationTests {
WebClient
webClient
=
mockWebClient
(
context
.
getBean
(
WebClient
.
Builder
.
class
));
WebClient
webClient
=
mockWebClient
(
context
.
getBean
(
WebClient
.
Builder
.
class
));
MeterRegistry
registry
=
context
.
getBean
(
MeterRegistry
.
class
);
MeterRegistry
registry
=
context
.
getBean
(
MeterRegistry
.
class
);
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
webClient
.
get
().
uri
(
"http://example.org/projects/"
+
i
).
exchange
()
webClient
.
get
().
uri
(
"http
s
://example.org/projects/"
+
i
).
exchange
()
.
block
(
Duration
.
ofSeconds
(
30
));
.
block
(
Duration
.
ofSeconds
(
30
));
}
}
return
registry
;
return
registry
;
...
@@ -117,7 +117,7 @@ public class WebClientMetricsConfigurationTests {
...
@@ -117,7 +117,7 @@ public class WebClientMetricsConfigurationTests {
private
void
validateWebClient
(
WebClient
.
Builder
builder
,
MeterRegistry
registry
)
{
private
void
validateWebClient
(
WebClient
.
Builder
builder
,
MeterRegistry
registry
)
{
WebClient
webClient
=
mockWebClient
(
builder
);
WebClient
webClient
=
mockWebClient
(
builder
);
assertThat
(
registry
.
find
(
"http.client.requests"
).
meter
()).
isNull
();
assertThat
(
registry
.
find
(
"http.client.requests"
).
meter
()).
isNull
();
webClient
.
get
().
uri
(
"http://example.org/projects/{project}"
,
"spring-boot"
)
webClient
.
get
().
uri
(
"http
s
://example.org/projects/{project}"
,
"spring-boot"
)
.
exchange
().
block
(
Duration
.
ofSeconds
(
30
));
.
exchange
().
block
(
Duration
.
ofSeconds
(
30
));
assertThat
(
registry
.
find
(
"http.client.requests"
)
assertThat
(
registry
.
find
(
"http.client.requests"
)
.
tags
(
"uri"
,
"/projects/{project}"
).
meter
()).
isNotNull
();
.
tags
(
"uri"
,
"/projects/{project}"
).
meter
()).
isNotNull
();
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/client/DefaultWebClientExchangeTagsProviderTests.java
View file @
9fc3ac7d
...
@@ -53,9 +53,9 @@ public class DefaultWebClientExchangeTagsProviderTests {
...
@@ -53,9 +53,9 @@ public class DefaultWebClientExchangeTagsProviderTests {
public
void
setup
()
{
public
void
setup
()
{
this
.
request
=
ClientRequest
this
.
request
=
ClientRequest
.
create
(
HttpMethod
.
GET
,
.
create
(
HttpMethod
.
GET
,
URI
.
create
(
"http://example.org/projects/spring-boot"
))
URI
.
create
(
"http
s
://example.org/projects/spring-boot"
))
.
attribute
(
URI_TEMPLATE_ATTRIBUTE
,
.
attribute
(
URI_TEMPLATE_ATTRIBUTE
,
"http://example.org/projects/{project}"
)
"http
s
://example.org/projects/{project}"
)
.
build
();
.
build
();
this
.
response
=
mock
(
ClientResponse
.
class
);
this
.
response
=
mock
(
ClientResponse
.
class
);
given
(
this
.
response
.
statusCode
()).
willReturn
(
HttpStatus
.
OK
);
given
(
this
.
response
.
statusCode
()).
willReturn
(
HttpStatus
.
OK
);
...
@@ -72,7 +72,7 @@ public class DefaultWebClientExchangeTagsProviderTests {
...
@@ -72,7 +72,7 @@ public class DefaultWebClientExchangeTagsProviderTests {
@Test
@Test
public
void
tagsWhenNoUriTemplateShouldProvideUriPath
()
{
public
void
tagsWhenNoUriTemplateShouldProvideUriPath
()
{
ClientRequest
request
=
ClientRequest
.
create
(
HttpMethod
.
GET
,
ClientRequest
request
=
ClientRequest
.
create
(
HttpMethod
.
GET
,
URI
.
create
(
"http://example.org/projects/spring-boot"
)).
build
();
URI
.
create
(
"http
s
://example.org/projects/spring-boot"
)).
build
();
Iterable
<
Tag
>
tags
=
this
.
tagsProvider
.
tags
(
request
,
this
.
response
,
null
);
Iterable
<
Tag
>
tags
=
this
.
tagsProvider
.
tags
(
request
,
this
.
response
,
null
);
assertThat
(
tags
).
containsExactlyInAnyOrder
(
Tag
.
of
(
"method"
,
"GET"
),
assertThat
(
tags
).
containsExactlyInAnyOrder
(
Tag
.
of
(
"method"
,
"GET"
),
Tag
.
of
(
"uri"
,
"/projects/spring-boot"
),
Tag
.
of
(
"uri"
,
"/projects/spring-boot"
),
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/client/MetricsWebClientFilterFunctionTests.java
View file @
9fc3ac7d
...
@@ -71,7 +71,7 @@ public class MetricsWebClientFilterFunctionTests {
...
@@ -71,7 +71,7 @@ public class MetricsWebClientFilterFunctionTests {
@Test
@Test
public
void
filterShouldRecordTimer
()
{
public
void
filterShouldRecordTimer
()
{
ClientRequest
request
=
ClientRequest
.
create
(
HttpMethod
.
GET
,
ClientRequest
request
=
ClientRequest
.
create
(
HttpMethod
.
GET
,
URI
.
create
(
"http://example.com/projects/spring-boot"
)).
build
();
URI
.
create
(
"http
s
://example.com/projects/spring-boot"
)).
build
();
given
(
this
.
response
.
statusCode
()).
willReturn
(
HttpStatus
.
OK
);
given
(
this
.
response
.
statusCode
()).
willReturn
(
HttpStatus
.
OK
);
this
.
filterFunction
.
filter
(
request
,
this
.
exchange
).
block
(
Duration
.
ofSeconds
(
30
));
this
.
filterFunction
.
filter
(
request
,
this
.
exchange
).
block
(
Duration
.
ofSeconds
(
30
));
assertThat
(
this
.
registry
.
get
(
"http.client.requests"
)
assertThat
(
this
.
registry
.
get
(
"http.client.requests"
)
...
@@ -83,7 +83,7 @@ public class MetricsWebClientFilterFunctionTests {
...
@@ -83,7 +83,7 @@ public class MetricsWebClientFilterFunctionTests {
public
void
filterWhenUriTemplatePresentShouldRecordTimer
()
{
public
void
filterWhenUriTemplatePresentShouldRecordTimer
()
{
ClientRequest
request
=
ClientRequest
ClientRequest
request
=
ClientRequest
.
create
(
HttpMethod
.
GET
,
.
create
(
HttpMethod
.
GET
,
URI
.
create
(
"http://example.com/projects/spring-boot"
))
URI
.
create
(
"http
s
://example.com/projects/spring-boot"
))
.
attribute
(
URI_TEMPLATE_ATTRIBUTE
,
"/projects/{project}"
).
build
();
.
attribute
(
URI_TEMPLATE_ATTRIBUTE
,
"/projects/{project}"
).
build
();
given
(
this
.
response
.
statusCode
()).
willReturn
(
HttpStatus
.
OK
);
given
(
this
.
response
.
statusCode
()).
willReturn
(
HttpStatus
.
OK
);
this
.
filterFunction
.
filter
(
request
,
this
.
exchange
).
block
(
Duration
.
ofSeconds
(
30
));
this
.
filterFunction
.
filter
(
request
,
this
.
exchange
).
block
(
Duration
.
ofSeconds
(
30
));
...
@@ -95,7 +95,7 @@ public class MetricsWebClientFilterFunctionTests {
...
@@ -95,7 +95,7 @@ public class MetricsWebClientFilterFunctionTests {
@Test
@Test
public
void
filterWhenIoExceptionThrownShouldRecordTimer
()
{
public
void
filterWhenIoExceptionThrownShouldRecordTimer
()
{
ClientRequest
request
=
ClientRequest
.
create
(
HttpMethod
.
GET
,
ClientRequest
request
=
ClientRequest
.
create
(
HttpMethod
.
GET
,
URI
.
create
(
"http://example.com/projects/spring-boot"
)).
build
();
URI
.
create
(
"http
s
://example.com/projects/spring-boot"
)).
build
();
ExchangeFunction
errorExchange
=
(
r
)
->
Mono
.
error
(
new
IOException
());
ExchangeFunction
errorExchange
=
(
r
)
->
Mono
.
error
(
new
IOException
());
this
.
filterFunction
.
filter
(
request
,
errorExchange
)
this
.
filterFunction
.
filter
(
request
,
errorExchange
)
.
onErrorResume
(
IOException
.
class
,
(
t
)
->
Mono
.
empty
())
.
onErrorResume
(
IOException
.
class
,
(
t
)
->
Mono
.
empty
())
...
@@ -110,7 +110,7 @@ public class MetricsWebClientFilterFunctionTests {
...
@@ -110,7 +110,7 @@ public class MetricsWebClientFilterFunctionTests {
@Test
@Test
public
void
filterWhenExceptionThrownShouldRecordTimer
()
{
public
void
filterWhenExceptionThrownShouldRecordTimer
()
{
ClientRequest
request
=
ClientRequest
.
create
(
HttpMethod
.
GET
,
ClientRequest
request
=
ClientRequest
.
create
(
HttpMethod
.
GET
,
URI
.
create
(
"http://example.com/projects/spring-boot"
)).
build
();
URI
.
create
(
"http
s
://example.com/projects/spring-boot"
)).
build
();
ExchangeFunction
exchange
=
(
r
)
->
Mono
.
error
(
new
IllegalArgumentException
());
ExchangeFunction
exchange
=
(
r
)
->
Mono
.
error
(
new
IllegalArgumentException
());
this
.
filterFunction
.
filter
(
request
,
exchange
)
this
.
filterFunction
.
filter
(
request
,
exchange
)
.
onErrorResume
(
IllegalArgumentException
.
class
,
(
t
)
->
Mono
.
empty
())
.
onErrorResume
(
IllegalArgumentException
.
class
,
(
t
)
->
Mono
.
empty
())
...
@@ -124,7 +124,7 @@ public class MetricsWebClientFilterFunctionTests {
...
@@ -124,7 +124,7 @@ public class MetricsWebClientFilterFunctionTests {
@Test
@Test
public
void
filterWhenExceptionAndRetryShouldNotCumulateRecordTime
()
{
public
void
filterWhenExceptionAndRetryShouldNotCumulateRecordTime
()
{
ClientRequest
request
=
ClientRequest
.
create
(
HttpMethod
.
GET
,
ClientRequest
request
=
ClientRequest
.
create
(
HttpMethod
.
GET
,
URI
.
create
(
"http://example.com/projects/spring-boot"
)).
build
();
URI
.
create
(
"http
s
://example.com/projects/spring-boot"
)).
build
();
ExchangeFunction
exchange
=
(
r
)
->
Mono
.
error
(
new
IllegalArgumentException
())
ExchangeFunction
exchange
=
(
r
)
->
Mono
.
error
(
new
IllegalArgumentException
())
.
delaySubscription
(
Duration
.
ofMillis
(
300
)).
cast
(
ClientResponse
.
class
);
.
delaySubscription
(
Duration
.
ofMillis
(
300
)).
cast
(
ClientResponse
.
class
);
this
.
filterFunction
.
filter
(
request
,
exchange
).
retry
(
1
)
this
.
filterFunction
.
filter
(
request
,
exchange
).
retry
(
1
)
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/client/WebClientExchangeTagsTests.java
View file @
9fc3ac7d
...
@@ -51,9 +51,9 @@ public class WebClientExchangeTagsTests {
...
@@ -51,9 +51,9 @@ public class WebClientExchangeTagsTests {
public
void
setup
()
{
public
void
setup
()
{
this
.
request
=
ClientRequest
this
.
request
=
ClientRequest
.
create
(
HttpMethod
.
GET
,
.
create
(
HttpMethod
.
GET
,
URI
.
create
(
"http://example.org/projects/spring-boot"
))
URI
.
create
(
"http
s
://example.org/projects/spring-boot"
))
.
attribute
(
URI_TEMPLATE_ATTRIBUTE
,
.
attribute
(
URI_TEMPLATE_ATTRIBUTE
,
"http://example.org/projects/{project}"
)
"http
s
://example.org/projects/{project}"
)
.
build
();
.
build
();
this
.
response
=
mock
(
ClientResponse
.
class
);
this
.
response
=
mock
(
ClientResponse
.
class
);
given
(
this
.
response
.
statusCode
()).
willReturn
(
HttpStatus
.
OK
);
given
(
this
.
response
.
statusCode
()).
willReturn
(
HttpStatus
.
OK
);
...
@@ -75,7 +75,7 @@ public class WebClientExchangeTagsTests {
...
@@ -75,7 +75,7 @@ public class WebClientExchangeTagsTests {
public
void
uriWhenRelativeTemplateIsAvailableShouldReturnTemplate
()
{
public
void
uriWhenRelativeTemplateIsAvailableShouldReturnTemplate
()
{
this
.
request
=
ClientRequest
this
.
request
=
ClientRequest
.
create
(
HttpMethod
.
GET
,
.
create
(
HttpMethod
.
GET
,
URI
.
create
(
"http://example.org/projects/spring-boot"
))
URI
.
create
(
"http
s
://example.org/projects/spring-boot"
))
.
attribute
(
URI_TEMPLATE_ATTRIBUTE
,
"/projects/{project}"
).
build
();
.
attribute
(
URI_TEMPLATE_ATTRIBUTE
,
"/projects/{project}"
).
build
();
assertThat
(
WebClientExchangeTags
.
uri
(
this
.
request
))
assertThat
(
WebClientExchangeTags
.
uri
(
this
.
request
))
.
isEqualTo
(
Tag
.
of
(
"uri"
,
"/projects/{project}"
));
.
isEqualTo
(
Tag
.
of
(
"uri"
,
"/projects/{project}"
));
...
@@ -84,7 +84,7 @@ public class WebClientExchangeTagsTests {
...
@@ -84,7 +84,7 @@ public class WebClientExchangeTagsTests {
@Test
@Test
public
void
uriWhenTemplateIsMissingShouldReturnPath
()
{
public
void
uriWhenTemplateIsMissingShouldReturnPath
()
{
this
.
request
=
ClientRequest
.
create
(
HttpMethod
.
GET
,
this
.
request
=
ClientRequest
.
create
(
HttpMethod
.
GET
,
URI
.
create
(
"http://example.org/projects/spring-boot"
)).
build
();
URI
.
create
(
"http
s
://example.org/projects/spring-boot"
)).
build
();
assertThat
(
WebClientExchangeTags
.
uri
(
this
.
request
))
assertThat
(
WebClientExchangeTags
.
uri
(
this
.
request
))
.
isEqualTo
(
Tag
.
of
(
"uri"
,
"/projects/spring-boot"
));
.
isEqualTo
(
Tag
.
of
(
"uri"
,
"/projects/spring-boot"
));
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientPropertiesRegistrationAdapterTests.java
View file @
9fc3ac7d
...
@@ -271,23 +271,23 @@ public class OAuth2ClientPropertiesRegistrationAdapterTests {
...
@@ -271,23 +271,23 @@ public class OAuth2ClientPropertiesRegistrationAdapterTests {
assertThat
(
adapted
.
getClientName
()).
isEqualTo
(
issuer
);
assertThat
(
adapted
.
getClientName
()).
isEqualTo
(
issuer
);
assertThat
(
adapted
.
getScopes
()).
containsOnly
(
"user"
);
assertThat
(
adapted
.
getScopes
()).
containsOnly
(
"user"
);
assertThat
(
adapted
.
getRedirectUriTemplate
())
assertThat
(
adapted
.
getRedirectUriTemplate
())
.
isEqualTo
(
"http://example.com/redirect"
);
.
isEqualTo
(
"http
s
://example.com/redirect"
);
assertThat
(
providerDetails
.
getAuthorizationUri
())
assertThat
(
providerDetails
.
getAuthorizationUri
())
.
isEqualTo
(
"http://example.com/auth"
);
.
isEqualTo
(
"http
s
://example.com/auth"
);
assertThat
(
providerDetails
.
getTokenUri
()).
isEqualTo
(
"http://example.com/token"
);
assertThat
(
providerDetails
.
getTokenUri
()).
isEqualTo
(
"http
s
://example.com/token"
);
assertThat
(
providerDetails
.
getJwkSetUri
()).
isEqualTo
(
"http://example.com/jwk"
);
assertThat
(
providerDetails
.
getJwkSetUri
()).
isEqualTo
(
"http
s
://example.com/jwk"
);
UserInfoEndpoint
userInfoEndpoint
=
providerDetails
.
getUserInfoEndpoint
();
UserInfoEndpoint
userInfoEndpoint
=
providerDetails
.
getUserInfoEndpoint
();
assertThat
(
userInfoEndpoint
.
getUri
()).
isEqualTo
(
"http://example.com/info"
);
assertThat
(
userInfoEndpoint
.
getUri
()).
isEqualTo
(
"http
s
://example.com/info"
);
assertThat
(
userInfoEndpoint
.
getUserNameAttributeName
()).
isEqualTo
(
"sub"
);
assertThat
(
userInfoEndpoint
.
getUserNameAttributeName
()).
isEqualTo
(
"sub"
);
}
}
private
Provider
createProvider
()
{
private
Provider
createProvider
()
{
Provider
provider
=
new
Provider
();
Provider
provider
=
new
Provider
();
provider
.
setAuthorizationUri
(
"http://example.com/auth"
);
provider
.
setAuthorizationUri
(
"http
s
://example.com/auth"
);
provider
.
setTokenUri
(
"http://example.com/token"
);
provider
.
setTokenUri
(
"http
s
://example.com/token"
);
provider
.
setUserInfoUri
(
"http://example.com/info"
);
provider
.
setUserInfoUri
(
"http
s
://example.com/info"
);
provider
.
setUserNameAttribute
(
"sub"
);
provider
.
setUserNameAttribute
(
"sub"
);
provider
.
setJwkSetUri
(
"http://example.com/jwk"
);
provider
.
setJwkSetUri
(
"http
s
://example.com/jwk"
);
return
provider
;
return
provider
;
}
}
...
@@ -297,7 +297,7 @@ public class OAuth2ClientPropertiesRegistrationAdapterTests {
...
@@ -297,7 +297,7 @@ public class OAuth2ClientPropertiesRegistrationAdapterTests {
registration
.
setClientId
(
"clientId"
);
registration
.
setClientId
(
"clientId"
);
registration
.
setClientSecret
(
"clientSecret"
);
registration
.
setClientSecret
(
"clientSecret"
);
registration
.
setClientAuthenticationMethod
(
"post"
);
registration
.
setClientAuthenticationMethod
(
"post"
);
registration
.
setRedirectUri
(
"http://example.com/redirect"
);
registration
.
setRedirectUri
(
"http
s
://example.com/redirect"
);
registration
.
setScope
(
Collections
.
singleton
(
"user"
));
registration
.
setScope
(
Collections
.
singleton
(
"user"
));
registration
.
setAuthorizationGrantType
(
"authorization_code"
);
registration
.
setAuthorizationGrantType
(
"authorization_code"
);
return
registration
;
return
registration
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/reactive/ReactiveOAuth2ClientAutoConfigurationTests.java
View file @
9fc3ac7d
...
@@ -168,7 +168,7 @@ public class ReactiveOAuth2ClientAutoConfigurationTests {
...
@@ -168,7 +168,7 @@ public class ReactiveOAuth2ClientAutoConfigurationTests {
@Bean
@Bean
public
ReactiveClientRegistrationRepository
clientRegistrationRepository
()
{
public
ReactiveClientRegistrationRepository
clientRegistrationRepository
()
{
List
<
ClientRegistration
>
registrations
=
new
ArrayList
<>();
List
<
ClientRegistration
>
registrations
=
new
ArrayList
<>();
registrations
.
add
(
getClientRegistration
(
"first"
,
"http://user-info-uri.com"
));
registrations
.
add
(
getClientRegistration
(
"first"
,
"http
s
://user-info-uri.com"
));
registrations
.
add
(
getClientRegistration
(
"second"
,
"http://other-user-info"
));
registrations
.
add
(
getClientRegistration
(
"second"
,
"http://other-user-info"
));
return
new
InMemoryReactiveClientRegistrationRepository
(
registrations
);
return
new
InMemoryReactiveClientRegistrationRepository
(
registrations
);
}
}
...
@@ -180,9 +180,9 @@ public class ReactiveOAuth2ClientAutoConfigurationTests {
...
@@ -180,9 +180,9 @@ public class ReactiveOAuth2ClientAutoConfigurationTests {
org
.
springframework
.
security
.
oauth2
.
core
.
ClientAuthenticationMethod
.
BASIC
)
org
.
springframework
.
security
.
oauth2
.
core
.
ClientAuthenticationMethod
.
BASIC
)
.
authorizationGrantType
(
AuthorizationGrantType
.
AUTHORIZATION_CODE
)
.
authorizationGrantType
(
AuthorizationGrantType
.
AUTHORIZATION_CODE
)
.
scope
(
"read"
).
clientSecret
(
"secret"
)
.
scope
(
"read"
).
clientSecret
(
"secret"
)
.
redirectUriTemplate
(
"http://redirect-uri.com"
)
.
redirectUriTemplate
(
"http
s
://redirect-uri.com"
)
.
authorizationUri
(
"http://authorization-uri.com"
)
.
authorizationUri
(
"http
s
://authorization-uri.com"
)
.
tokenUri
(
"http://token-uri.com"
).
userInfoUri
(
userInfoUri
)
.
tokenUri
(
"http
s
://token-uri.com"
).
userInfoUri
(
userInfoUri
)
.
userNameAttributeName
(
"login"
);
.
userNameAttributeName
(
"login"
);
return
builder
.
build
();
return
builder
.
build
();
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/reactive/ReactiveOAuth2ResourceServerAutoConfigurationTests.java
View file @
9fc3ac7d
...
@@ -80,7 +80,7 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
...
@@ -80,7 +80,7 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
@Test
@Test
public
void
autoConfigurationShouldConfigureResourceServer
()
{
public
void
autoConfigurationShouldConfigureResourceServer
()
{
this
.
contextRunner
.
withPropertyValues
(
this
.
contextRunner
.
withPropertyValues
(
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://jwk-set-uri.com"
)
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http
s
://jwk-set-uri.com"
)
.
run
((
context
)
->
{
.
run
((
context
)
->
{
assertThat
(
context
.
getBean
(
ReactiveJwtDecoder
.
class
))
assertThat
(
context
.
getBean
(
ReactiveJwtDecoder
.
class
))
.
isInstanceOf
(
NimbusReactiveJwtDecoder
.
class
);
.
isInstanceOf
(
NimbusReactiveJwtDecoder
.
class
);
...
@@ -110,8 +110,8 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
...
@@ -110,8 +110,8 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
@Test
@Test
public
void
autoConfigurationWhenBothSetUriAndIssuerUriPresentShouldUseSetUri
()
{
public
void
autoConfigurationWhenBothSetUriAndIssuerUriPresentShouldUseSetUri
()
{
this
.
contextRunner
.
withPropertyValues
(
this
.
contextRunner
.
withPropertyValues
(
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://jwk-set-uri.com"
,
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http
s
://jwk-set-uri.com"
,
"spring.security.oauth2.resourceserver.jwt.issuer-uri=http://jwk-oidc-issuer-location.com"
)
"spring.security.oauth2.resourceserver.jwt.issuer-uri=http
s
://jwk-oidc-issuer-location.com"
)
.
run
((
context
)
->
{
.
run
((
context
)
->
{
assertThat
(
context
.
getBean
(
ReactiveJwtDecoder
.
class
))
assertThat
(
context
.
getBean
(
ReactiveJwtDecoder
.
class
))
.
isInstanceOf
(
NimbusReactiveJwtDecoder
.
class
);
.
isInstanceOf
(
NimbusReactiveJwtDecoder
.
class
);
...
@@ -130,7 +130,7 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
...
@@ -130,7 +130,7 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
@Test
@Test
public
void
jwtDecoderBeanIsConditionalOnMissingBean
()
{
public
void
jwtDecoderBeanIsConditionalOnMissingBean
()
{
this
.
contextRunner
.
withPropertyValues
(
this
.
contextRunner
.
withPropertyValues
(
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://jwk-set-uri.com"
)
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http
s
://jwk-set-uri.com"
)
.
withUserConfiguration
(
JwtDecoderConfig
.
class
)
.
withUserConfiguration
(
JwtDecoderConfig
.
class
)
.
run
((
this
::
assertFilterConfiguredWithJwtAuthenticationManager
));
.
run
((
this
::
assertFilterConfiguredWithJwtAuthenticationManager
));
}
}
...
@@ -138,7 +138,7 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
...
@@ -138,7 +138,7 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
@Test
@Test
public
void
jwtDecoderByIssuerUriBeanIsConditionalOnMissingBean
()
{
public
void
jwtDecoderByIssuerUriBeanIsConditionalOnMissingBean
()
{
this
.
contextRunner
.
withPropertyValues
(
this
.
contextRunner
.
withPropertyValues
(
"spring.security.oauth2.resourceserver.jwt.issuer-uri=http://jwk-oidc-issuer-location.com"
)
"spring.security.oauth2.resourceserver.jwt.issuer-uri=http
s
://jwk-oidc-issuer-location.com"
)
.
withUserConfiguration
(
JwtDecoderConfig
.
class
)
.
withUserConfiguration
(
JwtDecoderConfig
.
class
)
.
run
((
this
::
assertFilterConfiguredWithJwtAuthenticationManager
));
.
run
((
this
::
assertFilterConfiguredWithJwtAuthenticationManager
));
}
}
...
@@ -146,7 +146,7 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
...
@@ -146,7 +146,7 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
@Test
@Test
public
void
autoConfigurationShouldBeConditionalOnBearerTokenAuthenticationTokenClass
()
{
public
void
autoConfigurationShouldBeConditionalOnBearerTokenAuthenticationTokenClass
()
{
this
.
contextRunner
.
withPropertyValues
(
this
.
contextRunner
.
withPropertyValues
(
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://jwk-set-uri.com"
)
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http
s
://jwk-set-uri.com"
)
.
withUserConfiguration
(
JwtDecoderConfig
.
class
)
.
withUserConfiguration
(
JwtDecoderConfig
.
class
)
.
withClassLoader
(
.
withClassLoader
(
new
FilteredClassLoader
(
BearerTokenAuthenticationToken
.
class
))
new
FilteredClassLoader
(
BearerTokenAuthenticationToken
.
class
))
...
@@ -157,7 +157,7 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
...
@@ -157,7 +157,7 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
@Test
@Test
public
void
autoConfigurationShouldBeConditionalOnReactiveJwtDecoderClass
()
{
public
void
autoConfigurationShouldBeConditionalOnReactiveJwtDecoderClass
()
{
this
.
contextRunner
.
withPropertyValues
(
this
.
contextRunner
.
withPropertyValues
(
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://jwk-set-uri.com"
)
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http
s
://jwk-set-uri.com"
)
.
withUserConfiguration
(
JwtDecoderConfig
.
class
)
.
withUserConfiguration
(
JwtDecoderConfig
.
class
)
.
withClassLoader
(
new
FilteredClassLoader
(
ReactiveJwtDecoder
.
class
))
.
withClassLoader
(
new
FilteredClassLoader
(
ReactiveJwtDecoder
.
class
))
.
run
((
context
)
->
assertThat
(
context
)
.
run
((
context
)
->
assertThat
(
context
)
...
@@ -167,7 +167,7 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
...
@@ -167,7 +167,7 @@ public class ReactiveOAuth2ResourceServerAutoConfigurationTests {
@Test
@Test
public
void
autoConfigurationWhenSecurityWebFilterChainConfigPresentShouldNotAddOne
()
{
public
void
autoConfigurationWhenSecurityWebFilterChainConfigPresentShouldNotAddOne
()
{
this
.
contextRunner
.
withPropertyValues
(
this
.
contextRunner
.
withPropertyValues
(
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://jwk-set-uri.com"
)
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http
s
://jwk-set-uri.com"
)
.
withUserConfiguration
(
SecurityWebFilterChainConfig
.
class
)
.
withUserConfiguration
(
SecurityWebFilterChainConfig
.
class
)
.
run
((
context
)
->
{
.
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
SecurityWebFilterChain
.
class
);
assertThat
(
context
).
hasSingleBean
(
SecurityWebFilterChain
.
class
);
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerAutoConfigurationTests.java
View file @
9fc3ac7d
...
@@ -75,7 +75,7 @@ public class OAuth2ResourceServerAutoConfigurationTests {
...
@@ -75,7 +75,7 @@ public class OAuth2ResourceServerAutoConfigurationTests {
@Test
@Test
public
void
autoConfigurationShouldConfigureResourceServer
()
{
public
void
autoConfigurationShouldConfigureResourceServer
()
{
this
.
contextRunner
.
withPropertyValues
(
this
.
contextRunner
.
withPropertyValues
(
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://jwk-set-uri.com"
)
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http
s
://jwk-set-uri.com"
)
.
run
((
context
)
->
{
.
run
((
context
)
->
{
assertThat
(
context
.
getBean
(
JwtDecoder
.
class
))
assertThat
(
context
.
getBean
(
JwtDecoder
.
class
))
.
isInstanceOf
(
NimbusJwtDecoderJwkSupport
.
class
);
.
isInstanceOf
(
NimbusJwtDecoderJwkSupport
.
class
);
...
@@ -105,8 +105,8 @@ public class OAuth2ResourceServerAutoConfigurationTests {
...
@@ -105,8 +105,8 @@ public class OAuth2ResourceServerAutoConfigurationTests {
@Test
@Test
public
void
autoConfigurationWhenBothSetUriAndIssuerUriPresentShouldUseSetUri
()
{
public
void
autoConfigurationWhenBothSetUriAndIssuerUriPresentShouldUseSetUri
()
{
this
.
contextRunner
.
withPropertyValues
(
this
.
contextRunner
.
withPropertyValues
(
"spring.security.oauth2.resourceserver.jwt.issuer-uri=http://issuer-uri.com"
,
"spring.security.oauth2.resourceserver.jwt.issuer-uri=http
s
://issuer-uri.com"
,
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://jwk-set-uri.com"
)
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http
s
://jwk-set-uri.com"
)
.
run
((
context
)
->
{
.
run
((
context
)
->
{
assertThat
(
context
.
getBean
(
JwtDecoder
.
class
))
assertThat
(
context
.
getBean
(
JwtDecoder
.
class
))
.
isInstanceOf
(
NimbusJwtDecoderJwkSupport
.
class
);
.
isInstanceOf
(
NimbusJwtDecoderJwkSupport
.
class
);
...
@@ -126,7 +126,7 @@ public class OAuth2ResourceServerAutoConfigurationTests {
...
@@ -126,7 +126,7 @@ public class OAuth2ResourceServerAutoConfigurationTests {
@Test
@Test
public
void
jwtDecoderByJwkSetUriIsConditionalOnMissingBean
()
{
public
void
jwtDecoderByJwkSetUriIsConditionalOnMissingBean
()
{
this
.
contextRunner
.
withPropertyValues
(
this
.
contextRunner
.
withPropertyValues
(
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://jwk-set-uri.com"
)
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http
s
://jwk-set-uri.com"
)
.
withUserConfiguration
(
JwtDecoderConfig
.
class
)
.
withUserConfiguration
(
JwtDecoderConfig
.
class
)
.
run
((
context
)
->
assertThat
(
getBearerTokenFilter
(
context
)).
isNotNull
());
.
run
((
context
)
->
assertThat
(
getBearerTokenFilter
(
context
)).
isNotNull
());
}
}
...
@@ -134,7 +134,7 @@ public class OAuth2ResourceServerAutoConfigurationTests {
...
@@ -134,7 +134,7 @@ public class OAuth2ResourceServerAutoConfigurationTests {
@Test
@Test
public
void
jwtDecoderByOidcIssuerUriIsConditionalOnMissingBean
()
{
public
void
jwtDecoderByOidcIssuerUriIsConditionalOnMissingBean
()
{
this
.
contextRunner
.
withPropertyValues
(
this
.
contextRunner
.
withPropertyValues
(
"spring.security.oauth2.resourceserver.jwt.issuer-uri=http://jwk-oidc-issuer-location.com"
)
"spring.security.oauth2.resourceserver.jwt.issuer-uri=http
s
://jwk-oidc-issuer-location.com"
)
.
withUserConfiguration
(
JwtDecoderConfig
.
class
)
.
withUserConfiguration
(
JwtDecoderConfig
.
class
)
.
run
((
context
)
->
assertThat
(
getBearerTokenFilter
(
context
)).
isNotNull
());
.
run
((
context
)
->
assertThat
(
getBearerTokenFilter
(
context
)).
isNotNull
());
}
}
...
@@ -142,7 +142,7 @@ public class OAuth2ResourceServerAutoConfigurationTests {
...
@@ -142,7 +142,7 @@ public class OAuth2ResourceServerAutoConfigurationTests {
@Test
@Test
public
void
autoConfigurationShouldBeConditionalOnJwtAuthenticationTokenClass
()
{
public
void
autoConfigurationShouldBeConditionalOnJwtAuthenticationTokenClass
()
{
this
.
contextRunner
.
withPropertyValues
(
this
.
contextRunner
.
withPropertyValues
(
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://jwk-set-uri.com"
)
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http
s
://jwk-set-uri.com"
)
.
withUserConfiguration
(
JwtDecoderConfig
.
class
)
.
withUserConfiguration
(
JwtDecoderConfig
.
class
)
.
withClassLoader
(
new
FilteredClassLoader
(
JwtAuthenticationToken
.
class
))
.
withClassLoader
(
new
FilteredClassLoader
(
JwtAuthenticationToken
.
class
))
.
run
((
context
)
->
assertThat
(
getBearerTokenFilter
(
context
)).
isNull
());
.
run
((
context
)
->
assertThat
(
getBearerTokenFilter
(
context
)).
isNull
());
...
@@ -151,7 +151,7 @@ public class OAuth2ResourceServerAutoConfigurationTests {
...
@@ -151,7 +151,7 @@ public class OAuth2ResourceServerAutoConfigurationTests {
@Test
@Test
public
void
autoConfigurationShouldBeConditionalOnJwtDecoderClass
()
{
public
void
autoConfigurationShouldBeConditionalOnJwtDecoderClass
()
{
this
.
contextRunner
.
withPropertyValues
(
this
.
contextRunner
.
withPropertyValues
(
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://jwk-set-uri.com"
)
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http
s
://jwk-set-uri.com"
)
.
withUserConfiguration
(
JwtDecoderConfig
.
class
)
.
withUserConfiguration
(
JwtDecoderConfig
.
class
)
.
withClassLoader
(
new
FilteredClassLoader
(
JwtDecoder
.
class
))
.
withClassLoader
(
new
FilteredClassLoader
(
JwtDecoder
.
class
))
.
run
((
context
)
->
assertThat
(
getBearerTokenFilter
(
context
)).
isNull
());
.
run
((
context
)
->
assertThat
(
getBearerTokenFilter
(
context
)).
isNull
());
...
...
spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc
View file @
9fc3ac7d
...
@@ -768,7 +768,7 @@ additional dependency.
...
@@ -768,7 +768,7 @@ additional dependency.
Spring Boot manages the version for the
Spring Boot manages the version for the
`io.netty:netty-tcnative-boringssl-static` "uber jar", containing native libraries for
`io.netty:netty-tcnative-boringssl-static` "uber jar", containing native libraries for
all platforms. Developers can choose to import only the required dependencies using
all platforms. Developers can choose to import only the required dependencies using
a classifier (see http://netty.io/wiki/forked-tomcat-native.html[the Netty official
a classifier (see http
s
://netty.io/wiki/forked-tomcat-native.html[the Netty official
documentation]).
documentation]).
...
...
spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc
View file @
9fc3ac7d
...
@@ -1514,7 +1514,7 @@ using the following property:
...
@@ -1514,7 +1514,7 @@ using the following property:
[source,properties,indent=0]
[source,properties,indent=0]
----
----
management.metrics.export.elastic.host=http://elastic.example.com:8086
management.metrics.export.elastic.host=http
s
://elastic.example.com:8086
----
----
...
@@ -1636,7 +1636,7 @@ server] to use can be provided using:
...
@@ -1636,7 +1636,7 @@ server] to use can be provided using:
[source,properties,indent=0]
[source,properties,indent=0]
----
----
management.metrics.export.kairos.uri=http://kairosdb.example.com:8080/api/v1/datapoints
management.metrics.export.kairos.uri=http
s
://kairosdb.example.com:8080/api/v1/datapoints
----
----
...
...
spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
9fc3ac7d
...
@@ -4567,7 +4567,7 @@ You can further tune how `RestClient` is configured, as shown in the following e
...
@@ -4567,7 +4567,7 @@ You can further tune how `RestClient` is configured, as shown in the following e
[source,properties,indent=0]
[source,properties,indent=0]
----
----
spring.elasticsearch.rest.uris=http://search.example.com:9200
spring.elasticsearch.rest.uris=http
s
://search.example.com:9200
spring.elasticsearch.rest.username=user
spring.elasticsearch.rest.username=user
spring.elasticsearch.rest.password=secret
spring.elasticsearch.rest.password=secret
----
----
...
...
spring-boot-project/spring-boot-starters/README.adoc
View file @
9fc3ac7d
...
@@ -34,7 +34,7 @@ do as they were designed before this was clarified.
...
@@ -34,7 +34,7 @@ do as they were designed before this was clarified.
| https://wicket.apache.org/[Apache Wicket]
| https://wicket.apache.org/[Apache Wicket]
| https://github.com/MarcGiffing/wicket-spring-boot
| https://github.com/MarcGiffing/wicket-spring-boot
| http://arangodb.com/[ArangoDB]
| http
s
://arangodb.com/[ArangoDB]
| https://github.com/arangodb/spring-boot-starter
| https://github.com/arangodb/spring-boot-starter
| https://axoniq.io[Axon Framework]
| https://axoniq.io[Axon Framework]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment