Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
apollo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
apollo
Commits
44aae099
Unverified
Commit
44aae099
authored
Oct 04, 2018
by
Jason Song
Committed by
GitHub
Oct 04, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1529 from nobodyiam/fix-spring-security-5-logout
fix logout issue with spring security 5
parents
b70060ff
a8f00d48
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
4 deletions
+20
-4
apollo-adminservice/src/test/java/com/ctrip/framework/apollo/adminservice/controller/ControllerIntegrationExceptionTest.java
...ervice/controller/ControllerIntegrationExceptionTest.java
+11
-0
apollo-mockserver/src/test/java/com/ctrip/framework/apollo/mockserver/ApolloMockServerApiTest.java
.../framework/apollo/mockserver/ApolloMockServerApiTest.java
+3
-3
apollo-mockserver/src/test/resources/mockdata-anotherNamespace.properties
...r/src/test/resources/mockdata-anotherNamespace.properties
+2
-0
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java
...rk/apollo/portal/spi/configuration/AuthConfiguration.java
+4
-1
No files found.
apollo-adminservice/src/test/java/com/ctrip/framework/apollo/adminservice/controller/ControllerIntegrationExceptionTest.java
View file @
44aae099
...
...
@@ -7,6 +7,7 @@ import com.ctrip.framework.apollo.biz.service.AppService;
import
com.ctrip.framework.apollo.common.dto.AppDTO
;
import
com.ctrip.framework.apollo.common.entity.App
;
import
org.junit.After
;
import
org.junit.Assert
;
import
org.junit.Before
;
import
org.junit.Test
;
...
...
@@ -31,6 +32,8 @@ public class ControllerIntegrationExceptionTest extends AbstractControllerTest {
@Mock
AdminService
adminService
;
private
Object
realAdminService
;
@Autowired
AppService
appService
;
...
...
@@ -39,9 +42,17 @@ public class ControllerIntegrationExceptionTest extends AbstractControllerTest {
@Before
public
void
setUp
()
{
MockitoAnnotations
.
initMocks
(
this
);
realAdminService
=
ReflectionTestUtils
.
getField
(
appController
,
"adminService"
);
ReflectionTestUtils
.
setField
(
appController
,
"adminService"
,
adminService
);
}
@After
public
void
tearDown
()
throws
Exception
{
ReflectionTestUtils
.
setField
(
appController
,
"adminService"
,
realAdminService
);
}
private
String
getBaseAppUrl
()
{
return
"http://localhost:"
+
port
+
"/apps/"
;
}
...
...
apollo-mockserver/src/test/java/com/ctrip/framework/apollo/mockserver/ApolloMockServerApiTest.java
View file @
44aae099
...
...
@@ -14,7 +14,7 @@ import org.junit.Test;
public
class
ApolloMockServerApiTest
{
private
static
final
String
otherNamespace
=
"
otherNamespace"
;
private
static
final
String
anotherNamespace
=
"an
otherNamespace"
;
@ClassRule
public
static
EmbeddedApollo
embeddedApollo
=
new
EmbeddedApollo
();
...
...
@@ -31,7 +31,7 @@ public class ApolloMockServerApiTest {
public
void
testUpdateProperties
()
throws
Exception
{
String
someNewValue
=
"someNewValue"
;
Config
otherConfig
=
ConfigService
.
getConfig
(
otherNamespace
);
Config
otherConfig
=
ConfigService
.
getConfig
(
an
otherNamespace
);
final
SettableFuture
<
ConfigChangeEvent
>
future
=
SettableFuture
.
create
();
...
...
@@ -45,7 +45,7 @@ public class ApolloMockServerApiTest {
assertEquals
(
"otherValue1"
,
otherConfig
.
getProperty
(
"key1"
,
null
));
assertEquals
(
"otherValue2"
,
otherConfig
.
getProperty
(
"key2"
,
null
));
embeddedApollo
.
addOrModifyProperty
(
otherNamespace
,
"key1"
,
someNewValue
);
embeddedApollo
.
addOrModifyProperty
(
an
otherNamespace
,
"key1"
,
someNewValue
);
ConfigChangeEvent
changeEvent
=
future
.
get
(
5
,
TimeUnit
.
SECONDS
);
...
...
apollo-mockserver/src/test/resources/mockdata-anotherNamespace.properties
0 → 100644
View file @
44aae099
key1
=
otherValue1
key2
=
otherValue2
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java
View file @
44aae099
...
...
@@ -46,6 +46,7 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import
org.springframework.security.crypto.password.LdapShaPasswordEncoder
;
import
org.springframework.security.provisioning.JdbcUserDetailsManager
;
import
org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint
;
import
org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler
;
@Configuration
...
...
@@ -270,8 +271,10 @@ public class AuthConfiguration {
.
antMatchers
(
"/openapi/**"
,
"/vendor/**"
,
"/styles/**"
,
"/scripts/**"
,
"/views/**"
,
"/img/**"
).
permitAll
()
.
antMatchers
(
"/**"
).
hasAnyRole
(
USER_ROLE
);
http
.
formLogin
().
loginPage
(
"/signin"
).
permitAll
().
failureUrl
(
"/signin?#/error"
).
and
().
httpBasic
();
SimpleUrlLogoutSuccessHandler
urlLogoutHandler
=
new
SimpleUrlLogoutSuccessHandler
();
urlLogoutHandler
.
setDefaultTargetUrl
(
"/signin?#/logout"
);
http
.
logout
().
logoutUrl
(
"/user/logout"
).
invalidateHttpSession
(
true
).
clearAuthentication
(
true
)
.
logoutSuccess
Url
(
"/signin?#/logout"
);
.
logoutSuccess
Handler
(
urlLogoutHandler
);
http
.
exceptionHandling
().
authenticationEntryPoint
(
new
LoginUrlAuthenticationEntryPoint
(
"/signin"
));
}
...
...
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