From a7d86c8541b2a5d46a98b5aca920789de06aa082 Mon Sep 17 00:00:00 2001 From: lishangbu Date: Sun, 11 Nov 2018 12:24:23 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=20BUG:=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=94=BE=E8=A1=8Curl=E9=85=8D=E7=BD=AE=E4=B8=8D?= =?UTF-8?q?=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/BaseResourceServerConfigurerAdapter.java | 2 ++ pigx-config/src/main/resources/config/application-dev.yml | 7 ++++++- .../src/main/resources/config/pigx-activiti-dev.yml | 2 ++ pigx-config/src/main/resources/config/pigx-codegen-dev.yml | 4 ---- pigx-config/src/main/resources/config/pigx-daemon-dev.yml | 3 --- pigx-config/src/main/resources/config/pigx-upms-dev.yml | 1 + 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/component/BaseResourceServerConfigurerAdapter.java b/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/component/BaseResourceServerConfigurerAdapter.java index 19a02031f..acf384b52 100644 --- a/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/component/BaseResourceServerConfigurerAdapter.java +++ b/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/component/BaseResourceServerConfigurerAdapter.java @@ -19,6 +19,7 @@ package com.pig4cloud.pigx.common.security.component; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer; import org.springframework.security.core.userdetails.UserDetailsService; @@ -37,6 +38,7 @@ import org.springframework.web.client.RestTemplate; * 2. 支持 获取用户全部信息 */ @Slf4j +@Configuration public class BaseResourceServerConfigurerAdapter extends ResourceServerConfigurerAdapter { @Autowired protected ResourceAuthExceptionEntryPoint resourceAuthExceptionEntryPoint; diff --git a/pigx-config/src/main/resources/config/application-dev.yml b/pigx-config/src/main/resources/config/application-dev.yml index 333a0a25b..eb432d31f 100644 --- a/pigx-config/src/main/resources/config/application-dev.yml +++ b/pigx-config/src/main/resources/config/application-dev.yml @@ -98,6 +98,11 @@ swagger: ## spring security 配置 security: oauth2: + client: + # 默认放行url,如果子模块重写这里的配置就会被覆盖 + ignore-urls: + - '/actuator/**' + - '/v2/api-docs' resource: loadBalanced: true token-info-uri: http://pigx-auth/oauth/check_token @@ -105,5 +110,5 @@ security: # log配置 logging: level: - root: warn + root: error com.pig4cloud.pigx: info diff --git a/pigx-config/src/main/resources/config/pigx-activiti-dev.yml b/pigx-config/src/main/resources/config/pigx-activiti-dev.yml index 5548ba502..fddf791dc 100644 --- a/pigx-config/src/main/resources/config/pigx-activiti-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-activiti-dev.yml @@ -6,6 +6,8 @@ security: client-secret: ENC(gPFcUOmJm8WqM3k3eSqS0Q==) scope: server ignore-urls: + - '/actuator/**' + - '/v2/api-docs' - '/service/**' - '/editor-app/**' - '/task/view/*' diff --git a/pigx-config/src/main/resources/config/pigx-codegen-dev.yml b/pigx-config/src/main/resources/config/pigx-codegen-dev.yml index 901f7526c..0d54f50ac 100644 --- a/pigx-config/src/main/resources/config/pigx-codegen-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-codegen-dev.yml @@ -5,10 +5,6 @@ security: client-id: ENC(gPFcUOmJm8WqM3k3eSqS0Q==) client-secret: ENC(gPFcUOmJm8WqM3k3eSqS0Q==) scope: server - ignore-urls: - - '/actuator/**' - - '/v2/api-docs' - # 数据源配置 spring: datasource: diff --git a/pigx-config/src/main/resources/config/pigx-daemon-dev.yml b/pigx-config/src/main/resources/config/pigx-daemon-dev.yml index e662ed4fa..1dbdbb725 100644 --- a/pigx-config/src/main/resources/config/pigx-daemon-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-daemon-dev.yml @@ -5,9 +5,6 @@ security: client-id: ENC(tz2NM4GcmnE7sNJTYL8ZSg==) client-secret: ENC(tz2NM4GcmnE7sNJTYL8ZSg==) scope: server - ignore-urls: - - '/actuator/**' - - '/v2/api-docs' ## 定时任务 spring: # 保存定时任务的数据源 diff --git a/pigx-config/src/main/resources/config/pigx-upms-dev.yml b/pigx-config/src/main/resources/config/pigx-upms-dev.yml index a6987bd9d..adf7eb8af 100644 --- a/pigx-config/src/main/resources/config/pigx-upms-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-upms-dev.yml @@ -5,6 +5,7 @@ security: client-id: ENC(ltJPpR50wT0oIY9kfOe1Iw==) client-secret: ENC(ltJPpR50wT0oIY9kfOe1Iw==) scope: server + # 默认放行url,子模块重写时application-dev.yml中的公共配置会被覆盖,所以要把公共配置中的放行url再写一次 ignore-urls: - '/actuator/**' - '/v2/api-docs'