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
0e1ded68
Commit
0e1ded68
authored
Jun 30, 2020
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.2.x' into 2.3.x
Closes gh-22175
parents
4566ac5c
500d2bd9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
5 deletions
+29
-5
SecurityFilterAutoConfiguration.java
...ure/security/servlet/SecurityFilterAutoConfiguration.java
+2
-2
SessionRepositoryFilterConfiguration.java
...nfigure/session/SessionRepositoryFilterConfiguration.java
+2
-2
SecurityAutoConfigurationTests.java
...gure/security/servlet/SecurityAutoConfigurationTests.java
+14
-1
SessionAutoConfigurationTests.java
.../autoconfigure/session/SessionAutoConfigurationTests.java
+11
-0
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/SecurityFilterAutoConfiguration.java
View file @
0e1ded68
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -73,7 +73,7 @@ public class SecurityFilterAutoConfiguration {
...
@@ -73,7 +73,7 @@ public class SecurityFilterAutoConfiguration {
}
}
return
securityProperties
.
getFilter
().
getDispatcherTypes
().
stream
()
return
securityProperties
.
getFilter
().
getDispatcherTypes
().
stream
()
.
map
((
type
)
->
DispatcherType
.
valueOf
(
type
.
name
()))
.
map
((
type
)
->
DispatcherType
.
valueOf
(
type
.
name
()))
.
collect
(
Collectors
.
collectingAndThen
(
Collectors
.
toSet
(),
EnumSet:
:
copyOf
));
.
collect
(
Collectors
.
toCollection
(()
->
EnumSet
.
noneOf
(
DispatcherType
.
class
)
));
}
}
}
}
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/session/SessionRepositoryFilterConfiguration.java
View file @
0e1ded68
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -53,7 +53,7 @@ class SessionRepositoryFilterConfiguration {
...
@@ -53,7 +53,7 @@ class SessionRepositoryFilterConfiguration {
return
null
;
return
null
;
}
}
return
servletProperties
.
getFilterDispatcherTypes
().
stream
().
map
((
type
)
->
DispatcherType
.
valueOf
(
type
.
name
()))
return
servletProperties
.
getFilterDispatcherTypes
().
stream
().
map
((
type
)
->
DispatcherType
.
valueOf
(
type
.
name
()))
.
collect
(
Collectors
.
collectingAndThen
(
Collectors
.
toSet
(),
EnumSet:
:
copyOf
));
.
collect
(
Collectors
.
toCollection
(()
->
EnumSet
.
noneOf
(
DispatcherType
.
class
)
));
}
}
}
}
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/SecurityAutoConfigurationTests.java
View file @
0e1ded68
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -164,6 +164,19 @@ class SecurityAutoConfigurationTests {
...
@@ -164,6 +164,19 @@ class SecurityAutoConfigurationTests {
});
});
}
}
@Test
void
emptyFilterDispatcherTypesDoNotThrowException
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.security.filter.dispatcher-types:"
)
.
withConfiguration
(
AutoConfigurations
.
of
(
SecurityFilterAutoConfiguration
.
class
)).
run
((
context
)
->
{
DelegatingFilterProxyRegistrationBean
bean
=
context
.
getBean
(
"securityFilterChainRegistration"
,
DelegatingFilterProxyRegistrationBean
.
class
);
@SuppressWarnings
(
"unchecked"
)
EnumSet
<
DispatcherType
>
dispatcherTypes
=
(
EnumSet
<
DispatcherType
>)
ReflectionTestUtils
.
getField
(
bean
,
"dispatcherTypes"
);
assertThat
(
dispatcherTypes
).
isEmpty
();
});
}
@Configuration
(
proxyBeanMethods
=
false
)
@Configuration
(
proxyBeanMethods
=
false
)
@TestAutoConfigurationPackage
(
City
.
class
)
@TestAutoConfigurationPackage
(
City
.
class
)
static
class
EntityConfiguration
{
static
class
EntityConfiguration
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationTests.java
View file @
0e1ded68
...
@@ -143,6 +143,17 @@ class SessionAutoConfigurationTests extends AbstractSessionAutoConfigurationTest
...
@@ -143,6 +143,17 @@ class SessionAutoConfigurationTests extends AbstractSessionAutoConfigurationTest
});
});
}
}
@SuppressWarnings
(
"unchecked"
)
@Test
void
emptyFilterDispatcherTypesDoNotThrowException
()
{
this
.
contextRunner
.
withUserConfiguration
(
SessionRepositoryConfiguration
.
class
)
.
withPropertyValues
(
"spring.session.servlet.filter-dispatcher-types="
).
run
((
context
)
->
{
FilterRegistrationBean
<?>
registration
=
context
.
getBean
(
FilterRegistrationBean
.
class
);
Object
dispatcherTypes
=
ReflectionTestUtils
.
getField
(
registration
,
"dispatcherTypes"
);
assertThat
((
EnumSet
<
DispatcherType
>)
dispatcherTypes
).
isEmpty
();
});
}
@Test
@Test
void
sessionCookieConfigurationIsAppliedToAutoConfiguredCookieSerializer
()
{
void
sessionCookieConfigurationIsAppliedToAutoConfiguredCookieSerializer
()
{
this
.
contextRunner
.
withUserConfiguration
(
SessionRepositoryConfiguration
.
class
)
this
.
contextRunner
.
withUserConfiguration
(
SessionRepositoryConfiguration
.
class
)
...
...
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