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

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

Closed
JammingBen opened this issue Mar 12, 2024 · 5 comments · Fixed by #8668
Closed

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

JammingBen opened this issue Mar 12, 2024 · 5 comments · Fixed by #8668
Assignees
Labels

Comments

@JammingBen
Copy link
Contributor

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.

@2403905
Copy link
Contributor

2403905 commented Mar 14, 2024

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

@2403905
Copy link
Contributor

2403905 commented Mar 14, 2024

@JammingBen Could you give me the request example?

@JammingBen
Copy link
Contributor Author

@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.

@2403905
Copy link
Contributor

2403905 commented Mar 14, 2024

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

@JammingBen
Copy link
Contributor Author

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 'acc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kCxaI-h7BzoVE3ZPE5VJ_acXiubnYHITQLmTGlrB66COtA5s0t9ONmVWQHNnzGmBsqxv7XSzityf53UROxzInTQYUq8JPmDVrwiRqcTIOPSNjkUNoqeMj5V2xUaZWxwC_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
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants