Skip to content

Commit

Permalink
Remove repeated authorization in restful api
Browse files Browse the repository at this point in the history
Signed-off-by: aoiasd <[email protected]>
  • Loading branch information
aoiasd committed Nov 29, 2024
1 parent 5e15276 commit b61df23
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions internal/distributed/proxy/httpserver/handler_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -2162,15 +2162,6 @@ func (h *HandlersV2) listImportJob(ctx context.Context, c *gin.Context, anyReq a
}
c.Set(ContextRequest, req)

if h.checkAuth {
err := checkAuthorizationV2(ctx, c, false, &milvuspb.ListImportsAuthPlaceholder{
DbName: dbName,
CollectionName: collectionName,
})
if err != nil {
return nil, err
}
}
resp, err := wrapperProxy(ctx, c, req, false, false, "/milvus.proto.milvus.MilvusService/ListImports", func(reqCtx context.Context, req any) (interface{}, error) {
return h.proxy.ListImports(reqCtx, req.(*internalpb.ListImportsRequest))
})
Expand Down Expand Up @@ -2214,16 +2205,6 @@ func (h *HandlersV2) createImportJob(ctx context.Context, c *gin.Context, anyReq
}
c.Set(ContextRequest, req)

if h.checkAuth {
err := checkAuthorizationV2(ctx, c, false, &milvuspb.ImportAuthPlaceholder{
DbName: dbName,
CollectionName: collectionGetter.GetCollectionName(),
PartitionName: partitionGetter.GetPartitionName(),
})
if err != nil {
return nil, err
}
}
resp, err := wrapperProxy(ctx, c, req, false, false, "/milvus.proto.milvus.MilvusService/ImportV2", func(reqCtx context.Context, req any) (interface{}, error) {
return h.proxy.ImportV2(reqCtx, req.(*internalpb.ImportRequest))
})
Expand All @@ -2243,14 +2224,6 @@ func (h *HandlersV2) getImportJobProcess(ctx context.Context, c *gin.Context, an
}
c.Set(ContextRequest, req)

if h.checkAuth {
err := checkAuthorizationV2(ctx, c, false, &milvuspb.GetImportProgressAuthPlaceholder{
DbName: dbName,
})
if err != nil {
return nil, err
}
}
resp, err := wrapperProxy(ctx, c, req, false, false, "/milvus.proto.milvus.MilvusService/GetImportProgress", func(reqCtx context.Context, req any) (interface{}, error) {
return h.proxy.GetImportProgress(reqCtx, req.(*internalpb.GetImportProgressRequest))
})
Expand Down

0 comments on commit b61df23

Please sign in to comment.