spring:
  # sentinel动态配置规则
  cloud:
    sentinel:
      zuul:
        enabled: true
        order:
          pre: 2000
          post: 500
          error: -100
      filter:
        enabled: false
      datasource:
        # 限流
        ds1:
          nacos:
            server-addr: ${zlt.nacos.server-addr}
            dataId: ${spring.application.name}-sentinel-gw-flow
            groupId: DEFAULT_GROUP
            rule-type: gw-flow
        # api分组
        ds2:
          nacos:
            server-addr: ${zlt.nacos.server-addr}
            dataId: ${spring.application.name}-sentinel-gw-api-group
            groupId: DEFAULT_GROUP
            rule-type: gw-api-group

zlt:
  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


zuul:
  ribbon-isolation-strategy: thread
  ribbon:
    eager-load:
      enabled: true
    threadPool:
      useSeparateThreadPools: true
      threadPoolKeyPrefix: api-gateway
  #关闭重试
  retryable: false
  #/oauth/token需要请求头处理
  sensitive-headers:
  ignored-headers: Access-Control-Allow-Credentials,Access-Control-Allow-Origin,Access-Control-Allow-Methods
  add-host-header: true
  routes:
    auth:
      path: /api-uaa/**
      service-id: uaa-server
      strip-prefix: true
      custom-sensitive-headers: true
    auth-login-page:
      path: /login.html
      service-id: uaa-server
      strip-prefix: true
      custom-sensitive-headers: true
    auth-login-process:
      path: /user/login
      service-id: uaa-server
      strip-prefix: true
      custom-sensitive-headers: true
    auth-login-token:
      path: /oauth/token
      service-id: uaa-server
      strip-prefix: true
      custom-sensitive-headers: true
    auth-login-authorize:
      path: /oauth/authorize
      service-id: uaa-server
      strip-prefix: true
      custom-sensitive-headers: true
    auth-check-process:
      path: /oauth/check_token
      service-id: uaa-server
      strip-prefix: true
      custom-sensitive-headers: true
    user:
      path: /api-user/**
      service-id: user-center
      strip-prefix: true
      custom-sensitive-headers: true
    file:
      path: /api-file/**
      service-id: file-center
      strip-prefix: true
    log:
      path: /api-log/**
      service-id: log-center
      strip-prefix: true
    generator:
      path: /api-generator/**
      service-id: code-generator
      strip-prefix: true
    search:
      path: /api-search/**
      service-id: search-center
      strip-prefix: true
      custom-sensitive-headers: true
  ssl-hostname-validation-enabled: false

hystrix:
  threadpool:
    default:
      coreSize: 100
      maximumSize: 2000
      allowMaximumSizeToDivergeFromCoreSize: true
      maxQueueSize: -1
  command:
    default:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 60000

swagger:
  butler:
    api-docs-path:  v2/api-docs
    swagger-version: 2.0
    auto-generate-from-zuul-routes: true
    generate-routes: user,file