Skip to content

Guests can't download archives #3741

Closed

Description

@JammingBen

Describe the bug

Guests (authenticated via a guest link session cookie) can't download folders or multiple files as an archive. The request for the signing key, GET /ocs/v1.php/cloud/user/signing-key, fails with a 401, so Web can't build the signed archiver URL.

Steps to reproduce

  1. Share a folder with an external guest via a guest link.
  2. Redeem the guest link as the guest.
  3. Select a folder (or multiple files) and click "Download".

Expected behavior

The archive gets downloaded.

Actual behavior

GET /ocs/v1.php/cloud/user/signing-key returns 401, the download fails.

Additional context

Web signs archiver URLs client side (OC-Credential + OC-Signature). This doesn't work for guests for several reasons:

  • /ocs/v1.php/cloud/user/signing-key is not part of guestLinkPathPrefixes in services/proxy/pkg/middleware/guest_link_auth.go.
  • Even with a signing key, the signed URL can't be verified: SignedURLAuthenticator.authenticateLegacy (services/proxy/pkg/middleware/signed_url_auth.go) resolves the user via UserProvider.GetUserByClaims("username", ...). The guest is a synthetic user (opaque id = email, USER_TYPE_GUEST) that doesn't exist in the user backend, so the lookup fails.
  • /archiver is not part of guestLinkPathPrefixes either, so the guest cookie can't authenticate the archiver request directly.
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

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions