Skip to content

[Sharing NG] Internal links shouldn't have a password #8619

Closed

Description

@JammingBen

Describe the bug

Changing the type for an existing link with a password to "internal" does not remove the password from the link.

Steps to reproduce

  1. Create a link with type "view" and add a password
  2. Change the type to "internal"

Expected behavior

The password gets removed by the server as internal links shouldn't have a password.

Actual behavior

The password stays, leading to weird behaviours when resolving such a link via the web client.

Activity

  1. self-assigned this
    on Mar 13, 2024
  2. 2403905 commented on Mar 14, 2024

    @2403905
    Contributor

    In step 2, what is the permissions value in a request?

  3. 2403905 commented on Mar 14, 2024

    @2403905
    Contributor

    @JammingBen Could you give me the request example?

  4. JammingBen commented on Mar 14, 2024

    @JammingBen
    ContributorAuthor

    @JammingBen Could you give me the request example?

    Sure, this is the payload the Web client in sending:

    {
    	"link": {
    		"@libre.graph.displayName": "Link",
    		"@libre.graph.quickLink": true,
    		"preventsDownload": false,
    		"type": "internal",
    		"webUrl": "https://host.docker.internal:9200/s/MxdXpEYSsxSlrrZ"
    	}
    }
    

    There is no permissions value, Web only changes the type from view to internal.

  5. 2403905 commented on Mar 14, 2024

    @2403905
    Contributor

    @JammingBen Will be nice if you share the full request copied as a curl command.

  6. JammingBen commented on Mar 14, 2024

    @JammingBen
    ContributorAuthor

    Here you go:

    curl $'https://host.docker.internal:9200/graph/v1beta1/drives/a124a1cf-31bf-40c0-905a-b87073c18a7a%247bcda410-b37a-476a-9d7e-f54eddd4c9c1/items/a124a1cf-31bf-40c0-905a-b87073c18a7a%247bcda410-b37a-476a-9d7e-f54eddd4c9c1\u00215df4f522-fc08-4376-854f-b2446dd4032c/permissions/TrpbJfqcxUzFgRd' \
      -X 'PATCH' \
      -H 'authority: host.docker.internal:9200' \
      -H 'accept: application/json, text/plain, */*' \
      -H 'accept-language: en' \
      -H 'authorization: Bearer eyJhbGciOiJQUzI1NiIsImtpZCI6InByaXZhdGUta2V5IiwidHlwIjoiSldUIn0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TQYUq8JPmDVrwiRqcTIOPSNjkUNoqeMj5V2xUaZWxwC_hjsQjeNtCRoOg3iQhgZYaQvNWlXYDytOR2JYQKooQQJryMWz3pg2B9nHoR67g6r4zf3v5EAnTGP5gJRZyB7y4' \
      -H 'cache-control: no-cache' \
      -H 'content-type: application/x-www-form-urlencoded' \
      -H 'origin: https://host.docker.internal:9201' \
      -H 'pragma: no-cache' \
      -H 'referer: https://host.docker.internal:9201/' \
      -H 'sec-ch-ua: "Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"' \
      -H 'sec-ch-ua-mobile: ?0' \
      -H 'sec-ch-ua-platform: "macOS"' \
      -H 'sec-fetch-dest: empty' \
      -H 'sec-fetch-mode: cors' \
      -H 'sec-fetch-site: same-site' \
      -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36' \
      -H 'x-request-id: c10d4ed3-ea5c-46dc-a8d0-9a525fec7f70' \
      -H 'x-requested-with: XMLHttpRequest' \
      --data-raw '{"link":{"@libre.graph.displayName":"Link","@libre.graph.quickLink":true,"preventsDownload":false,"type":"internal","webUrl":"https://host.docker.internal:9200/s/MxdXpEYSsxSlrrZ"}}' \
      --insecure
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions