servicecomb-service-center icon indicating copy to clipboard operation
servicecomb-service-center copied to clipboard

[feat] Added whitelist function in synchronization

Open robotLJW opened this issue 2 years ago • 0 comments

【背景】完成指定不同步的功能即增加白名单 【修改内容】 1.在sync目录中的config定义service、account和role的结构体,然后新建whitelist目录新建相关service、account和role的允许同步func,并新增相关测试用例覆盖率为100%; 2.修改server/service/disco的相关接口中,新增服务白名单判断 IsInWhiteList,这个逻辑先判断服务是否存在,然后再去判断是否符合白名单规则要求; 涉及的接口:

microService接口: RegisterService, UnregisterService, PutServiceProperties instance接口: RegisterInstance, UnregisterInstance, SendHeartbeat, FindInstances(订阅), PutInstanceStatus, PutInstanceProperties schema接口: DeleteSchema, PutSchemas, PutSchema tag接口: PutManyTags, PutTag, DeleteManyTags

并在disco中编写相关的sync测试用例,将原先在etcd中的部分同步测试用例删除 【修改原因】新增功能 【测试用例】见修改中的内容 【遗留问题】 1.未完成account和role的白名单过滤,不过已经实现了相关方法 【测试验证】白名单中过滤规则:以 sync* 开头的服务

microService接口

1.注册服务 image image


  1. 更新服务Properties image image

  1. 注销服务 image image

instance接口

  1. 注册实例 image image

  1. 发送心跳 SendHeartbeat image

  1. 更新实例状态PutInstanceStatus

image image


  1. 更新实例的配置PutInstanceProperties image

image


  1. 查找实例(订阅) FindInstances image

image


  1. 注销实例 UnregisterInstance

image image


schema接口

  1. 更新PutSchemas

image

image

2.删除schema DeleteSchema

image image

3.更新schema

image image

tag接口

  1. 新增tags PutManyTags image image

  1. 更新tag PutTag image image

  1. 删除tags DeleteManyTags image image

robotLJW avatar May 18 '22 10:05 robotLJW