问题
With this architecture, i created a configServer that point to git repository where all my configurations are stored
Now, i want to secure this configurations because it contains a critic information (as servers, passwords, ...etc.)
So, to do that i fount this
By adding the dependency spring-boot-starter-security
to the configServer, then defining user, password in the application.properties
my configuration's files are now protected by Basic Authentication
Now, i must share my user/password to every client bootstrap.yml
so they can fetch configurations from configServer
spring.cloud.config.uri: http://localhost:8888
spring.application.name: ws-config
spring.profiles.active: default
spring.cloud.config.label: local_dev
spring.cloud.config.username: user
spring.cloud.config.password: password
This work perfectly for me, now every micro-service can fetch it's own configuration by the authentication user, password
Now, i want to do this in an other way (if possible)
Defining a security in configServer (only in configServer) by filters or cross-origins, so the goal is to not sharing any user, password
with clients
So, something like this
config.setAllowedOrigins(Arrays.asList("http://localhost:8085", "http://localhost:8081", "http://localhost:8080")); //mean only this links can fetch configurations from configServer
来源:https://stackoverflow.com/questions/55729819/add-filters-in-configserver