Skip to content

Implemented file name shortening#129

Draft
d2dyno1 wants to merge 4 commits into
f_vault4from
f_shortening
Draft

Implemented file name shortening#129
d2dyno1 wants to merge 4 commits into
f_vault4from
f_shortening

Conversation

@d2dyno1
Copy link
Copy Markdown
Member

@d2dyno1 d2dyno1 commented May 21, 2026

Tasklist

  • [Recycle Bin] Write sidecar files when recovering from the Recycle Bin
  • [Other] Implement shortening for NativePathHelpers
  • [Other] Detect correct shortening threshold when restoring vaults.
  • [FS] Implement shortening in Dokany
  • [FS] Implement shortening in WinFsp
  • [FS] Implement shortening in FUSE
  • [Health] Detect and delete orphan sidecar files
  • [Health] Re-adjust fixing broken names to use sidecars when applicable

@d2dyno1 d2dyno1 changed the base branch from master to f_vault4 May 21, 2026 15:18
@d2dyno1 d2dyno1 mentioned this pull request May 21, 2026
8 tasks
Copy link
Copy Markdown

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 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 ShorteningThreshold to vault/VFS option models and surface it in the vault creation wizard and vault properties view.
  • Implement shortened ciphertext names using deterministic hashes plus .sffsn and 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 ShorteningThreshold in 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 thread src/Core/SecureFolderFS.Core/VaultAccess/VaultParser.cs
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
Comment thread src/Platforms/SecureFolderFS.UI/ServiceImplementation/RecycleBinService.cs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants