增加全功能spring-cloud-gateway,优化部分公共模块适配webFlux

This commit is contained in:
zlt
2019-10-16 18:00:56 +08:00
parent eecaf5bb58
commit 1c9fcbf475
122 changed files with 3144 additions and 1936 deletions
@@ -0,0 +1,133 @@
spring:
cloud:
gateway:
discovery:
locator:
lowerCaseServiceId: true
enabled: true
routes:
- id: auth
uri: lb://uaa-server
predicates:
- Path=/api-uaa/**
filters:
- StripPrefix=1
- PreserveHostHeader
- id: auth-login-page
uri: lb://uaa-server
predicates:
- Path=/login.html
filters:
- PreserveHostHeader
- id: auth-login-process
uri: lb://uaa-server
predicates:
- Path=/user/login
filters:
- PreserveHostHeader
- id: auth-login-token
uri: lb://uaa-server
predicates:
- Path=/oauth/token
filters:
- PreserveHostHeader
- id: auth-login-authorize
uri: lb://uaa-server
predicates:
- Path=/oauth/authorize
filters:
- PreserveHostHeader
- id: auth-check-process
uri: lb://uaa-server
predicates:
- Path=/oauth/check_token
filters:
- PreserveHostHeader
- id: user
uri: lb://user-center
predicates:
- Path=/api-user/**
filters:
- StripPrefix=1
- id: file
uri: lb://file-center
predicates:
- Path=/api-file/**
filters:
- StripPrefix=1
- id: log
uri: lb://log-center
predicates:
- Path=/api-log/**
filters:
- StripPrefix=1
- id: generator
uri: lb://code-generator
predicates:
- Path=/api-generator/**
filters:
- StripPrefix=1
- id: search
uri: lb://search-center
predicates:
- Path=/api-search/**
filters:
- StripPrefix=1
# sentinel:
# datasource.ds1.nacos:
# server-addr: ${zlt.nacos.server-addr}
# data-id: ${spring.application.name}-sentinel-gw-flow
# group-id: DEFAULT_GROUP
# ruleType: gw-flow
# filter:
# enabled: true
zlt:
swagger-agg:
generate-routes: user,file
oauth2:
token:
store:
type: redis
security:
ignore:
# 忽略认证的地址
httpUrls: >
/api-uaa/oauth/**,
/api-uaa/validata/**,
/api-uaa/css/**,
/api-uaa/images/**,
/api-uaa/js/**,
/api-user/users-anon/**,
/login.html,
/user/login
auth:
urlPermission:
#是否开启url级别权限
enable: false
#配置只进行登录认证,不进行url权限认证的api
ignoreUrls: >
/api-user/menus/current,
/api-user/users/current,
/api-log/requestStat
#白名单
includeClientIds:
- webApp
renew:
#是否开启token自动续签(目前只有redis实现)
enable: true
#白名单
includeClientIds:
- webApp
gateway:
#网关动态路由
dynamicRoute:
enabled: true
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 1000
@@ -0,0 +1,19 @@
server:
port: 9900
zlt:
nacos:
server-addr: 192.168.28.130:8848
spring:
application:
name: sc-gateway
cloud:
nacos:
config:
server-addr: ${zlt.nacos.server-addr}
file-extension: yml
shared-dataids: common.yml
refreshable-dataids: common.yml
discovery:
server-addr: ${zlt.nacos.server-addr}
@@ -0,0 +1,9 @@
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjmgfejBXsPYynAIPczHA
eEvTDfAVaNKQudyI7VszdezbHDM1CStCIgwiMmLd7QYf1SrrmQoqxhcSRbhjE3ej
RF5qzhtx3kmepdpMrQptcsLjRkixaxCc4E2k6Us5707gGwbhoaTrRit5F2MnAdLY
C1TS3WwnO/hQfqUcAglbK8yrJ4AwAv0DAoIUSWnWqzuniV1SYbdV57uswxUssoWy
sEfPz+nv1ZLRs6Wz4eQ5Myqx2+CjWc9F8iXa2PV8Rmjms3dVbWcLUpCP18Dfzp8l
n8vF9LfYB7UaLSpfJe6FFF6+vCg4JHfo12djTUgwGjauMF3e9mmjU83KIoQS66lp
AQIDAQAB
-----END PUBLIC KEY-----