Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Compatibility with upcoming Reva #369

Closed
MahdiBaghbani opened this issue Jun 13, 2023 · 3 comments
Closed

Compatibility with upcoming Reva #369

MahdiBaghbani opened this issue Jun 13, 2023 · 3 comments
Assignees

Comments

@MahdiBaghbani
Copy link
Member

MahdiBaghbani commented Jun 13, 2023

Changed in this Reva PR:
cs3org/reva#3958

Affected endpoint:

2023-06-13 16:18:18.905 DBG ../../workspace/dev-stock/reva/internal/http/services/sciencemesh/sciencemesh.go:129 > sciencemesh routing path=/find-accepted-users pid=115 pkg=rhttp traceid=3b97ec369fa405844a09f36009007f6a

in 1.24.0 tag:

curl output:'[{"id":{"idp":"revanc1.docker","opaque_id":"einstein","type":1},"display_name":"einstein"}]\n' info: array (\n  'url' => 'https://revaoc2.docker/sciencemesh/find-accepted-users',\n  'content_type' => 'text/plain; charset=utf-8',\n  'http_code' => 200,\n  'header_size' => 717,\n  'request_size' => 157,\n  'filetime' => -1,\n  'ssl_verify_result' => 0,\n  'redirect_count' => 0,\n  'total_time' => 0.118776,\n  'namelookup_time' => 0.000521,\n  'connect_time' => 0.000665,\n  'pretransfer_time' => 0.059745,\n  'size_upload' => 0.0,\n  'size_download' => 92.0,\n  'speed_download' => 774.0,\n  'speed_upload' => 0.0,\n  'download_content_length' => 92.0,\n  'upload_content_length' => 0.0,\n  'starttransfer_time' => 0.118741,\n  'redirect_time' => 0.0,\n  'redirect_url' => '',\n  'primary_ip' => '172.18.0.10',\n  'certinfo' => \n  array (\n  ),\n  'primary_port' => 443,\n  'local_ip' => '172.18.0.12',\n  'local_port' => 40988,\n  'http_version' => 3,\n  'protocol' => 2,\n  'ssl_verifyresult' => 0,\n  'scheme' => 'HTTPS',\n  'appconnect_time_us' => 59675,\n  'connect_time_us' => 665,\n  'namelookup_time_us' => 521,\n  'pretransfer_time_us' => 59745,\n  'redirect_time_us' => 0,\n  'starttransfer_time_us' => 118741,\n  'total_time_us' => 118776,\n)

in sciencemesh-testing branch:

curl output:'[{"display_name":"Giuseppe Lo Presti","idp":"sm1.cernbox.cern.ch","user_id":"lopresti","mail":"giuseppe.lopresti@cern.ch"}]\n' info: array (\n  'url' => 'https://mesh.pondersource.com/sciencemesh/find-accepted-users',\n  'content_type' => 'text/plain; charset=utf-8',\n  'http_code' => 200,\n  'header_size' => 745,\n  'request_size' => 168,\n  'filetime' => -1,\n  'ssl_verify_result' => 0,\n  'redirect_count' => 0,\n  'total_time' => 0.23095,\n  'namelookup_time' => 0.003698,\n  'connect_time' => 0.006228,\n  'pretransfer_time' => 0.023394,\n  'size_upload' => 0.0,\n  'size_download' => 124.0,\n  'speed_download' => 539.0,\n  'speed_upload' => 0.0,\n  'download_content_length' => 124.0,\n  'upload_content_length' => -1.0,\n  'starttransfer_time' => 0.23087,\n  'redirect_time' => 0.0,\n  'redirect_url' => '',\n  'primary_ip' => '138.68.152.232',\n  'certinfo' => \n  array (\n  ),\n  'primary_port' => 443,\n  'local_ip' => '172.18.0.3',\n  'local_port' => 52548,\n  'http_version' => 3,\n  'protocol' => 2,\n  'ssl_verifyresult' => 0,\n  'scheme' => 'HTTPS',\n  'appconnect_time_us' => 23202,\n  'connect_time_us' => 6228,\n  'namelookup_time_us' => 3698,\n  'pretransfer_time_us' => 23394,\n  'redirect_time_us' => 0,\n  'starttransfer_time_us' => 230870,\n  'total_time_us' => 230950,\n)

[{"id":{"idp":"revanc1.docker","opaque_id":"einstein","type":1},"display_name":"einstein"}]
vs
[{"display_name":"Giuseppe Lo Presti","idp":"sm1.cernbox.cern.ch","user_id":"lopresti","mail":"giuseppe.lopresti@cern.ch"}]

Things that do not work anymore:

  1. Sciencemesh contacts list
    Screenshot from 2023-06-13 17-46-17
    because of the changed Reva response, we can no longer map keys to values!
curl output:'[{"display_name":"Giuseppe Lo Presti","idp":"sm1.cernbox.cern.ch","user_id":"lopresti","mail":"giuseppe.lopresti@cern.ch"}]\n' info: array (\n  'url' => 'https://mesh.pondersource.com/sciencemesh/find-accepted-users',\n  'content_type' => 'text/plain; charset=utf-8',\n  'http_code' => 200,\n  'header_size' => 745,\n  'request_size' => 168,\n  'filetime' => -1,\n  'ssl_verify_result' => 0,\n  'redirect_count' => 0,\n  'total_time' => 0.23095,\n  'namelookup_time' => 0.003698,\n  'connect_time' => 0.006228,\n  'pretransfer_time' => 0.023394,\n  'size_upload' => 0.0,\n  'size_download' => 124.0,\n  'speed_download' => 539.0,\n  'speed_upload' => 0.0,\n  'download_content_length' => 124.0,\n  'upload_content_length' => -1.0,\n  'starttransfer_time' => 0.23087,\n  'redirect_time' => 0.0,\n  'redirect_url' => '',\n  'primary_ip' => '138.68.152.232',\n  'certinfo' => \n  array (\n  ),\n  'primary_port' => 443,\n  'local_ip' => '172.18.0.3',\n  'local_port' => 52548,\n  'http_version' => 3,\n  'protocol' => 2,\n  'ssl_verifyresult' => 0,\n  'scheme' => 'HTTPS',\n  'appconnect_time_us' => 23202,\n  'connect_time_us' => 6228,\n  'namelookup_time_us' => 3698,\n  'pretransfer_time_us' => 23394,\n  'redirect_time_us' => 0,\n  'starttransfer_time_us' => 230870,\n  'total_time_us' => 230950,\n)
users '[{"display_name":"Giuseppe Lo Presti","idp":"sm1.cernbox.cern.ch","user_id":"lopresti","mail":"giuseppe.lopresti@cern.ch"}]\n'

and our PHP code cannot fill the required structure.

192.248.171.117:47126] returning result from sciencemesh:
[Tue Jun 13 14:51:05.724667 2023] [php7:notice] [pid 105] [client 192.248.171.117:47126] array (\n  0 => \n  array (\n    'label' => 'Giuseppe Lo Presti ()',\n    'value' => \n    array (\n      'shareType' => 6,\n      'shareWith' => '@ (Sciencemesh)',\n    ),\n  ),\n)
  1. Share Search Box
    Screenshot from 2023-06-13 18-21-53
    most probably relate to 1.

  2. Invite link generation
    Screenshot from 2023-06-13 17-58-53
    as you see it has double https://sciencemesh.cesnet.cz/iop/meshdir/. so we don't need to append it in the PHP code anymore!

Before:

curl output:'{"token":"16ed2b6b-6f87-4588-8ccd-9e2b035b09c2","expiration":1686760757,"invite_link":"?token=16ed2b6b-6f87-4588-8ccd-9e2b035b09c2\\\\u0026providerDomain=revanc1.docker"}\n' info: array (\n  'url' => 'https://revanc1.docker/sciencemesh/generate-invite?recipient=',\n  'content_type' => 'text/plain; charset=utf-8',\n  'http_code' => 200,\n  'header_size' => 726,\n  'request_size' => 168,\n  'filetime' => -1,\n  'ssl_verify_result' => 0,\n  'redirect_count' => 0,\n  'total_time' => 0.257093,\n  'namelookup_time' => 0.000531,\n  'connect_time' => 0.00072,\n  'pretransfer_time' => 0.07396,\n  'size_upload' => 0.0,\n  'size_download' => 168.0,\n  'speed_download' => 653.0,\n  'speed_upload' => 0.0,\n  'download_content_length' => 168.0,\n  'upload_content_length' => 0.0,\n  'starttransfer_time' => 0.256978,\n  'redirect_time' => 0.0,\n  'redirect_url' => '',\n  'primary_ip' => '172.18.0.7',\n  'certinfo' => \n  array (\n  ),\n  'primary_port' => 443,\n  'local_ip' => '172.18.0.9',\n  'local_port' => 34366,\n  'http_version' => 3,\n  'protocol' => 2,\n  'ssl_verifyresult' => 0,\n  'scheme' => 'HTTPS',\n  'appconnect_time_us' => 73818,\n  'connect_time_us' => 720,\n  'namelookup_time_us' => 531,\n  'pretransfer_time_us' => 73960,\n  'redirect_time_us' => 0,\n  'starttransfer_time_us' => 256978,\n  'total_time_us' => 257093,\n  'effective_method' => 'GET',\n)

Now:

Got token from reva!{"token":"ea40d7c5-f2f0-459c-a5ca-122a05b228c6","expiration":1686752811,"invite_link":"https://sciencemesh.cesnet.cz/iop/meshdir?token=ea40d7c5-f2f0-459c-a5ca-122a05b228c6\\u0026providerDomain=mesh.pondersource.org"}\n

@michielbdejong michielbdejong changed the title Compatibility with upcomming Reva Compatibility with upcoming Reva Jun 14, 2023
@michielbdejong
Copy link
Member

@glpatcern is it true that the REST API exposed by reva's sciencemesh package has changed? how is that possible?

@glpatcern
Copy link

glpatcern commented Jun 14, 2023

It has changed following the introduction of /sciencemesh/delete-accepted-user, which was still missing, and to make things clean in cs3org/reva#3958 the response of /sciencemesh/find-accepted-users has been adapted to the same structure as the delete action.

But I disagree with @MahdiBaghbani's comment:

because of the changed Reva response, we can no longer map keys to values!

The information provided in the response is exactly the same, with one less level of nesting. Therefore you should be able to use the keys as before.

For the invite link, I still have to double check our frontend but I'd consider it a bug that the frontend or any other client must prepend whatever the backend gives back with https://sciencemesh.cesnet.cz/iop/meshdir, to be configured somewhere. This is instead now configured in reva directly, following cs3org/reva#3905.

As a general comment, the /sciencemesh endpoint is Reva-specific, not OCM, and it is subject to change until we get a fully stable and complete product. We're getting there...

@glpatcern
Copy link

Edit: the invite_link response from reva did not change, it was a full URL and it still is a full URL. I believe the change you observe is due to a configuration change, still related to cs3org/reva#3905.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants