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

Alias Links for unified Urls #3470

Closed
exalate-issue-sync bot opened this issue Apr 6, 2022 · 1 comment
Closed

Alias Links for unified Urls #3470

exalate-issue-sync bot opened this issue Apr 6, 2022 · 1 comment

Comments

@exalate-issue-sync
Copy link

exalate-issue-sync bot commented Apr 6, 2022

Description

User Stories

  • As a user I want to create unified stable urls that link to resources to make collaboration easy

  • As a user I want to create links that can point to a resource which I can access via a share

Value

Alias Links

Create

  • User Creates Share (via Shares API) and sends the parameters to the BE
  • The BE stores the link as a public links without permissions

Implementation

Adds an endpoint to ocs service that exposes information about link tokens.
Usage:

curling the unprotected endpoint returns standard information

curl --insecure -X GET https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/tokeninfo/unprotected/jqDCLhaiyIvXZTp

<TokenInfo>
  <token>jqDCLhaiyIvXZTp</token>
  <linkurl>/s/jqDCLhaiyIvXZTp</linkurl>
  <passwordprotected>false</passwordprotected>
  <storageid>f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c</storageid>
  <opaqueid>c6378f93-0e2d-4f77-812b-a1b2b3ee04ae</opaqueid>
  <path/>
  <spacePath/>
  <spaceAlias/>
  <spaceURL/>
</TokenInfo>

curling a password protected link only returns minimal information

curl --insecure -X GET https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/tokeninfo/unprotected/jqDCLhaiyIvXZTp

<TokenInfo>
  <token>jqDCLhaiyIvXZTp</token>
  <linkurl>/s/jqDCLhaiyIvXZTp</linkurl>
  <passwordprotected>true</passwordprotected>
  <storageid/>
  <opaqueid/>
  <path/>
  <spacePath/>
  <spaceAlias/>
  <spaceURL/>
</TokenInfo>

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

curl --insecure -X GET https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/tokeninfo/protected/jqDCLhaiyIvXZTp -u marie:radioactivity

<TokenInfo>
  <token>jqDCLhaiyIvXZTp</token>
  <linkurl>/s/jqDCLhaiyIvXZTp</linkurl>
  <passwordprotected>false</passwordprotected>
  <storageid>f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c</storageid>
  <opaqueid>c6378f93-0e2d-4f77-812b-a1b2b3ee04ae</opaqueid>
  <path/>
  <spacePath>/users/f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c</spacePath>
  <spaceAlias>personal/marie</spaceAlias>
  <spaceURL>personal/marie/c6378f93-0e2d-4f77-812b-a1b2b3ee04ae</spaceURL>
</TokenInfo>

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

curl --insecure -X GET https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/tokeninfo/protected/jqDCLhaiyIvXZTp -u einstein:relativity

<TokenInfo>
  <token>jqDCLhaiyIvXZTp</token>
  <linkurl>/s/jqDCLhaiyIvXZTp</linkurl>
  <passwordprotected>false</passwordprotected>
  <storageid>f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c</storageid>
  <opaqueid>c6378f93-0e2d-4f77-812b-a1b2b3ee04ae</opaqueid>
  <path/>
  <spacePath/>
  <spaceAlias/>
  <spaceURL/>
</TokenInfo>

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/jqDCLhaiyIvXZTp

HTTP/1.1 401 Unauthorized

Acceptance Criteria

  • There is a public endpoint to resolve public urls for unauthenticated users
  • There is a private endpoint to resolve private (only shared with authenticated users) links
  • If the permissions on a resource are changed, the URL stays the same

Definition of done

  • Functional requirements
    [ ] functionality described in the user story works
    [ ] acceptance criteria are fulfilled
  • Quality
    [ ] codre review happened
    [ ] CI is green
    [ ] critical code received unit tests by the developer
    [ ] automated tests passed (if automated tests are not available, this test needs to be created and passed
  • Non-functional requirements
    [ ] no sonar cloud issues
@exalate-issue-sync
Copy link
Author

Michael Barz commented: This was done in another way. #3455

Changing Ticket top Post

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

No branches or pull requests

0 participants