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

OCM. user cannot delete accepted user #11688

Closed
ScharfViktor opened this issue Jul 8, 2024 · 6 comments · Fixed by #11734
Closed

OCM. user cannot delete accepted user #11688

ScharfViktor opened this issue Jul 8, 2024 · 6 comments · Fixed by #11734
Assignees
Labels
Priority:p2-high Escalation, on top of current planning, release blocker Type:Bug Something isn't working

Comments

@ScharfViktor
Copy link
Contributor

ScharfViktor commented Jul 8, 2024

precondition:

Steps:
And "Alice" has generated invitation
And using server "REMOTE"
And "Brian" has accepted invitation
And using server "LOCAL"
When "Alice" deletes accepted user "Brian"
Then the HTTP status code should be "204"

Actual:

Screen.Recording.2024-07-08.at.11.48.05.mov

Expected:
I guess web uses wrong DELETE sciencemesh/delete-accepted-user request. should be like DELETE sciencemesh/delete-accepted-user/user-uuid but it doesn't work-> I get 404 error with log:

2024-07-08T11:30:09+02:00 WRN http end="08/Jul/2024:11:30:09 +0200" host=127.0.0.1 line=/Users/scharfviktor/Work/ocis/vendor/github.com/cs3org/reva/v2/internal/http/interceptors/log/log.go:112 method=DELETE pkg=rhttp proto=HTTP/1.1 service=ocm size=19 start="08/Jul/2024:11:30:09 +0200" status=404 time_ns=83250 traceid=6a3800c9de492e66fbb41c96775d3761 uri=/sciencemesh/delete-accepted-user/7effd1e3-7446-4d23-9311-1eb8e8f5c96a url=/delete-accepted-user/7effd1e3-7446-4d23-9311-1eb8e8f5c96a
2024-07-08T11:30:09+02:00 INF access-log bytes=19 duration=63.588667 line=/Users/scharfviktor/Work/ocis/services/proxy/pkg/middleware/accesslog.go:34 method=DELETE path=/sciencemesh/delete-accepted-user/7effd1e3-7446-4d23-9311-1eb8e8f5c96a proto=HTTP/1.1 remote-addr=127.0.0.1:58187 request-id=vscharf/QqQOxX23Rk-002517 service=proxy status=404 traceid=6fe6932c5aa6029b7fbda0b13bdc685b
2024/07/08 11:30:14 http: TLS handshake error from 127.0.0.1:60588: remote error: tls: unknown certificate
2024-07-08T11:30:14+02:00 ERR IdentifierIdentityManager: fetch failed to get user from userID error="ldap identifier backend get user error: user does not exist or too many entries returned" line=/Users/scharfviktor/Work/ocis/ocis-pkg/log/logrus_wrapper.go:50 service=idp 
@ScharfViktor ScharfViktor added the Type:Bug Something isn't working label Jul 8, 2024
@micbar
Copy link
Contributor

micbar commented Jul 9, 2024

@kulmann is that an issue of the sciencemesh app?

@butonic
Copy link
Member

butonic commented Aug 29, 2024

The web ui does not send any payload, so the server cannot identify which user to delete.

curl 'https://cloud.owncloud.test/sciencemesh/delete-accepted-user' -X DELETE -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:129.0) Gecko/20100101 Firefox/129.0' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Referer: https://cloud.owncloud.test/open-cloud-mesh/invitations' -H 'Authorization: Bearer token' -H 'X-Requested-With: XMLHttpRequest' -H 'X-Request-ID: 806d5b2e-ae8c-4b67-9d9f-c6e2629e5d02' -H 'Initiator-ID: 02757962-3275-4ab4-8c90-371beeae17b7' -H 'Origin: https://cloud.owncloud.test' -H 'Connection: keep-alive' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'Priority: u=0' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' -H 'TE: trailers'

no payload

@ScharfViktor
Copy link
Contributor Author

no payload

could you provide some example how should look request? then I can add api test for that

@ScharfViktor
Copy link
Contributor Author

ScharfViktor commented Sep 24, 2024

@rhafer and me tried to use it curl -X DELETE "https://federation-ocis-server:10200/sciencemesh/delete-accepted-user?idp=ocis-server:9200&user_id=f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c" -uadmin:admin -vk

but it doen't work. we got 200 but federated connection still exist

@ScharfViktor ScharfViktor added the Priority:p2-high Escalation, on top of current planning, release blocker label Sep 24, 2024
@rhafer rhafer self-assigned this Sep 30, 2024
@rhafer
Copy link

rhafer commented Sep 30, 2024

curl -X DELETE "https://federation-ocis-server:10200/sciencemesh/delete-accepted-user?idp=ocis-server:9200&user_id=f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c" -uadmin:admin -vk

This one just didn't work because we were using the wrong userid. The federated users userids look slightlyg diffferent since cs3org/reva@3e6ce69. Using the correct ids (those returned by sciencemesh/find-accepted-users) the delete requests works just fine.

So the remaining issue is basically a bug in web. It is sending a DELETE request with an empty body.

To delete a federated user you can either use a json BODY like this:

curl -X DELETE "https://ocis-federation.owncloud.test/sciencemesh/delete-accepted-user" \
   -uadmin:admin -vk -H "Content-Type: application/json" \ 
   --data '{"idp":"ocis.owncloud.test", "user_id":"MWRhZTRkMTctMzU5Yy00NmNhLWE2ZTUtMGIxOTQ4YmY1ZGJkQG9jaXMub3duY2xvdWQudGVzdA=="}'

Or form-urlencoded parameters as in @ScharfViktor example above.

I am transferring this issue to web, since the ocis side seems to work AFAICS.

@rhafer rhafer transferred this issue from owncloud/ocis Sep 30, 2024
@rhafer rhafer moved this from In progress to Backlog in Infinite Scale Team Board Sep 30, 2024
@rhafer rhafer removed their assignment Sep 30, 2024
@ScharfViktor
Copy link
Contributor Author

curl -X DELETE "https://ocis-federation.owncloud.test/sciencemesh/delete-accepted-user" \
   -uadmin:admin -vk -H "Content-Type: application/json" \ 
   --data '{"idp":"ocis.owncloud.test", "user_id":"MWRhZTRkMTctMzU5Yy00NmNhLWE2ZTUtMGIxOTQ4YmY1ZGJkQG9jaXMub3duY2xvdWQudGVzdA=="}'

can confirm that it works

one more question:
Should the federated connection be dropped when one of the users delete conection?

Case:

  • marie_server_1 generate invitation and marie_server_2 accepts invitation - result both users have federated conection and can share between
  • marie_server_1 deletes federated connection with marie_server_2

Actual: marie_server_1 cannot longer find and share to marie_server_2 - correct
but marie_server_2 find and share to marie_server_1

if marie_server_1 has share before deleting connection -> she gets server crash after deleting connection like in owncloud/ocis#10213

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:p2-high Escalation, on top of current planning, release blocker Type:Bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants