Skip to content

feat: Password protected public share#1922

Merged
FabianDevel merged 22 commits intomainfrom
password-protected-public-share
Mar 13, 2026
Merged

feat: Password protected public share#1922
FabianDevel merged 22 commits intomainfrom
password-protected-public-share

Conversation

@FabianDevel
Copy link
Copy Markdown
Contributor

Add the possibility to open a password protected public share directly in the application instead of going to the browser.

@FabianDevel FabianDevel added enhancement New feature or request feature A new functionality is added to the product labels Jan 16, 2026
@FabianDevel FabianDevel force-pushed the password-protected-public-share branch from 58b1095 to 679cc1f Compare January 20, 2026 08:43
@FabianDevel FabianDevel marked this pull request as draft January 20, 2026 09:25
@FabianDevel FabianDevel force-pushed the password-protected-public-share branch from 679cc1f to 0482e15 Compare January 28, 2026 14:26
@FabianDevel FabianDevel force-pushed the password-protected-public-share branch from 0482e15 to 671e192 Compare February 5, 2026 10:41
@benjaminVadon benjaminVadon force-pushed the password-protected-public-share branch from 671e192 to f553c07 Compare February 19, 2026 12:34
@benjaminVadon benjaminVadon self-assigned this Feb 20, 2026
@benjaminVadon benjaminVadon force-pushed the password-protected-public-share branch from f9bbf83 to 589bca9 Compare February 20, 2026 06:48
@benjaminVadon benjaminVadon marked this pull request as ready for review February 20, 2026 06:48
@benjaminVadon benjaminVadon force-pushed the password-protected-public-share branch from 589bca9 to 2b01b20 Compare February 25, 2026 12:20
Comment thread app/src/main/java/com/infomaniak/drive/data/api/ApiRoutes.kt Outdated
Comment thread app/src/main/java/com/infomaniak/drive/ui/publicShare/PublicShareListFragment.kt Outdated
@FabianDevel FabianDevel force-pushed the password-protected-public-share branch from 2b01b20 to eaec8d5 Compare March 2, 2026 14:04
@tevincent tevincent added the rebase Add this label to rebase the PR label Mar 6, 2026
@github-actions github-actions Bot removed the rebase Add this label to rebase the PR label Mar 6, 2026
@github-actions github-actions Bot force-pushed the password-protected-public-share branch from eaec8d5 to a9b8f4d Compare March 6, 2026 12:46
@sirambd sirambd requested a review from Copilot March 9, 2026 09:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables opening password-protected public shares directly in the Android app by adding a password validation flow that retrieves and propagates a share-link auth token across public-share API calls and file operations.

Changes:

  • Replace the “not supported” password screen with an in-app password submission/validation flow and navigation into the public share file list.
  • Introduce a PublicShareToken response model and propagate sharelink_token through public-share API routes (listing, counts, archives, previews/downloads).
  • Attach public-share auth context (UUID + token) to File objects so downstream features (thumbnails, previews, downloads, counts) can work for protected shares.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
