-
Notifications
You must be signed in to change notification settings - Fork 113
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
Sharestorageprovider oc10 sm #2023
Conversation
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. |
df77a6d
to
c0acb58
Compare
cad9c3b
to
71b35bf
Compare
Following our discussion these are the remaining tasks to implement:
We also concluded that spaces support will not be implemented as part of this PR. |
There is however a tradeoff that we made. When there are 2 shares to the same resource, one is a group share and the other a user share, the group share is excluded from the results, so there are not 2 folders to the same location, this is as we discussed. However, when listing all shares (in the sahred with me tab) we should list both received shares, as the user might want to decline them (i.e update the share state). This is currently not possible since listing the shares (by navigating to @aduffeck could you udate the todo list with a checkmark for both tasks? I for some reason am not able to do so :( //cc @butonic |
@refs I'm not really following the problem with the same endpoint being used in |
@aduffeck What I meant is when we list shares on "Shared with me": I think it would be better if we list all of the shares, group and user shares alongside, even if the mount point is the same. And I'm comparing it to this view: navigating to The issue comes that these 2 different pages use the same endpoint, and there are currently no filters in the CS3APIS to capture this behavior. What I want is to use the same endpoint and fetch different results depending on where the request was made. Maybe I'm missing an essential part elsewhere 🤷 |
Status: status.NewStatusFromErrType(ctx, "stat ref: "+req.Ref.String(), err), | ||
}, nil | ||
} | ||
_, _ = io.WriteString(etagHash, childStatRes.Info.Etag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to check childStatRes.Status.Code != OK or something
mysql hates us ;-) |
536219a
to
8c5266d
Compare
d080fdd
to
2581441
Compare
This pull request introduces 1 alert when merging 18cdc37 into 937db22 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 52cabec into 937db22 - view on LGTM.com new alerts:
|
52cabec
to
9e0a31c
Compare
This pull request introduces 1 alert when merging 1329eb9 into 9be4c4f - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 3b51cd5 into 9be4c4f - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 92c6605 into fe35bd1 - view on LGTM.com new alerts:
|
92c6605
to
4f0949d
Compare
This pull request introduces 1 alert when merging 4f0949d into ab1db2a - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging a5ca0f3 into ab1db2a - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging df6021e into ab1db2a - view on LGTM.com new alerts:
|
90c5b4d
to
a00d562
Compare
The #2215 (comment) created a really ugly merge conflict: the |
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
if protocol == "webdav" { | ||
// TODO(ishank011): pass this through the datagateway service | ||
// For now, we just expose the file server to the user | ||
ep, opaque, err := s.webdavRefTransferEndpoint(ctx, statRes.Info.Target) | ||
if err != nil { | ||
return &gateway.InitiateFileDownloadResponse{ | ||
Status: status.NewInternal(ctx, err, "gateway: error downloading from webdav host: "+p), | ||
}, nil | ||
} | ||
return &gateway.InitiateFileDownloadResponse{ | ||
Status: status.NewOK(ctx), | ||
Protocols: []*gateway.FileDownloadProtocol{ | ||
{ | ||
Opaque: opaque, | ||
Protocol: "simple", | ||
DownloadEndpoint: ep, | ||
}, | ||
}, | ||
}, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ishank011 there are several places in the gateway that have special "webdav" handling ... what for? AFAICT it is related to OCM. Unfortunately, there are no tests covering that right now. Well the oc10 core testsuite does cover federated sharing, but the drone ci does not set up a second instance ...
While there are ways forward to cover OCM let's start with what these webdav handling is meant to do? Could you enlighten us?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@butonic yep, the OCM share targets are saved as webdav://$token@$idp?name=$path
. When OCM shares are accepted, the references have these targets instead of cs3
for other shares.
When checkRef
is called and it detects that the reference is of type 'webdav', the requests are then forwarded to the methods in the webdavstorageprovider.go
file, and they actually make the webdav calls to the idp of the share creator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
phew ... do you have an example setup with two reva instances that I can use to set up a test environment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ishank ... um $path
? so the references will break when the path changes? Why are we not using ids? Is OCM necessary for your current deployment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the share storage provider will return a cs3 reference which resolves to a yet to be implemented OCM storage provider. That can encapsulate the token and idp data necessary to access the remote instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am currently looking at the /examples/ocmd
setup. AFAICT it is deployed next to an existing reva deployment ... is it only starts the ocmd service on the http port ... so normal webdav is not available without an additional reva deployment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started a PR to clean up the toml configs and add an ocm config set in #2239
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
} | ||
} | ||
return res, nil | ||
return c.UpdateReceivedShare(ctx, req) | ||
} | ||
|
||
func (s *svc) removeReference(ctx context.Context, resourceID *provider.ResourceId) *rpc.Status { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also remove this method?
@@ -96,6 +98,7 @@ func (h *DavHandler) Handler(s *svc) http.Handler { | |||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |||
ctx := r.Context() | |||
log := appctx.GetLogger(ctx) | |||
log.Info().Str("request", fmt.Sprintf("%#v", r)).Msg("Got webdav request") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the log?
for j := range rss { | ||
if rss[i].Share.ResourceId.GetOpaqueId() == rss[j].Share.ResourceId.GetOpaqueId() { | ||
if rss[i].Share.GetGrantee().GetType() == provider.GranteeType_GRANTEE_TYPE_GROUP && rss[j].Share.GetGrantee().GetType() == provider.GranteeType_GRANTEE_TYPE_USER { | ||
if rss[i].State == rss[j].State { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this. If the permissions differ for the shares, shouldn't be return both?
requestUserID, _ := router.ShiftPath(requestPath) | ||
u = &userpb.User{ | ||
Username: requestUserID, | ||
var requestUsernameOrID string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a couple of comments in the ldap refactor PR #2133. Can you take a look at those?
merged in edge as part of #2234 |
continuation of #1846 and #1584