Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
Project
Overview
Details
Activity
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
openSource
spring-cloud-netflix
Commits
ef755f3a
Unverified
Commit
ef755f3a
authored
Nov 27, 2017
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 2.0.x
parents
e19ecf71
6c52269d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
5 deletions
+35
-5
spring-cloud-netflix.adoc
docs/src/main/asciidoc/spring-cloud-netflix.adoc
+2
-2
EurekaController.java
...amework/cloud/netflix/eureka/server/EurekaController.java
+4
-3
EurekaControllerReplicasTests.java
.../netflix/eureka/server/EurekaControllerReplicasTests.java
+29
-0
No files found.
docs/src/main/asciidoc/spring-cloud-netflix.adoc
View file @
ef755f3a
...
...
@@ -1194,7 +1194,7 @@ class FooController {
private FooClient adminClient;
@Autowired
@Autowired
public FooController(
Decoder decoder, Encoder encoder, Client client) {
this.fooClient = Feign.builder().client(client)
...
...
@@ -1227,7 +1227,7 @@ To disable Hystrix support on a per-client basis create a vanilla `Feign.Builder
----
@Configuration
public class FooConfiguration {
@Bean
@Bean
@Scope("prototype")
public Feign.Builder feignBuilder() {
return Feign.builder();
...
...
spring-cloud-netflix-eureka-server/src/main/java/org/springframework/cloud/netflix/eureka/server/EurekaController.java
View file @
ef755f3a
...
...
@@ -49,6 +49,7 @@ import com.netflix.eureka.util.StatusInfo;
/**
* @author Spencer Gibb
* @author Gang Li
*/
@Controller
@RequestMapping
(
"${eureka.dashboard.path:/}"
)
...
...
@@ -287,12 +288,12 @@ public class EurekaController {
private
String
scrubBasicAuth
(
String
urlList
){
String
[]
urls
=
urlList
.
split
(
","
);
String
filteredUrls
=
""
;
String
Builder
filteredUrls
=
new
StringBuilder
()
;
for
(
String
u
:
urls
){
if
(
u
.
contains
(
"@"
)){
filteredUrls
+=
u
.
substring
(
0
,
u
.
indexOf
(
"//"
)+
2
)+
u
.
substring
(
u
.
indexOf
(
"@"
)+
1
,
u
.
length
())+
","
;
filteredUrls
.
append
(
u
.
substring
(
0
,
u
.
indexOf
(
"//"
)+
2
)).
append
(
u
.
substring
(
u
.
indexOf
(
"@"
)+
1
,
u
.
length
())).
append
(
","
)
;
}
else
{
filteredUrls
+=
u
+
","
;
filteredUrls
.
append
(
u
).
append
(
","
)
;
}
}
return
filteredUrls
.
substring
(
0
,
filteredUrls
.
length
()-
1
);
...
...
spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/EurekaControllerReplicasTests.java
View file @
ef755f3a
...
...
@@ -23,6 +23,15 @@ public class EurekaControllerReplicasTests {
String
authList1
=
"http://user:pwd@test1.com"
;
String
authList2
=
authList1
+
",http://user2:pwd2@test2.com"
;
String
combinationAuthList1
=
"http://test1.com,http://user2:pwd2@test2.com"
;
String
combinationAuthList2
=
"http://test3.com,http://user4:pwd4@test4.com"
;
String
combinationNoAuthList1
=
"http://test1.com,http://test2.com"
;
String
combinationNoAuthList2
=
"http://test3.com,http://test4.com"
;
String
totalAutoList
=
combinationAuthList1
+
","
+
combinationAuthList2
;
String
totalNoAutoList
=
combinationNoAuthList1
+
","
+
combinationNoAuthList2
;
String
empty
=
new
String
();
private
ApplicationInfoManager
original
;
...
...
@@ -81,4 +90,24 @@ public class EurekaControllerReplicasTests {
}
@Test
public
void
testFilterReplicasAuthWithCombinationList
()
throws
Exception
{
Map
<
String
,
Object
>
model
=
new
HashMap
<>();
StatusInfo
statusInfo
=
StatusInfo
.
Builder
.
newBuilder
()
.
add
(
"registered-replicas"
,
totalAutoList
)
.
add
(
"available-replicas"
,
combinationAuthList1
)
.
add
(
"unavailable-replicas"
,
combinationAuthList2
)
.
withInstanceInfo
(
instanceInfo
).
build
();
EurekaController
controller
=
new
EurekaController
(
null
);
controller
.
filterReplicas
(
model
,
statusInfo
);
@SuppressWarnings
(
"unchecked"
)
Map
<
String
,
String
>
results
=
(
Map
<
String
,
String
>)
model
.
get
(
"applicationStats"
);
assertEquals
(
totalNoAutoList
,
results
.
get
(
"registered-replicas"
));
assertEquals
(
combinationNoAuthList1
,
results
.
get
(
"available-replicas"
));
assertEquals
(
combinationNoAuthList2
,
results
.
get
(
"unavailable-replicas"
));
}
}
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