Я настроил Spring Discovery Server с Eureka, а также вместе с администратором Spring Boot.
При работе без какой-либо защиты все шло хорошо, затем я добавил защиту и продолжаю регистрировать свои микросервисы в Eureka, но в интерфейсе SBA UI ничего не отображается.
У меня есть базовая конфигурация безопасности Spring
@Override
public void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication()
.withUser("test").password("{noop}test").authorities("ADMIN");
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.authorizeRequests()
.anyRequest().authenticated()
.and().httpBasic();
}
и свойства
spring:
application:
name: eureka-server
boot:
admin:
context-path: /admin
username: test
password: test
eureka:
client:
register-with-eureka: false
fetch-registry: false
Чем в каждой микросервисе у меня есть эта конфигурация
eureka:
client:
serviceUrl:
defaultZone: http://test:test@localhost:8761/eureka
healthcheck:
enabled: true
instance:
metadata-map:
user:
name: test
password: test
management:
health:
defaults:
enabled: false
endpoints:
health:
sensitive: false
show-details: ALWAYS
web:
exposure:
include: '*'
security:
enabled: false
Похоже, у меня нет ошибок для SBA, если я пытаюсь достичь конечных точек привода, я вижу их (без какой-либо защиты)
например
// 20190628172436
// http://192.168.12.250:8082/actuator/
{
"_links": {
"self": {
"href": "http://192.168.12.250:8082/actuator",
"templated": false
},
"archaius": {
"href": "http://192.168.12.250:8082/actuator/archaius",
"templated": false
},
"auditevents": {
"href": "http://192.168.12.250:8082/actuator/auditevents",
"templated": false
},
"beans": {
"href": "http://192.168.12.250:8082/actuator/beans",
"templated": false
},
"caches-cache": {
"href": "http://192.168.12.250:8082/actuator/caches/{cache}",
"templated": true
},
"caches": {
"href": "http://192.168.12.250:8082/actuator/caches",
"templated": false
},
"health": {
"href": "http://192.168.12.250:8082/actuator/health",
"templated": false
},
"health-component": {
"href": "http://192.168.12.250:8082/actuator/health/{component}",
"templated": true
},
"health-component-instance": {
"href": "http://192.168.12.250:8082/actuator/health/{component}/{instance}",
"templated": true
},
"conditions": {
"href": "http://192.168.12.250:8082/actuator/conditions",
"templated": false
},
"configprops": {
"href": "http://192.168.12.250:8082/actuator/configprops",
"templated": false
},
"bus-env": {
"href": "http://192.168.12.250:8082/actuator/bus-env",
"templated": false
},
"bus-env-destination": {
"href": "http://192.168.12.250:8082/actuator/bus-env/{destination}",
"templated": true
},
"bus-refresh-destination": {
"href": "http://192.168.12.250:8082/actuator/bus-refresh/{destination}",
"templated": true
},
"bus-refresh": {
"href": "http://192.168.12.250:8082/actuator/bus-refresh",
"templated": false
},
"env-toMatch": {
"href": "http://192.168.12.250:8082/actuator/env/{toMatch}",
"templated": true
},
"env": {
"href": "http://192.168.12.250:8082/actuator/env",
"templated": false
},
"info": {
"href": "http://192.168.12.250:8082/actuator/info",
"templated": false
},
"integrationgraph": {
"href": "http://192.168.12.250:8082/actuator/integrationgraph",
"templated": false
},
"logfile": {
"href": "http://192.168.12.250:8082/actuator/logfile",
"templated": false
},
"loggers": {
"href": "http://192.168.12.250:8082/actuator/loggers",
"templated": false
},
"loggers-name": {
"href": "http://192.168.12.250:8082/actuator/loggers/{name}",
"templated": true
},
"heapdump": {
"href": "http://192.168.12.250:8082/actuator/heapdump",
"templated": false
},
"threaddump": {
"href": "http://192.168.12.250:8082/actuator/threaddump",
"templated": false
},
"metrics": {
"href": "http://192.168.12.250:8082/actuator/metrics",
"templated": false
},
"metrics-requiredMetricName": {
"href": "http://192.168.12.250:8082/actuator/metrics/{requiredMetricName}",
"templated": true
},
"scheduledtasks": {
"href": "http://192.168.12.250:8082/actuator/scheduledtasks",
"templated": false
},
"httptrace": {
"href": "http://192.168.12.250:8082/actuator/httptrace",
"templated": false
},
"mappings": {
"href": "http://192.168.12.250:8082/actuator/mappings",
"templated": false
},
"refresh": {
"href": "http://192.168.12.250:8082/actuator/refresh",
"templated": false
},
"features": {
"href": "http://192.168.12.250:8082/actuator/features",
"templated": false
},
"service-registry": {
"href": "http://192.168.12.250:8082/actuator/service-registry",
"templated": false
},
"bindings-name": {
"href": "http://192.168.12.250:8082/actuator/bindings/{name}",
"templated": true
},
"bindings": {
"href": "http://192.168.12.250:8082/actuator/bindings",
"templated": false
},
"channels": {
"href": "http://192.168.12.250:8082/actuator/channels",
"templated": false
}
}
}