app/src/main/res/values/strings.xml Removes obsolete “password not supported” string.
app/src/main/res/values-it/strings.xml Same string removal + copyright year bump.
app/src/main/res/values-fr/strings.xml Same string removal + copyright year bump.
app/src/main/res/values-es/strings.xml Same string removal + copyright year bump.
app/src/main/res/values-de/strings.xml Same string removal + copyright year bump.
app/src/main/res/layout/fragment_public_share_password.xml Updates UI copy/visibility/button label for password entry & validation.
app/src/main/java/com/infomaniak/drive/utils/PreviewUtils.kt Uses safer query appending for OnlyOffice PDF downloads.
app/src/main/java/com/infomaniak/drive/ui/publicShare/PublicShareViewModel.kt Adds token-aware init/root file fetch/listing/import/archive behavior; tracks rootFileId.
app/src/main/java/com/infomaniak/drive/ui/publicShare/PublicSharePasswordFragment.kt Implements in-app password validation and navigates to list on success.
app/src/main/java/com/infomaniak/drive/ui/publicShare/PublicShareMultiSelectActionsBottomSheetDialog.kt Adds token to public-share archive download URL generation.
app/src/main/java/com/infomaniak/drive/ui/publicShare/PublicShareListFragment.kt Updates navigation and root file handling for password-protected entry flow.
app/src/main/java/com/infomaniak/drive/ui/publicShare/PublicShareActivity.kt Initializes rootFileId from navigation args.
app/src/main/java/com/infomaniak/drive/ui/fileList/FileListViewModel.kt Adds token to public-share file count requests.
app/src/main/java/com/infomaniak/drive/ui/LaunchActivity.kt Copyright year bump only.
app/src/main/java/com/infomaniak/drive/data/models/File.kt Adds publicShareAuthToken field (non-persisted/non-parceled).
app/src/main/java/com/infomaniak/drive/data/api/publicshare/PublicShareToken.kt New parcelable model for password auth response token.
app/src/main/java/com/infomaniak/drive/data/api/publicshare/PublicShareApiRepository.kt Adds token support across public-share endpoints and centralizes URL token injection.
app/src/main/java/com/infomaniak/drive/data/api/ApiRoutes.kt Adds token-aware public-share URL helpers + appendQuery utility.
app/src/main/java/com/infomaniak/drive/MatomoDrive.kt Adds ValidatePassword tracking event and removes unused OpenInBrowser.
Comments suppressed due to low confidence (1)

app/src/main/java/com/infomaniak/drive/ui/publicShare/PublicSharePasswordFragment.kt:95

  • observeSubmitPasswordResult treats any empty token as a wrong password and clears the field. With the current ViewModel behavior, an empty token also happens on network/server errors, so users will get a “wrong password” message in those cases. Consider observing a richer result (token + error) and showing an appropriate error message when the auth call fails for reasons other than an invalid password.
        publicShareViewModel.submitPasswordResult.observe(viewLifecycleOwner) { authToken ->
            if (authToken.isNotEmpty()) {
                publicShareViewModel.hasBeenAuthenticated = true
                publicShareViewModel.initPublicShare(authToken)
            } else {
                passwordValidateButton.hideProgressCatching(R.string.buttonValid)
                publicSharePasswordEditText.text = null
                publicSharePasswordLayout.error = getString(R.string.errorWrongPassword)
            }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/main/java/com/infomaniak/drive/data/api/ApiRoutes.kt
Comment thread app/src/main/java/com/infomaniak/drive/data/api/ApiRoutes.kt
Comment thread app/src/main/java/com/infomaniak/drive/ui/publicShare/PublicShareViewModel.kt Outdated
@FabianDevel FabianDevel force-pushed the password-protected-public-share branch from a9b8f4d to 72648c5 Compare March 12, 2026 15:37
@github-actions
Copy link
Copy Markdown
Contributor

The changes implement comprehensive authentication token support for password-protected public shares, replacing the temporary browser-opening workaround with proper password validation and token propagation across API routes. The introduction of the PublicShareSubmitPasswordResult sealed class improves error handling type safety, while the new appendQueryParams utility ensures proper URL encoding. The ViewModel refactoring cleanly separates root file initialization from children fetching, consolidating the download logic into a single entry point.

#ai-review-summary

Comment thread app/src/main/java/com/infomaniak/drive/ui/publicShare/PublicShareViewModel.kt Outdated
Comment thread app/src/main/java/com/infomaniak/drive/ui/publicShare/PublicShareViewModel.kt Outdated
Comment thread app/src/main/java/com/infomaniak/drive/data/api/ApiRoutes.kt
@FabianDevel FabianDevel force-pushed the password-protected-public-share branch from 72648c5 to d054932 Compare March 13, 2026 08:25
@sonarqubecloud
Copy link
Copy Markdown

@FabianDevel FabianDevel merged commit f2b91bb into main Mar 13, 2026
8 checks passed
@FabianDevel FabianDevel deleted the password-protected-public-share branch March 13, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature A new functionality is added to the product

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants