Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

owncloudsql: fix path, naming and listing spaces #4808

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

butonic
Copy link
Contributor

@butonic butonic commented Aug 13, 2024

@dragotin owncloudsql has bitrotted. uploads are still broken, even with this PR. oCIS seems to equire the storage driver to implement listing upload sessions and using the event handler to integrate with postprocessing.

This PR is just the basic fixes to get listing spaces and basic file navigation working again.

why do I still do this? I think being able to switch from oc10 / nc to ocis effortless is a worthwile thing. It would be great if clients could deal with multiple 'personal' spaces, then we could just deploy an owncloudsql storage alongside decomposedfs and then users could migrate at will.

For that a readonly owncloudsql might make sense ... hm ... we could list the owncloudsql spaces as projects ... that only the one user has access to ... 🤔

it any case pls give me a +1 so I can start working on the upload sessions ...

@butonic butonic requested review from a team, labkode and glpatcern as code owners August 13, 2024 17:37
Copy link

update-docs bot commented Aug 13, 2024

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@butonic butonic added the bug Something isn't working label Aug 13, 2024
@butonic butonic force-pushed the fix-owncloudsql branch 2 times, most recently from 4844350 to 1bfaac8 Compare August 13, 2024 17:44
Copy link
Contributor

@dragotin dragotin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't look harmful ;-)

@@ -130,9 +132,15 @@ func (s *Selector[T]) Next(opts ...Option) (T, error) {

existingClient, ok := s.clientMap.Load(target)
if ok {
if options.logger != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not allow nil loggers. The logger field should default to a noop logger.

return existingClient.(T), nil
}

if options.logger != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Expect logger is not nil

)

// ListStorageSpaces lists storage spaces according to the provided filters
func (fs *owncloudsqlfs) ListStorageSpaces(ctx context.Context, filter []*provider.ListStorageSpacesRequest_Filter, unrestricted bool) ([]*provider.StorageSpace, error) {
var (
spaceID = "*"
// uid *userpb.UserId
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not yet. we need to implement the user filter in a subsequent pr. this PR just makes listing spaces and navigating files work again. I'm trying to make things work gradually...

@@ -49,7 +51,7 @@ func (fs *owncloudsqlfs) ListStorageSpaces(ctx context.Context, filter []*provid
case provider.ListStorageSpacesRequest_Filter_TYPE_ID:
_, spaceID, _, _ = storagespace.SplitID(filter[i].GetId().OpaqueId)
case provider.ListStorageSpacesRequest_Filter_TYPE_USER:
_, spaceID, _, _ = storagespace.SplitID(filter[i].GetId().OpaqueId)
// uid = filter[i].GetUser()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one also

Comment on lines +68 to +70
// if uid != nil && utils.UserIDEqual(uid, u.Id) {
// return nil, errtypes.PermissionDenied("cannot access space of other user?")
// }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this

@butonic butonic merged commit 80a9ca5 into cs3org:edge Aug 14, 2024
9 of 10 checks passed
@butonic butonic deleted the fix-owncloudsql branch August 14, 2024 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants