Implemented file name shortening#129
Draft
d2dyno1 wants to merge 4 commits into
Draft
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces filename-shortening support for encrypted on-disk names by adding a configurable threshold, persisting it in vault configuration, and integrating shortening logic into the path/name helpers and several filesystem backends. It also wires the threshold into the UI (wizard + properties) and updates vault config MAC calculation to include the new field.
Changes:
- Add
ShorteningThresholdto vault/VFS option models and surface it in the vault creation wizard and vault properties view. - Implement shortened ciphertext names using deterministic hashes plus
.sffsnand sidecar files (.sffsi) to store the full ciphertext name; update core file operations to use “discovery” vs “materialized” name encryption. - Update vault config reading/writing helpers and include
ShorteningThresholdin the V4 config MAC computation.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Shared/SecureFolderFS.Storage/VirtualFileSystem/VirtualFileSystemOptions.cs | Adds VFS-level ShorteningThreshold option and dictionary mapping. |
| src/Shared/SecureFolderFS.Shared/Models/VaultOptions.cs | Persists ShorteningThreshold in vault options model. |
| src/Sdk/SecureFolderFS.Sdk/ViewModels/Views/Wizard/CredentialsWizardViewModel.cs | Adds wizard field and clamps threshold into vault options. |
| src/Sdk/SecureFolderFS.Sdk/ViewModels/Views/Vault/VaultPropertiesViewModel.cs | Displays shortening threshold in properties when name encryption is enabled. |
| src/Platforms/SecureFolderFS.Uno/Views/VaultWizard/CredentialsWizardPage.xaml | Adds NumberBox UI for configuring shortening threshold. |
| src/Platforms/SecureFolderFS.Uno/Views/Vault/VaultPropertiesPage.xaml | Conditionally shows shortening threshold in vault properties UI. |
| src/Platforms/SecureFolderFS.UI/ServiceImplementation/VaultService.cs | Returns ShorteningThreshold from vault config in GetVaultOptionsAsync. |
| src/Platforms/SecureFolderFS.UI/ServiceImplementation/RecycleBinService.cs | Updates config write MAC path and config type usage while configuring recycle bin. |
| src/Core/SecureFolderFS.Core/VaultAccess/VaultWriter.cs | Makes WriteConfigurationAsync generic (additional config type support). |
| src/Core/SecureFolderFS.Core/VaultAccess/VaultReader.cs | Adds V4-typed convenience reads and a generic config read API. |
| src/Core/SecureFolderFS.Core/VaultAccess/VaultParser.cs | Extends V4 config MAC input with ShorteningThreshold and changes authenticated fields. |
| src/Core/SecureFolderFS.Core/Routines/Operational/UnlockRoutine.cs | Switches to new V4-typed VaultReader APIs. |
| src/Core/SecureFolderFS.Core/Routines/Operational/RestoreRoutine.cs | Attempts to infer a shortening threshold during restore and writes it to config. |
| src/Core/SecureFolderFS.Core/Routines/Operational/RecoverRoutine.cs | Switches to new V4-typed VaultReader config API. |
| src/Core/SecureFolderFS.Core/Routines/Operational/ModifyCredentialsRoutine.cs | Switches to new V4-typed VaultReader keystore API. |
| src/Core/SecureFolderFS.Core/Routines/Operational/ModifyComplementationRoutine.cs | Switches to new V4-typed VaultReader APIs for config/keystore. |
| src/Core/SecureFolderFS.Core/Models/SecurityWrapper.cs | Exposes ShorteningThreshold into the VFS options contract. |
| src/Core/SecureFolderFS.Core/DataModels/V4VaultConfigurationDataModel.cs | Adds persisted ShorteningThreshold with JSON association. |
| src/Core/SecureFolderFS.Core/Constants.cs | Adds JSON association key for filename shortening. |
| src/Core/SecureFolderFS.Core.WinFsp/AppModels/WinFspOptions.cs | Plumbs ShorteningThreshold into WinFsp options mapping. |
| src/Core/SecureFolderFS.Core.WebDav/AppModels/WebDavOptions.cs | Plumbs ShorteningThreshold into WebDav options mapping. |
| src/Core/SecureFolderFS.Core.FUSE/AppModels/FuseOptions.cs | Plumbs ShorteningThreshold into FUSE options mapping. |
| src/Core/SecureFolderFS.Core.Dokany/AppModels/DokanyOptions.cs | Plumbs ShorteningThreshold into Dokany options mapping. |
| src/Core/SecureFolderFS.Core.FileSystem/Storage/CryptoFolder.cs | Uses “discovery” vs “use” encryption paths; attempts sidecar cleanup on rename/delete/move. |
| src/Core/SecureFolderFS.Core.FileSystem/Helpers/RecycleBin/Abstract/AbstractRecycleBinHelpers.Operational.cs | Uses discovery encryption for restore name checks. |
| src/Core/SecureFolderFS.Core.FileSystem/Helpers/Paths/PathHelpers.cs | Treats .sffsi sidecars as internal/core names. |
| src/Core/SecureFolderFS.Core.FileSystem/Helpers/Paths/Abstract/AbstractPathHelpers.Shortening.cs | Introduces sidecar + shortened-name helper logic. |
| src/Core/SecureFolderFS.Core.FileSystem/Helpers/Paths/Abstract/AbstractPathHelpers.Paths.cs | Switches path traversal to discovery encryption. |
| src/Core/SecureFolderFS.Core.FileSystem/Helpers/Paths/Abstract/AbstractPathHelpers.Names.cs | Adds “EncryptNameForUse/Discovery” and resolves shortened names via sidecars during decryption. |
| src/Core/SecureFolderFS.Core.FileSystem/Constants.cs | Defines new .sffsn (shortened) and .sffsi (sidecar) extensions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+80
to
+81
| if (shorteningThreshold == 0 && item.Name.EndsWith(FileSystem.Constants.Names.SHORTENED_FILE_EXTENSION, StringComparison.OrdinalIgnoreCase)) | ||
| shorteningThreshold = 220; // Arbitrary threshold typical for shortened names |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tasklist