mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-08 12:39:05 +08:00
🔧 修改配置文件。调整配置
This commit is contained in:
1 parent
b9275daf1c
commit
ca9f8bb0a9
3 files changed
+7
-6
No files matched your search
+4
-3
@@ -87,6 +87,7 @@ public class SwaggerAutoConfiguration {
|
||||
|
||||
/**
|
||||
* 配置默认的全局鉴权策略的开关,通过正则表达式进行匹配;默认匹配所有URL
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private SecurityContext securityContext() {
|
||||
@@ -103,7 +104,7 @@ public class SwaggerAutoConfiguration {
|
||||
*/
|
||||
private List<SecurityReference> defaultAuth() {
|
||||
ArrayList<AuthorizationScope> 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<AuthorizationScope> 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<GrantType> 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user