All Projects → EdgeGallery → website-gateway

EdgeGallery / website-gateway

Licence: Apache-2.0 license
In the EdgeGallery, we use the architecture design that separates the foreground and background server. We use the website-gateway to forward request from foreground to the background.

Programming Languages

java
68154 projects - #9 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to website-gateway

mecm-appo
A sub module of EdgeGallery MECM which responsible for the app orchestration.
Stars: ✭ 25 (+19.05%)
Mutual labels:  edgegallery
helm-charts
No description or website provided.
Stars: ✭ 27 (+28.57%)
Mutual labels:  edgegallery
developer-fe
The frontend service for developer module of EdgeGallery platform
Stars: ✭ 21 (+0%)
Mutual labels:  edgegallery
mecm-apm
A sub module of EdgeGallery MECM which responsible for the app package management.
Stars: ✭ 21 (+0%)
Mutual labels:  edgegallery
mecm-fe
A sub module of EdgeGallery MECM which responsible for the orchestration portal.
Stars: ✭ 20 (-4.76%)
Mutual labels:  edgegallery
appstore-fe
The frontend service for appstore module of EdgeGallery platform
Stars: ✭ 21 (+0%)
Mutual labels:  edgegallery
developer-be
The backend service for developer module of EdgeGallery platform
Stars: ✭ 24 (+14.29%)
Mutual labels:  edgegallery
docs
The docs of EdgeGallery
Stars: ✭ 22 (+4.76%)
Mutual labels:  edgegallery
mecm-apprulemgr
A sub module of EdgeGallery MECM which responsible for the app rule management
Stars: ✭ 22 (+4.76%)
Mutual labels:  edgegallery
plugins
Kubernetes plugins for EdgeGallery
Stars: ✭ 19 (-9.52%)
Mutual labels:  edgegallery
user-mgmt
The backend service for user management module of EdgeGallery platform.
Stars: ✭ 23 (+9.52%)
Mutual labels:  edgegallery
atp
A backend service for EdgeGallery application testing and verification
Stars: ✭ 20 (-4.76%)
Mutual labels:  edgegallery
toolchain
To quickly integrate your applications into the EdgeGallery platform, we provide the toolchain project to help developers quickly modify code and migrate applications to the platform.
Stars: ✭ 19 (-9.52%)
Mutual labels:  edgegallery
mecm-inventory
A sub module of EdgeGallery MECM which responsible for inventory.
Stars: ✭ 23 (+9.52%)
Mutual labels:  edgegallery
example-apps
The repo contains all demo applications based on EdgeGallery
Stars: ✭ 19 (-9.52%)
Mutual labels:  edgegallery

License

Website-gateway主要能力

Website-gateway用来封装EdgeGallery各业务平台的前台服务,主要提供如下几方面能力:

  • 1 实现后台接口的隔离,客户端的访问请求通过website-gateway的zuul网关转发到后台服务
  • 2 实现单点登录的客户端服务
  • 3 支持北向接口请求转发
  • 4 支持会话失效向客户端推送通知

How to start

  • 1 编译业务前台代码,将dist目录中的内容复制到Website-gateway的/src/main/resource/static中

  • 2 本地启动时需配置如下环境变量:

    • SC_ADDRESS:连接SC的地址。本地运行的SC默认为:http://127.0.0.1:30100
    • CLIENT_ID: 待启动前台服务的ID。需要与User Management服务中配置的oauth2.clients.clientId保持一致
    • CLIENT_SECRET: 待启动前台服务的密钥。需要与User Management服务中配置的oauth2.clients.clientSecret保持一致
    • AUTH_SERVER_ADDRESS: User Management服务的URL,如http://x.x.x.x:8067
    • AUTH_SERVER_ADDRESS_CLIENTACCESS: 该配置是为代理访问模式定义的变量。正常访问模式下,与AUTH_SERVER_ADDRESS保持一致即可
    • COOKIE_NAME:为对应业务前台定义的SESSION ID,例如AppStore的SESSIONID名称为APPSTORESESSIONID。也可以不配置,使用默认的JSESSIONID
  • 3 本地启动:

    运行/src/main/java/org/edgegallery/website/GatewayApplication.java文件中的main函数就能启动对应的业务前台。

Use RateLimit-zuul to limit API

zuul:
  routes:
    user-mgmt-be: /mec-usermgmt/**
    mec-developer: /mec-developer/**
    mec-appstore: /mec-appstore/**
    mec-atp: /mec-atp/**
    mec-lab: /mec-lab/**
    mecm-inventory: /mecm-inventory/**
    mecm-appo: /mecm-appo/**
    mecm-apm: /mecm-apm/**
    mecm-north: /mecm-north/**
    mec-thirdsystem: /mec-thirdsystem/**
  sensitive-headers:
  ratelimit:
    enabled: true
    behind-proxy: false
    repository: JPA
    default-policy:
      limit: 10  #optional - request number limit per refresh interval window
      quota: 1000  #optional - request time limit per refresh interval window (in seconds)
      refresh-interval: 30 #default value is 60 (in seconds)
      type:
        - USER
        - URL
        - ORIGIN

Response when has error:

{
    "timestamp": "2021-08-04T01:40:54.123+0000",
    "status": 429,
    "error": "Too Many Requests",
    "message": ""
}

规则说明:

  • 30秒内某个链接超过10次被访问,下次请求被拦截,并返回429错误
  • 链接唯一性通过:username/访问端IP/访问API确定,例如:rate-limit-application:mec-developer:test123:/mec/developer/v1/projects/:127.0.0.1
    1. rate-limit-application: 固定前缀
    2. mec-developer: serviceId,可以是zuul.routes中定义其他服务
    3. test123: 访问链接的用户名
    4. /mec/developer/v1/projects/:被访问的链接地址
    5. 127.0.0.1:访问来源IP,从request heaser的"X-Forwarded-For"中获取
  • 使用内存数据库保存中间数据
  • 更详细配置请参考:spring-cloud-zuul-ratelimit:2.1.0.REALSE
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].