Skip to content

Commit

Permalink
Remove unfinished GetPath() code
Browse files Browse the repository at this point in the history
  • Loading branch information
aduffeck committed Jan 25, 2022
1 parent d2c5c81 commit d7f6703
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,24 +285,7 @@ func (s *service) GetPath(ctx context.Context, req *provider.GetPathRequest) (*p
// - getPath of every received share on the same space - needs also owner permissions -> needs machine auth
// - find the shortest root path that is a prefix of the resource path
// alternatively implement this on storageprovider - it needs to know about grants to do so

receivedShare, rpcStatus, err := s.resolveReference(ctx, &provider.Reference{ResourceId: req.ResourceId})
appctx.GetLogger(ctx).Debug().
Interface("resourceId", req.ResourceId).
Interface("received_share", receivedShare).
Msg("sharesstorageprovider: Got GetPath request")
if err != nil {
return nil, err
}
if rpcStatus != nil {
return &provider.GetPathResponse{
Status: rpcStatus,
}, nil
}

return s.gateway.GetPath(ctx, &provider.GetPathRequest{
ResourceId: receivedShare.Share.ResourceId,
})
return nil, gstatus.Errorf(codes.Unimplemented, "method not implemented")
}

func (s *service) GetHome(ctx context.Context, req *provider.GetHomeRequest) (*provider.GetHomeResponse, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,24 +298,6 @@ var _ = Describe("Sharesstorageprovider", func() {
}, nil)
})

Describe("GetPath", func() {
It("returns the path", func() {
gw.On("GetPath", mock.Anything, mock.Anything).Return(&sprovider.GetPathResponse{
Status: status.NewOK(context.Background()),
Path: "/shareddir",
}, nil)
res, err := s.GetPath(ctx, &sprovider.GetPathRequest{
ResourceId: &sprovider.ResourceId{
StorageId: utils.ShareStorageProviderID,
OpaqueId: "shareddir",
},
})
Expect(err).ToNot(HaveOccurred())
Expect(res.Status.Code).To(Equal(rpc.Code_CODE_OK))
Expect(res.Path).To(Equal("/shareddir"))
})
})

Describe("Stat", func() {
It("stats the root shares folder", func() {
res, err := s.Stat(ctx, BaseStatRequest)
Expand Down

0 comments on commit d7f6703

Please sign in to comment.