From ca9f8bb0a940ecb22e2366b9634acf3037597099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E5=86=B7?= Date: Fri, 27 Jul 2018 21:45:49 +0800 Subject: [PATCH] =?UTF-8?q?:wrench:=20=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E3=80=82=E8=B0=83=E6=95=B4=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/swagger/config/SwaggerAutoConfiguration.java | 7 ++++--- pigx-config/src/main/resources/config/pigx-upms-dev.yml | 4 ++-- pigx-eureka/src/main/resources/bootstrap.yml | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pigx-common/pigx-common-swagger/src/main/java/com/pig4cloud/pigx/common/swagger/config/SwaggerAutoConfiguration.java b/pigx-common/pigx-common-swagger/src/main/java/com/pig4cloud/pigx/common/swagger/config/SwaggerAutoConfiguration.java index 60cd4ea48..97afe4707 100644 --- a/pigx-common/pigx-common-swagger/src/main/java/com/pig4cloud/pigx/common/swagger/config/SwaggerAutoConfiguration.java +++ b/pigx-common/pigx-common-swagger/src/main/java/com/pig4cloud/pigx/common/swagger/config/SwaggerAutoConfiguration.java @@ -87,6 +87,7 @@ public class SwaggerAutoConfiguration { /** * 配置默认的全局鉴权策略的开关,通过正则表达式进行匹配;默认匹配所有URL + * * @return */ private SecurityContext securityContext() { @@ -103,7 +104,7 @@ public class SwaggerAutoConfiguration { */ private List defaultAuth() { ArrayList authorizationScopeList = new ArrayList<>(); - swaggerProperties().getAuthorization().getAuthorizationScopeList().forEach(authorizationScope->authorizationScopeList.add(new AuthorizationScope(authorizationScope.getScope(),authorizationScope.getDescription()))); + swaggerProperties().getAuthorization().getAuthorizationScopeList().forEach(authorizationScope -> authorizationScopeList.add(new AuthorizationScope(authorizationScope.getScope(), authorizationScope.getDescription()))); AuthorizationScope[] authorizationScopes = new AuthorizationScope[authorizationScopeList.size()]; return Collections.singletonList(SecurityReference.builder() .reference(swaggerProperties().getAuthorization().getName()) @@ -114,9 +115,9 @@ public class SwaggerAutoConfiguration { private OAuth securitySchema() { ArrayList authorizationScopeList = new ArrayList<>(); - swaggerProperties().getAuthorization().getAuthorizationScopeList().forEach(authorizationScope->authorizationScopeList.add(new AuthorizationScope(authorizationScope.getScope(),authorizationScope.getDescription()))); + swaggerProperties().getAuthorization().getAuthorizationScopeList().forEach(authorizationScope -> authorizationScopeList.add(new AuthorizationScope(authorizationScope.getScope(), authorizationScope.getDescription()))); ArrayList grantTypes = new ArrayList<>(); - swaggerProperties().getAuthorization().getTokenUrlList().forEach(tokenUrl->grantTypes.add(new ResourceOwnerPasswordCredentialsGrant(tokenUrl))); + swaggerProperties().getAuthorization().getTokenUrlList().forEach(tokenUrl -> grantTypes.add(new ResourceOwnerPasswordCredentialsGrant(tokenUrl))); return new OAuth(swaggerProperties().getAuthorization().getName(), authorizationScopeList, grantTypes); } 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 98df2c4bc..4e29bb29c 100644 --- a/pigx-config/src/main/resources/config/pigx-upms-dev.yml +++ b/pigx-config/src/main/resources/config/pigx-upms-dev.yml @@ -2,8 +2,8 @@ security: oauth2: client: - client-id: pigx - client-secret: pigx + client-id: pig + client-secret: pig scope: server resource: token-info-uri: http://localhost:9999/auth/oauth/check_token diff --git a/pigx-eureka/src/main/resources/bootstrap.yml b/pigx-eureka/src/main/resources/bootstrap.yml index e933fbe80..b5d334125 100644 --- a/pigx-eureka/src/main/resources/bootstrap.yml +++ b/pigx-eureka/src/main/resources/bootstrap.yml @@ -13,7 +13,7 @@ spring: # 类似的 redis 使用pigx-redis ,gateway 换成 pigx-gateway eureka: instance: - hostname: pigx-eureka + hostname: localhost prefer-ip-address: true client: register-with-eureka: true