Skip to content
This repository was archived by the owner on Nov 23, 2026. It is now read-only.
This repository was archived by the owner on Nov 23, 2026. It is now read-only.

Prevent tokeninfo request #9310

Closed
Closed

Description

@tbsbdr

Issue for: 7d70c67

"Our Reva backend doesn't implement it yet"

Activity

  1. tbsbdr commented on Jun 28, 2023

    @tbsbdr
    Author

    @micbar we where wondering what the tokeninfo endpoint does - could you please tell what it does / is good for?

  2. tbsbdr commented on Jun 28, 2023

    @tbsbdr
    Author

    @d7oc asked why don't override the method so that cern would not need to implement it backendwise - would that be a possible solution @pascalwengerter @dschmidt ?

  3. JammingBen commented on Jun 29, 2023

    @JammingBen
    Contributor

    @micbar we where wondering what the tokeninfo endpoint does - could you please tell what it does / is good for?

    The endpoint gives information which is necessary for resolving a public link in certain cases:

  4. tbsbdr commented on Jun 29, 2023

    @tbsbdr
    Author

    hm okay, thx @JammingBen
    @dschmidt could you please outline what the endpoint should basically do / return in the case of cernbox? (return an empty object if none of the 3 functionalities above are used or alike? ) cc @labkode

  5. dschmidt commented on Jul 10, 2023

    @dschmidt
    Member

    In doubt {} is good for starters, I'm leaving the details of a more meaningful response to a backend person

  6. micbar commented on Jul 10, 2023

    @micbar
    Contributor

    Product Specification

    Infinite Scale Links have now 2 different scopes

    • public, with permissions, password optional
    • internal, only people who have access to the file (via a space or a share) can resolve the link

    Examples

    Usage:

    curling the unprotected endpoint returns standard information

    curl -L 'https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/tokeninfo/unprotected/LwrXbngGjuBmyrB'
    
    <?xml version="1.0" encoding="UTF-8"?>
    <ocs>
        <meta>
            <status>ok</status>
            <statuscode>100</statuscode>
            <message>OK</message>
        </meta>
        <data>
            <token>LwrXbngGjuBmyrB</token>
            <link_url>/s/LwrXbngGjuBmyrB</link_url>
            <password_protected>false</password_protected>
            <alias_link>false</alias_link>
            <id>storage-users-1$f2b65657-e440-4843-b3e4-40fbc0e4056b!362bcef5-679d-46ec-872f-4e35766c481b</id>
            <storage_id>storage-users-1</storage_id>
            <space_id>f2b65657-e440-4843-b3e4-40fbc0e4056b</space_id>
            <opaque_id>362bcef5-679d-46ec-872f-4e35766c481b</opaque_id>
            <path></path>
            <space_path></space_path>
            <space_alias></space_alias>
            <space_url></space_url>
            <space_type></space_type>
        </data>
    </ocs>

    curling a password protected link only returns minimal information

    curl -L 'https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/tokeninfo/unprotected/LwrXbngGjuBmyrB'
    
    <?xml version="1.0" encoding="UTF-8"?>
    <ocs>
        <meta>
            <status>ok</status>
            <statuscode>100</statuscode>
            <message>OK</message>
        </meta>
        <data>
            <token>LwrXbngGjuBmyrB</token>
            <link_url>/s/LwrXbngGjuBmyrB</link_url>
            <password_protected>true</password_protected>
            <alias_link>false</alias_link>
            <id></id>
            <storage_id></storage_id>
            <space_id></space_id>
            <opaque_id></opaque_id>
            <path></path>
            <space_path></space_path>
            <space_alias></space_alias>
            <space_url></space_url>
            <space_type></space_type>
        </data>
    </ocs>

    curling the protected endpoint returns full information if user has native access

    curl -L 'https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/tokeninfo/protected/LwrXbngGjuBmyrB' \
    -H 'Authorization: Basic YWRtaW46YWRtaW4=' 
    
    <?xml version="1.0" encoding="UTF-8"?>
    <ocs>
        <meta>
            <status>ok</status>
            <statuscode>100</statuscode>
            <message>OK</message>
        </meta>
        <data>
            <token>LwrXbngGjuBmyrB</token>
            <link_url>/s/LwrXbngGjuBmyrB</link_url>
            <password_protected>false</password_protected>
            <alias_link>true</alias_link>
            <id>storage-users-1$f2b65657-e440-4843-b3e4-40fbc0e4056b!362bcef5-679d-46ec-872f-4e35766c481b</id>
            <storage_id>storage-users-1</storage_id>
            <space_id>f2b65657-e440-4843-b3e4-40fbc0e4056b</space_id>
            <opaque_id>362bcef5-679d-46ec-872f-4e35766c481b</opaque_id>
            <path></path>
            <space_path>/projects/Geschichte</space_path>
            <space_alias>project/geschichte</space_alias>
            <space_url>project/geschichte/362bcef5-679d-46ec-872f-4e35766c481b</space_url>
            <space_type>project</space_type>
        </data>
    </ocs>

    curling the protected endpoint returns same information as unprotected endpoint if user does not have native access

    curl -L 'https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/tokeninfo/protected/LwrXbngGjuBmyrB' \
    -H 'Authorization: Basic ZWluc3RlaW46cmVsYXRpdml0eQ=='
    
    <?xml version="1.0" encoding="UTF-8"?>
    <ocs>
        <meta>
            <status>ok</status>
            <statuscode>100</statuscode>
            <message>OK</message>
        </meta>
        <data>
            <token>LwrXbngGjuBmyrB</token>
            <link_url>/s/LwrXbngGjuBmyrB</link_url>
            <password_protected>false</password_protected>
            <alias_link>true</alias_link>
            <id>storage-users-1$f2b65657-e440-4843-b3e4-40fbc0e4056b!362bcef5-679d-46ec-872f-4e35766c481b</id>
            <storage_id>storage-users-1</storage_id>
            <space_id>f2b65657-e440-4843-b3e4-40fbc0e4056b</space_id>
            <opaque_id>362bcef5-679d-46ec-872f-4e35766c481b</opaque_id>
            <path></path>
            <space_path></space_path>
            <space_alias></space_alias>
            <space_url></space_url>
            <space_type></space_type>
        </data>
    </ocs>

    curling the protected endpoint without authentication returns 401 Unauthorized

    curl --insecure -X GET https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/tokeninfo/protected/LwrXbngGjuBmyrB
    
    HTTP/1.1 401 Unauthorized
    
  7. micbar commented on Jul 10, 2023

    @micbar
    Contributor

    @dschmidt @tbsbdr @diocas I clarified the backend behavior.

  8. added this to the CERN Web Merge milestone on Jul 10, 2023
  9. self-assigned this
    on Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions