فهرست منبع

权限认证调整修改2

rengb 3 سال پیش
والد
کامیت
56dc4ff102

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

@@ -11,13 +11,12 @@ spring:
     oauth2:
       resourceserver:
         jwt:
-          jwk-set-uri: 'http://localhost:8860/userauth/rsa/publicKey' #配置RSA的公钥访问地址
+          jwk-set-uri: 'http://localhost:8869/userauth/rsa/publicKey' #配置RSA的公钥访问地址
   cloud:
     gateway:
       discovery:
         locator:
           enabled: true
-      #          lower-case-service-id: true
       routes:
         - id: structure-center
           uri: lb://structure-center
@@ -37,7 +36,6 @@ spring:
             - Path=/userauth/**
           filters:
             - StripPrefix=1
-  #redis
   redis:
     database:
       cache: 8 # cache索引

+ 0 - 32
security-center/src/main/java/com/lantone/security/client/AuthServiceClient.java

@@ -1,32 +0,0 @@
-package com.lantone.security.client;
-
-import com.lantone.security.client.hystrix.AuthServiceHystrix;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.security.oauth2.common.OAuth2AccessToken;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestHeader;
-import org.springframework.web.bind.annotation.RequestParam;
-
-
-/**
- * @Description: 请求认证授权服务器客户端
- * @author: gaodm
- * @time: 2018/8/2 13:37
- */
-@FeignClient(name = "oath-self", url = "${oath.self.address}",fallback = AuthServiceHystrix.class)
-public interface AuthServiceClient {
-
-    @PostMapping(value = "/oauth/token")
-    JWT getToken(@RequestHeader(value = "Authorization") String authorization, @RequestParam("grant_type") String type, @RequestParam("username") String username, @RequestParam("password") String password);
-
-    @PostMapping(value = "/oauth/token")
-    JWT refreshToken(@RequestHeader(value = "Authorization") String authorization, @RequestParam("grant_type") String type, @RequestParam("refresh_token") String refreshToken);
-
-    @PostMapping(value = "/oauth/check_token")
-    OAuth2AccessToken checkToken(@RequestHeader(value = "Authorization") String authorization, @RequestParam("token") String token);
-
-
-}
-
-
-

+ 0 - 35
security-center/src/main/java/com/lantone/security/client/hystrix/AuthServiceHystrix.java

@@ -1,35 +0,0 @@
-package com.lantone.security.client.hystrix;
-
-
-import com.lantone.security.client.AuthServiceClient;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.security.oauth2.common.OAuth2AccessToken;
-import org.springframework.stereotype.Component;
-
-/**
- * @Description: 请求认证授权服务器客户端(请求失败熔断)
- * @author: gaodm
- * @time: 2018/8/2 13:37
- */
-@Component
-@Slf4j
-public class AuthServiceHystrix implements AuthServiceClient {
-    @Override
-    public JWT getToken(String authorization, String type, String username, String password) {
-        log.error("【hystrix】调用{}异常", "getToken");
-        return null;
-    }
-
-    @Override
-    public JWT refreshToken(String authorization, String type, String refreshToken) {
-        log.error("【hystrix】调用{}异常", "refreshToken");
-        return null;
-    }
-
-    @Override
-    public OAuth2AccessToken checkToken(String authorization, String token){
-        log.error("【hystrix】调用{}异常", "checkToken");
-        return null;
-    }
-
-}

+ 0 - 15
security-center/src/main/java/com/lantone/security/vo/JwtVO.java

@@ -1,15 +0,0 @@
-package com.lantone.security.vo;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * @Description:
- * @author: gaodm
- * @time: 2018/9/29 9:22
- */
-@Getter
-@Setter
-public class JwtVO {
-    private String token;
-}

+ 16 - 95
security-center/src/main/resources/bootstrap.yml

@@ -1,75 +1,9 @@
 server:
-  port: 6010
-  max-http-header-size: 10MB
+  port: 8849
 
-hystrix:
-  threadpool:
-    default:
-      coreSize: 200 #并发执行的最大线程数,默认10
-      maxQueueSize: 200 #BlockingQueue的最大队列数
-      queueSizeRejectionThreshold: 50 #即使maxQueueSize没有达到,达到queueSizeRejectionThreshold该值后,请求也会被拒绝
-  command:
-    QcServiceClient#extract(QueryVo).execution.isolation.thread.timeoutInMilliseconds: 3600000
-    default:
-      execution:
-        timeout:
-          enabled: true
-        isolation:
-          strategy: SEMAPHORE
-          semaphore:
-            maxConcurrentRequests: 2000
-          thread:
-            timeoutInMilliseconds: 20000
-
-ribbon:
-  ReadTimeout: 20000
-  ConnectTimeout: 20000
-  MaxAutoRetries: 0
-  MaxAutoRetriesNextServer: 1
-
-feign:
-  hystrix:
-    enabled: true
-  #开启Feign请求压缩
-  compression:
-    response:
-      enabled: true
-  httpclient:
-    enabled: false
-  okhttp:
-    enabled: true
-    max-connections: 1000 # 默认值
-    max-connections-per-route: 250 # 默认值
-
-management:
-  endpoints:
-    web:
-      exposure:
-        include: bus-refresh,health,info,hystrix.stream
-      cors:
-        allowed-origins: "*"
-        allowed-methods: "*"
-  endpoint:
-    health:
-      show-details: always
-
-# 驱动配置信息
 spring:
   application:
     name: security-center
-  cloud:
-    config:
-      discovery:
-        enabled: true
-        service-id: config-center
-  main:
-    allow-bean-definition-overriding: true
-
-  jackson:
-    date-format: yyyy-MM-dd HH:mm:ss
-    time-zone: GMT+8
-
-  #redis
   redis:
     database:
       cache: 8 # cache索引
@@ -85,34 +19,6 @@ spring:
         min-idle: 0 # 连接池中的最小空闲连接
     timeout: 20000 # 连接超时时间(毫秒)
 
-  servlet:
-    multipart:
-      max-request-size: 2048MB
-
-
-
-myhost: localhost
-oath.self.address: http://${myhost}:${server.port}
-
-# 加解密开关
-encrypt:
-  enable: true
-
-swagger:
-  enable: true
-
-#xml解析成结构化开关
-xml_analyse:
-  enable: false
-
-#函数初始化modeId开关
-initmodeid:
-  enable: false
-
-#对接过程中是否记录正常流程的日志
-log_switch:
-  enable: true
-
 eureka:
   client:
     service-url:
@@ -122,6 +28,21 @@ logging:
   config: classpath:logback-spring.xml
   file: logs/security-center/log_info.log
 
+management:
+  endpoints:
+    web:
+      exposure:
+        include: '*'
+  endpoint:
+    health:
+      show-details: always
+
+feign:
+  okhttp:
+    enabled: true
+ribbon:
+  ConnectTimeout: 3000 #服务请求连接超时时间(毫秒)
+  ReadTimeout: 3000 #服务请求处理超时时间(毫秒)
 
 swagger.title: 权限管理服务
 swagger.des: 权限管理服务

BIN
security-center/src/main/resources/diagbot-jwt.jks


+ 0 - 9
security-center/src/main/resources/public.cert

@@ -1,9 +0,0 @@
------BEGIN PUBLIC KEY-----
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxXZWH/WgxW9eTT6AmPRo
-GFY3T5V1+F1458dcQFw0EZejjHuGwEeHvxcgl4059Me2B1xXTs3FDXTWQ5z19EtP
-3ITYtnFTo2cxhwxiwqN8ZqFdpq5Uac0mzjlYKcyGp8x6t+Nc2cv3D3Ul2VIbGvbP
-sQOeKvt3WxWwdpQ+q3RXjRUFQGiygSD7yuXHIUpcOsm4ZWDlUkjfwX1q4pjiwFfA
-Mq5xgkzPwolUKnI0NFnom3Th3i4oFXzUg2s6cEj7jL7YU35c2/9kE7WQPbeYhoSi
-XH2OwWgBk/2Ki6+Q0Yq/eAsXSBjp1jqh337vvKBk5ocPG1Imi8uTLIgYQCMwzvg+
-VQIDAQAB
------END PUBLIC KEY-----

+ 1 - 1
user-auth/src/main/resources/bootstrap.yml

@@ -1,5 +1,5 @@
 server:
-  port: 8860
+  port: 8869
 
 spring:
   application: