Pārlūkot izejas kodu

euraka加入用户名密码

gaodm 3 gadi atpakaļ
vecāks
revīzija
31bb3f5b09
31 mainītis faili ar 183 papildinājumiem un 30 dzēšanām
  1. 5 1
      admin-service/src/main/resources/bootstrap.yml
  2. 5 1
      aipt-service/src/main/resources/bootstrap.yml
  3. 5 1
      bi-service/src/main/resources/bootstrap.yml
  4. 5 1
      cdssman-service/src/main/resources/bootstrap.yml
  5. 5 1
      config-server/src/main/resources/application.yml
  6. 5 1
      data-service/src/main/resources/bootstrap.yml
  7. 5 2
      diagbotman-service/src/main/resources/bootstrap.yml
  8. 4 0
      eureka-server/pom.xml
  9. 24 0
      eureka-server/src/main/java/com/diagbot/config/WebSecurityConfig.java
  10. 7 1
      eureka-server/src/main/resources/application-dev.yml
  11. 7 1
      eureka-server/src/main/resources/application-local.yml
  12. 7 1
      eureka-server/src/main/resources/application-pre.yml
  13. 7 1
      eureka-server/src/main/resources/application-pro.yml
  14. 7 1
      eureka-server/src/main/resources/application-test.yml
  15. 5 1
      feedback-service/src/main/resources/bootstrap.yml
  16. 5 1
      gateway-service/src/main/resources/bootstrap.yml
  17. 5 1
      icss-service/src/main/resources/bootstrap.yml
  18. 5 1
      icssman-service/src/main/resources/bootstrap.yml
  19. 5 1
      knowledgeman-service/src/main/resources/bootstrap.yml
  20. 5 1
      log-service/src/main/resources/bootstrap.yml
  21. 5 1
      ltapi-service/src/main/resources/bootstrap.yml
  22. 5 1
      ltkg-service/src/main/resources/bootstrap.yml
  23. 5 1
      monitor-service/src/main/resources/bootstrap.yml
  24. 5 1
      mrman-service/src/main/resources/bootstrap.yml
  25. 5 1
      mrqcman-service/src/main/resources/bootstrap.yml
  26. 5 1
      prec-service/src/main/resources/bootstrap.yml
  27. 5 1
      precman-service/src/main/resources/bootstrap.yml
  28. 5 1
      tran-service/src/main/resources/bootstrap.yml
  29. 5 1
      triage-service/src/main/resources/bootstrap.yml
  30. 5 1
      uaa-service/src/main/resources/bootstrap.yml
  31. 5 1
      user-service/src/main/resources/bootstrap.yml

+ 5 - 1
admin-service/src/main/resources/bootstrap.yml

@@ -14,9 +14,13 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q
 
 
 

+ 5 - 1
aipt-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 5 - 1
bi-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 5 - 1
cdssman-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 5 - 1
config-server/src/main/resources/application.yml

@@ -44,7 +44,7 @@ eureka:
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 management:
   endpoints:
@@ -61,5 +61,9 @@ management:
 #    enabled: false
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q
 
 

+ 5 - 1
data-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 5 - 2
diagbotman-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,9 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
-myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 4 - 0
eureka-server/pom.xml

@@ -47,6 +47,10 @@
             <groupId>net.logstash.logback</groupId>
             <artifactId>logstash-logback-encoder</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-security</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

+ 24 - 0
eureka-server/src/main/java/com/diagbot/config/WebSecurityConfig.java

@@ -0,0 +1,24 @@
+package com.diagbot.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2022/4/11 17:24
+ */
+@Configuration
+@EnableWebSecurity
+public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
+
+    @Override
+    protected void configure(HttpSecurity http) throws Exception {
+        // 关闭csrf
+        http.csrf().disable();
+        // 支持httpBasic
+        http.authorizeRequests().anyRequest().authenticated().and().httpBasic();
+    }
+}

+ 7 - 1
eureka-server/src/main/resources/application-dev.yml

@@ -5,4 +5,10 @@ eureka:
     register-with-eureka: false
     fetch-registry: false
     serviceUrl:
-      defaultZone: http://eureka1:${server.port}/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@eureka1:${server.port}/eureka/
+
+spring:
+  security: # security 账号密码
+    user:
+      name: lantone
+      password: ewd89987dwer9q

+ 7 - 1
eureka-server/src/main/resources/application-local.yml

@@ -5,4 +5,10 @@ eureka:
     register-with-eureka: false
     fetch-registry: false
     serviceUrl:
-      defaultZone: http://localhost:${server.port}/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@localhost:${server.port}/eureka/
+
+spring:
+  security: # security 账号密码
+    user:
+      name: lantone
+      password: ewd89987dwer9q

+ 7 - 1
eureka-server/src/main/resources/application-pre.yml

@@ -5,4 +5,10 @@ eureka:
     register-with-eureka: false
     fetch-registry: false
     serviceUrl:
-      defaultZone: http://eureka1:${server.port}/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@eureka1:${server.port}/eureka/
+
+spring:
+  security: # security 账号密码
+    user:
+      name: lantone
+      password: ewd89987dwer9q

+ 7 - 1
eureka-server/src/main/resources/application-pro.yml

@@ -5,4 +5,10 @@ eureka:
     register-with-eureka: false
     fetch-registry: false
     serviceUrl:
-      defaultZone: http://eureka1:${server.port}/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@eureka1:${server.port}/eureka/
+
+spring:
+  security: # security 账号密码
+    user:
+      name: lantone
+      password: ewd89987dwer9q

+ 7 - 1
eureka-server/src/main/resources/application-test.yml

@@ -5,4 +5,10 @@ eureka:
     register-with-eureka: false
     fetch-registry: false
     serviceUrl:
-      defaultZone: http://eureka1:${server.port}/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@eureka1:${server.port}/eureka/
+
+spring:
+  security: # security 账号密码
+    user:
+      name: lantone
+      password: ewd89987dwer9q

+ 5 - 1
feedback-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 5 - 1
gateway-service/src/main/resources/bootstrap.yml

@@ -16,8 +16,12 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q
 
 

+ 5 - 1
icss-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 5 - 1
icssman-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 5 - 1
knowledgeman-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 5 - 1
log-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 5 - 1
ltapi-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 5 - 1
ltkg-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 5 - 1
monitor-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 5 - 1
mrman-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 5 - 1
mrqcman-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 5 - 1
prec-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 5 - 1
precman-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 5 - 1
tran-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 5 - 1
triage-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q

+ 5 - 1
uaa-service/src/main/resources/bootstrap.yml

@@ -16,9 +16,13 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q
 
 #management:
 #  security:

+ 5 - 1
user-service/src/main/resources/bootstrap.yml

@@ -14,6 +14,10 @@ spring:
 eureka:
   client:
     serviceUrl:
-      defaultZone: http://${myuri}:8761/eureka/
+      defaultZone: http://${security.user.name}:${security.user.password}@${myuri}:8761/eureka/
 
 myuri: localhost
+security:
+  user:
+    name: lantone
+    password: ewd89987dwer9q