Repository navigation
Closed
Labels
Description
- share to same user/group - 500
log:
2023-12-13T14:30:37+01:00 DBG share creation failed line=/Users/scharfviktor/Work/ocis/services/graph/pkg/service/v0/driveitems.go:561 service=graph
2023-12-13T14:30:37+01:00 DBG bytes=180 duration=87.1695 line=/Users/scharfviktor/Work/ocis/ocis-pkg/middleware/logger.go:27 method=POST path=/graph/v1beta1/drives/d738470e-d561-48ca-aefb-f8686ebb2e52$ad6f4ad2-b863-4b1b-aadb-b63d094361e8/items/d738470e-d561-48ca-aefb-f8686ebb2e52$ad6f4ad2-b863-4b1b-aadb-b63d094361e8!864d5538-57b3-445d-9deb-b0d7e02de90d/invite proto=HTTP/1.1 request-id= service=graph status=500
2023-12-13T14:30:37+01:00 INF access-log bytes=180 duration=406.08425 line=/Users/scharfviktor/Work/ocis/services/proxy/pkg/middleware/accesslog.go:31 method=POST path=/graph/v1beta1/drives/d738470e-d561-48ca-aefb-f8686ebb2e52$ad6f4ad2-b863-4b1b-aadb-b63d094361e8/items/d738470e-d561-48ca-aefb-f8686ebb2e52$ad6f4ad2-b863-4b1b-aadb-b63d094361e8!864d5538-57b3-445d-9deb-b0d7e02de90d/invite proto=HTTP/1.1 remote-addr=[::1]:64109 request-id=VIKTORS-AIR.local/DWRfO3XfoI-000001 service=proxy status=500
- wrong or empty
libre.graph.recipient.typein the body - 500 - share to disabled user - 200. Do we need forbid it?
- share to deleted user - 500
- share to deleted group -200.
- multiple share (if one is wrong) -207 response Code
"value": [
{
"grantedToV2": {
"group": {
"displayName": "radium-lovers",
"id": "7b87fd49-286e-4a5f-bafd-c535d5dd997a"
}
},
"id": "d738470e-d561-48ca-aefb-f8686ebb2e52:ad6f4ad2-b863-4b1b-aadb-b63d094361e8:d0526643-7d58-45fd-ba6f-e07774b02fb3",
"roles": [
"1c996275-f1c9-4e71-abdf-a42f6495e960"
]
},
{
"error": {
"code": "generalException",
"innererror": {
"date": "2023-12-11T20:04:05Z",
"request-id": "VIKTORS-AIR.local/ophX0sJyIG-014711"
},
"message": "Internal Server Error"
}
}
]
СС @rhafer
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
rhafer commentedon Dec 14, 2023
Yes, I can reproduce that. So we have a bit of a problem here as we allow to create invitations with more than one receipient e.g.
If all of that succeeds we return a 200. However if one of the recipients already has a share for that resource. We return a 207 (Multistatus) with multiple values like this:
And if all of them fail, or there was just one recipiet, we return a 500 regardless of why the CreateShare failed. I guess we could at least set the error in the body to something more helpful. But setting a proper statuscode for the whole request seem difficult. We could of course do some special casing when there was just one recipient in the request and map the error of that single request to a proper status code.
Maybe we're making our lifes unnecessarily hard by allowing multiple recipients in a single request in the first place. (I think it also hard for client implementations, i.e. you can't really match with error is for which recipient).
@micbar @butonic comments? Do we really need this complexity?
I can't reproduce this one. I guess you used userid in
idthat already had a share?We just assume
useriflibre.graph.recipient.typeis set to anything else thangroup. I guess we can make that check more explicit and reject anything that is notuserorgroupGood question how does
ocsbehave currently?Yeah, same as for 1. we could set a better error in the body, but I am not sure yet what to do with the status code. (Especially in the when multiple recipients are in the request).
Really? I get a 500 here as well.
Yes 207 is
Multi-Status. And I really wonder if we should go down that path. (AFAIK 207 is not even part of the HTTP RFC)rhafer commentedon Dec 14, 2023
After discussing with @butonic and @micbar we agreed to forbid requests with multiple recipients for now and return a 400 when receiving such a request. Mainly to keep it as simple as possible.
cc @individual-it
v-scharf commentedon Dec 14, 2023
Steps:
groupIdand empty or wronglibre.graph.recipient.typeit's not possible
<status>error</status><statuscode>998</statuscode><message>user not found</message>Yes, sorry. I also gel 500
fschade commentedon Dec 19, 2023
@rhafer, @ScharfViktor,
please have a look at #8019
individual-it commentedon Dec 20, 2023
Will that be a permanent change? And how will the webUI handle sharing with multiple recipients at the same time? Send multiple requests?
micbar commentedon Dec 20, 2023
That will stay this way until we find something related to batch processing.
micbar commentedon Dec 20, 2023
Disabled users should not be able to be share receivers.
Please check that and fix if still possible.
rhafer commentedon Dec 20, 2023
I'll take a look into the share with disabled user problem. I think it's a bug in the userprovider/manager
rhafer commentedon Dec 20, 2023
Fix for the disabled user issue: cs3org/reva#4426
I guess we should also adapt the
graph/users?$searchimplementation to no return disabled users for users that lack theusermanagementpermission. (I'll look into that as well)grgprarup commentedon Jan 4, 2024
@rhafer Is the issue for sharing with a disabled user fixed? I am adding a test to cover that scenario and still we can send share invitations to disabled users.
rhafer commentedon Jan 9, 2024
@grgprarup No. Unfortunately we needed to revert the original fix. I am trying to come up with a better solution.
rhafer commentedon Jan 9, 2024
We (@micbar @butonic and I) had a discussion about this again. And somehow the assumption that one cannot share with a disabled user seems wrong. The main driver of the "disable user" feature was to temporary forbid a user to use
ocis(disallow the user to login). The admin UI for usermanagement actually also does not talk about enable/disable user, but allow/disallow login. So if you go by that definition allowing a user to create a share with a disabled user (if he knows the ID if that user) should be fine (there is no harm done). We'd prefer to keep that behavior as it is for sharing NG currently (we might need to revisit that decision in the future)@grgprarup For the tests that means sharing with a disabled user is allowed to succeed when using the new sharing API.
However, while digging into this I found some pretty inconsistent behavior in the CS3 users API (the LDAP driver specifically) with regards to the enabled/disabled state of users. (I'll open up a separate issue to discuss that).