Skip to content

Enable credential complementation - #124

Merged
d2dyno1 merged 22 commits into
f_vault4from
f_complementation
May 19, 2026
Merged

Enable credential complementation#124
d2dyno1 merged 22 commits into
f_vault4from
f_complementation

Conversation

@d2dyno1

Copy link
Copy Markdown
Member

No description provided.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds support for “credential complementation” (unlocking a vault using an alternative credential such as a key file/biometric) by persisting and consuming a complementation shares file, and updates UI + tests to exercise the new flow.

Changes:

  • Introduces a new vault complementation shares artifact (sfcomplement.sfsconfig) and cryptographic wrap/unwrap logic for complemented unlock.
  • Adds a new ModifyComplementationAsync path (routine + SDK service surface) and updates unlock logic to support alternative credentials.
  • Updates login/credentials UI to surface alternative login options and adds NUnit coverage for complementation scenarios.

Reviewed changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 5 comments.

Show a summary per file
FileDescription
tests/SecureFolderFS.Tests/VaultTests/CredentialTests.csAdds tests for add/replace/remove complementation and primary-change scenarios.
tests/SecureFolderFS.Tests/CliTests/CommandDiscoveryTests.csUpdates CliFx namespace usage for command discovery.
tests/SecureFolderFS.Tests/CliTests/CliTestHost.csUpdates CliFx app builder usage and command registration style.
src/Shared/SecureFolderFS.Shared/Models/ComplementationCredentials.csAdds model for passing current/new primary/new complement credentials into complementation routine.
src/Sdk/SecureFolderFS.Sdk/ViewModels/Views/Credentials/CredentialsSelectionViewModel.csChanges UI flagging for whether complementation is available based on selected auth VM capability.
src/Sdk/SecureFolderFS.Sdk/ViewModels/Views/Credentials/CredentialsConfirmationViewModel.csRoutes certain credential changes through the new complementation routine and builds complementation credentials.
src/Sdk/SecureFolderFS.Sdk/ViewModels/Controls/LoginViewModel.csAdds “alternative login” UI mode and selection handling for complemented vaults.
src/Sdk/SecureFolderFS.Sdk/Services/IVaultManagerService.csAdds ModifyComplementationAsync to the SDK service interface.
src/Platforms/SecureFolderFS.Uno/Views/Vault/VaultLoginPage.xamlWires new alternative-login bindings into Uno login options.
src/Platforms/SecureFolderFS.Uno/UserControls/LoginOptions.xaml.csAdds dependency properties + handler for authentication option selection.
src/Platforms/SecureFolderFS.Uno/UserControls/LoginOptions.xamlAdds ComboBox UI for selecting among alternative authentication options.
src/Platforms/SecureFolderFS.Uno/UserControls/InterfaceRoot/VaultPreviewRootControl.xamlWires alternative-login bindings in preview root login options.
src/Platforms/SecureFolderFS.Uno/Platforms/Windows/ServiceImplementation/WindowsVaultCredentialsService.csEnumerates login methods including complementation.
src/Platforms/SecureFolderFS.Uno/Platforms/MacCatalyst/ServiceImplementation/MacOsVaultCredentialsService.csEnumerates login methods including complementation.
src/Platforms/SecureFolderFS.Uno/Platforms/Desktop/ServiceImplementation/SkiaVaultCredentialsService.csEnumerates login methods including complementation.
src/Platforms/SecureFolderFS.Uno/Dialogs/CredentialsDialog.xamlAdjusts complementation checkbox presentation in credentials dialog.
src/Platforms/SecureFolderFS.UI/ViewModels/Authentication/KeyFileViewModel.csEnables key file authentication to be used as a complement.
src/Platforms/SecureFolderFS.UI/ServiceImplementation/VaultManagerService.csImplements ModifyComplementationAsync by invoking the new core routine.
src/Platforms/SecureFolderFS.UI/ServiceImplementation/BaseVaultCredentialsService.csAdds shared helper to enumerate methods + complementation for login view model creation.
src/Platforms/SecureFolderFS.Maui/Platforms/iOS/ServiceImplementation/IOSVaultCredentialsService.csEnumerates login methods including complementation.
src/Platforms/SecureFolderFS.Maui/Platforms/Android/ServiceImplementation/AndroidVaultCredentialsService.csEnumerates login methods including complementation.
src/Core/SecureFolderFS.Core/VaultAccess/VaultWriter.csAdds writer for the new complementation shares file.
src/Core/SecureFolderFS.Core/VaultAccess/VaultReader.csAdds reader for the new complementation shares file.
src/Core/SecureFolderFS.Core/VaultAccess/VaultParser.csAdds HKDF derivation + AES-GCM wrap/unwrap helpers for complementation secrets.
src/Core/SecureFolderFS.Core/Routines/Operational/VaultRoutines.csExposes new ModifyComplementation() routine entrypoint.
src/Core/SecureFolderFS.Core/Routines/Operational/UnlockRoutine.csAdds complemented unlock path using derived/unwrap complement secret.
src/Core/SecureFolderFS.Core/Routines/Operational/ModifyComplementationRoutine.csAdds routine to add/replace/remove complementation and update keystore/config/shares.
src/Core/SecureFolderFS.Core/DataModels/VaultSharesDataModel.csAdds data model for persisted complementation shares.
src/Core/SecureFolderFS.Core/Constants.csAdds filename constant for the complementation shares file.

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

