You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2022/11/10 14:36:50 UTC

[GitHub] [servicecomb-kie] 123yangxiong opened a new pull request, #265: Dev

123yangxiong opened a new pull request, #265:
URL: https://github.com/apache/servicecomb-kie/pull/265

   增加单元测试, history添加rbac校验,dao层error处理


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [servicecomb-kie] little-cui commented on a diff in pull request #265: Dev

Posted by GitBox <gi...@apache.org>.
little-cui commented on code in PR #265:
URL: https://github.com/apache/servicecomb-kie/pull/265#discussion_r1020008474


##########
server/datasource/etcd/history/history_dao.go:
##########
@@ -54,8 +56,14 @@ func (s *Dao) GetHistory(ctx context.Context, kvID, project, domain string, opti
 		}
 		histories = append(histories, &doc)
 	}
+
+	filterKVs, err := auth.FilterKVList(ctx, histories)

Review Comment:
   按获取单个kv的权限判断,如果没有权限应该是返回401,而不是过滤历史列表



##########
server/datasource/etcd/history/history_dao.go:
##########
@@ -132,6 +145,10 @@ func (s *Dao) historyRotate(ctx context.Context, kvID, project, domain string) e
 func DeleteMany(ctx context.Context, kvs []*model.KVDoc) error {
 	var opts []etcdadpt.OpOptions
 	for _, kv := range kvs {
+		if err := auth.CheckDeleteKV(ctx, kv); err != nil {

Review Comment:
   无需判断权限



##########
server/datasource/etcd/history/history_dao.go:
##########
@@ -80,11 +88,16 @@ func pagingResult(histories []*model.KVDoc, offset, limit int64) []*model.KVDoc
 
 // AddHistory add kv history
 func (s *Dao) AddHistory(ctx context.Context, kv *model.KVDoc) error {
+	if err := auth.CheckCreateKV(ctx, kv); err != nil {

Review Comment:
   无需判断权限



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [servicecomb-kie] 123yangxiong commented on a diff in pull request #265: Dev

Posted by GitBox <gi...@apache.org>.
123yangxiong commented on code in PR #265:
URL: https://github.com/apache/servicecomb-kie/pull/265#discussion_r1020176610


##########
server/datasource/etcd/history/history_dao.go:
##########
@@ -80,11 +88,16 @@ func pagingResult(histories []*model.KVDoc, offset, limit int64) []*model.KVDoc
 
 // AddHistory add kv history
 func (s *Dao) AddHistory(ctx context.Context, kv *model.KVDoc) error {
+	if err := auth.CheckCreateKV(ctx, kv); err != nil {

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [servicecomb-kie] 123yangxiong commented on a diff in pull request #265: Dev

Posted by GitBox <gi...@apache.org>.
123yangxiong commented on code in PR #265:
URL: https://github.com/apache/servicecomb-kie/pull/265#discussion_r1020176981


##########
server/datasource/etcd/history/history_dao.go:
##########
@@ -132,6 +145,10 @@ func (s *Dao) historyRotate(ctx context.Context, kvID, project, domain string) e
 func DeleteMany(ctx context.Context, kvs []*model.KVDoc) error {
 	var opts []etcdadpt.OpOptions
 	for _, kv := range kvs {
+		if err := auth.CheckDeleteKV(ctx, kv); err != nil {

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [servicecomb-kie] 123yangxiong commented on a diff in pull request #265: Dev

Posted by GitBox <gi...@apache.org>.
123yangxiong commented on code in PR #265:
URL: https://github.com/apache/servicecomb-kie/pull/265#discussion_r1020176263


##########
server/datasource/etcd/history/history_dao.go:
##########
@@ -54,8 +56,14 @@ func (s *Dao) GetHistory(ctx context.Context, kvID, project, domain string, opti
 		}
 		histories = append(histories, &doc)
 	}
+
+	filterKVs, err := auth.FilterKVList(ctx, histories)

Review Comment:
   done
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [servicecomb-kie] little-cui merged pull request #265: Dev

Posted by GitBox <gi...@apache.org>.
little-cui merged PR #265:
URL: https://github.com/apache/servicecomb-kie/pull/265


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [servicecomb-kie] little-cui commented on a diff in pull request #265: Dev

Posted by GitBox <gi...@apache.org>.
little-cui commented on code in PR #265:
URL: https://github.com/apache/servicecomb-kie/pull/265#discussion_r1020262987


##########
server/datasource/auth/filter_kvdoc_test.go:
##########
@@ -0,0 +1,42 @@
+package auth
+

Review Comment:
   license header



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org