Skip to content

Commit

Permalink
fix the storageid of shares (#2033)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Christofas authored Sep 7, 2021
1 parent 65dcdcd commit b7cc062
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-storageid-shares.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fix the storage id of shares

The storageid in the share object contained an incorrect value.

https://github.com/cs3org/reva/pull/2033
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ import (
"github.com/pkg/errors"
)

const (
storageIDPrefix string = "shared::"
)

// Handler implements the shares part of the ownCloud sharing API
type Handler struct {
gatewayAddr string
Expand Down Expand Up @@ -732,7 +736,6 @@ func (h *Handler) addFileInfo(ctx context.Context, s *conversions.ShareData, inf
}
s.MimeType = parsedMt
// TODO STime: &types.Timestamp{Seconds: info.Mtime.Seconds, Nanos: info.Mtime.Nanos},
s.StorageID = info.Id.StorageId + "!" + info.Id.OpaqueId
// TODO Storage: int
s.ItemSource = wrapResourceID(info.Id)
s.FileSource = s.ItemSource
Expand All @@ -742,6 +745,7 @@ func (h *Handler) addFileInfo(ctx context.Context, s *conversions.ShareData, inf
s.FileTarget = path.Join(h.sharePrefix, path.Base(info.Path))
}
s.Path = path.Join("/", path.Base(info.Path)) // TODO hm this might have to be relative to the users home ... depends on the webdav_namespace config
s.StorageID = storageIDPrefix + s.FileTarget
// TODO FileParent:
// item type
s.ItemType = conversions.ResourceType(info.GetType()).String()
Expand Down
1 change: 0 additions & 1 deletion tests/acceptance/expected-failures-on-OCIS-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ File and sync features in a shared scenario

#### [Response is empty when accepting a share](https://github.com/owncloud/product/issues/207)

- [apiShareManagementToShares/acceptShares.feature:82](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L82)
- [apiShareManagementToShares/acceptShares.feature:207](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L207)
- [apiShareManagementToShares/acceptShares.feature:261](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L261)

Expand Down
1 change: 0 additions & 1 deletion tests/acceptance/expected-failures-on-S3NG-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ File and sync features in a shared scenario

#### [Response is empty when accepting a share](https://github.com/owncloud/product/issues/207)

- [apiShareManagementToShares/acceptShares.feature:82](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L82)
- [apiShareManagementToShares/acceptShares.feature:207](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L207)
- [apiShareManagementToShares/acceptShares.feature:261](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/acceptShares.feature#L261)

Expand Down

0 comments on commit b7cc062

Please sign in to comment.