Comment threadtests/SecureFolderFS.Tests/VaultTests/CredentialTests.cs
Comment threadsrc/Core/SecureFolderFS.Core/Routines/Operational/UnlockRoutine.cs Outdated
Comment threadsrc/Core/SecureFolderFS.Core/VaultAccess/VaultWriter.cs
@d2dyno1d2dyno1 mentioned this pull request May 1, 2026
8 tasks
…r explicit separation of primary/complement keys
Agent-Logs-Url: https://github.com/securefolderfs-community/SecureFolderFS/sessions/14c473bd-90b2-45f9-97c1-c6b0c6e075b2
Co-authored-by: d2dyno1 <53011783+d2dyno1@users.noreply.github.com>

CopilotAI commented May 2, 2026

Copy link
Copy Markdown

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • crl.godaddy.com
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/SecureFolderFS/SecureFolderFS/src/Platforms/SecureFolderFS.Uno/SecureFolderFS.Uno.csproj --packages /tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
  • ocsp.godaddy.com
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/SecureFolderFS/SecureFolderFS/src/Platforms/SecureFolderFS.Uno/SecureFolderFS.Uno.csproj --packages /tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

CopilotAI reviewed May 2, 2026

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 34 out of 34 changed files in this pull request and generated 8 comments.


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

Comment threadsrc/Platforms/SecureFolderFS.Maui/Views/Vault/LoginPage.xaml Outdated
Comment threadsrc/Platforms/SecureFolderFS.Maui/Views/Vault/LoginPage.xaml Outdated
Comment threadsrc/Platforms/SecureFolderFS.Maui/Popups/CredentialsPopup.xaml Outdated
Comment threadsrc/Sdk/SecureFolderFS.Sdk/ViewModels/Controls/LoginViewModel.cs Outdated

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 38 out of 38 changed files in this pull request and generated 5 comments.

@d2dyno1

Copy link
Copy Markdown
MemberAuthor

CI?

@d2dyno1

Copy link
Copy Markdown
MemberAuthor

@copilot resolve the merge conflicts in this pull request. Aggressively merge changes from branch f_complementation. The original logic from upstream f_vault4 should remain untouched. Halt making changes if unsure.

Co-authored-by: d2dyno1 <53011783+d2dyno1@users.noreply.github.com>

CopilotAI commented May 18, 2026

Copy link
Copy Markdown

CI?

The latest CI runs on the branch are passing (commits bd63012, 25078f8, a598681, 5f1949b all show success). The in-progress run on 05dd60a was also green. The merge commit 16152bd has now been pushed and CI should trigger on it.

@copilot resolve the merge conflicts in this pull request. Aggressively merge changes from branch f_complementation. The original logic from upstream f_vault4 should remain untouched. Halt making ...

Resolved in commit 16152bd. There were 2 conflicts:

  1. LoginOptions.xaml — kept f_complementation's version (has the full ComboBox + inner StackPanel structure; f_vault4's two checkboxes are already present inside the inner StackPanel).
  2. LoginViewModel.cs — kept f_complementation's refactored InitializeLoginAsync() call; the CanRestoreVault additions from f_vault4 that landed outside the conflict region were already auto-merged cleanly.

All other files merged automatically without conflict.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • crl.godaddy.com
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/SecureFolderFS/SecureFolderFS/src/Platforms/SecureFolderFS.Uno/SecureFolderFS.Uno.csproj --packages /tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true conf�� derFS.Uno/ViewModels/YubiKey/YubiKeyCreationViewModel.cs pull.rebase es (dns block)
  • ocsp.godaddy.com
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/SecureFolderFS/SecureFolderFS/src/Platforms/SecureFolderFS.Uno/SecureFolderFS.Uno.csproj --packages /tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true conf�� derFS.Uno/ViewModels/YubiKey/YubiKeyCreationViewModel.cs pull.rebase es (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@d2dyno1
d2dyno1 marked this pull request as ready for review May 18, 2026 21:13
@d2dyno1
d2dyno1 requested a review from CopilotMay 18, 2026 21:13

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 38 out of 38 changed files in this pull request and generated 3 comments.

Comment threadsrc/Core/SecureFolderFS.Core/VaultAccess/VaultReader.cs

CopilotAI commented May 18, 2026

Copy link
Copy Markdown

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • crl.godaddy.com
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/SecureFolderFS/SecureFolderFS/src/Platforms/SecureFolderFS.Uno/SecureFolderFS.Uno.csproj --packages /tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)
  • ocsp.godaddy.com
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/SecureFolderFS/SecureFolderFS/src/Platforms/SecureFolderFS.Uno/SecureFolderFS.Uno.csproj --packages /tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@d2dyno1

Copy link
Copy Markdown
MemberAuthor

@copilot, some of your recent changes have caused the CI to fail. Please readjust your changes.

CopilotAI commented May 19, 2026

Copy link
Copy Markdown

@copilot, some of your recent changes have caused the CI to fail. Please readjust your changes.

Resolved in 2cebcbf. The CI failure was caused by ReadComplementationAsync throwing on missing sfcomplement files; it now returns null only for FileNotFoundException and still propagates other read/parse errors so complementation tests pass.

@d2dyno1d2dyno1 added the approved The pull request has been reviewed and approved label May 19, 2026
@d2dyno1
d2dyno1 merged commit 0c21e4f into f_vault4May 19, 2026
@d2dyno1
d2dyno1 deleted the f_complementation branch May 27, 2026 19:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedThe pull request has been reviewed and approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@d2dyno1