Workshop#54
Closed
YassinLokhat wants to merge 23 commits into
Closed
Conversation
52 use sha512 for hash
Introduce minimal MVVM helpers (no external dependency) that will be reused by ViewModels in the upcoming refactor: - ObservableObject: base INotifyPropertyChanged with SetProperty helpers. - RelayCommand: synchronous ICommand bound to CommandManager.RequerySuggested. - AsyncRelayCommand: re-entrancy-safe async ICommand. Co-authored-by: Cursor <cursoragent@cursor.com>
…lers Logging is built on System.Diagnostics.TraceSource only, with daily log files written under %LocalAppData%/Passkey/logs. App.OnStartup now subscribes to DispatcherUnhandledException, AppDomain.UnhandledException and TaskScheduler.UnobservedTaskException so failures stop being silently swallowed. Co-authored-by: Cursor <cursoragent@cursor.com>
- MainWindow: guard against missing/invalid command-line argument and log database open failures instead of silently swallowing them. - MainWindow: protect Dispatcher.Invoke against dispatcher shutdown. - HotKeyHelper: track HwndSourceHook per registration and remove it on Unregister to prevent leaks; migrate Send from the legacy keybd_event to SendInput. - UserServicesViewModel: make the title DispatcherTimer disposable and stop it when the view closes. - AccountView/ServiceView/UserServicesView: remove duplicated GetIsBusy guards in activities handlers. Co-authored-by: Cursor <cursoragent@cursor.com>
DarkMode previously allocated a fresh SolidColorBrush on every getter, forcing WPF to re-render. Brushes are now static readonly fields built once and frozen, and are also exposed in DarkTheme.xaml so future XAML can bind to them with {StaticResource}.
Co-authored-by: Cursor <cursoragent@cursor.com>
- DarkTheme.xaml now styles Window, Grid, Border, Separator, GroupBox, ToolTip, ContextMenu, TextBlock and ProgressBar so background gaps no longer fall back to the OS light theme. - New semantic brushes (Info, Success, Warning, Danger, DisabledForeground) are defined once in DarkTheme.xaml and mirrored as frozen SolidColorBrush in Themes/SemanticBrushes.cs. - UserServicesView.xaml, UserServicesView code-behind and AccountViewModel now reference these semantic brushes instead of hard-coded Brushes.Yellow/Red/White. Co-authored-by: Cursor <cursoragent@cursor.com>
Add three new abstractions under GUI/WPF/Services along with a tiny service locator (AppServices) that wires up their singletons. Nothing consumes them yet; subsequent commits will migrate MainViewModel and the views to these services to remove the existing statics. - ISessionService tracks the active IDatabase/IUser and raises SessionChanged. - INavigationService exposes a typed ItemRequested event to replace the static GoToItem delegate. - IDialogService wraps ShowDialog/Show/Close/MessageBox/OpenFileDialog/SaveFileDialog and re-uses a singleton tracking dictionary. Co-authored-by: Cursor <cursoragent@cursor.com>
MainViewModel previously exposed static Database/User/CryptographyCenter/SerializationCenter/PasswordFactory/ClipboardManager fields and held references to every secondary Window. This commit routes every consumer through the new AppServices facade:
- Database/User accesses go through AppServices.Session.
- CryptographyCenter/SerializationCenter/PasswordFactory/ClipboardManager singletons live on AppServices.
- AppTitle moves to a dedicated Helper/AppInfo helper.
- The static GoToItem delegate becomes AppServices.Navigation.ItemRequested.
- Secondary windows (UserActivitiesView, AccountPasswordsWarningView, DuplicatedPasswordsWarningView) are now opened and tracked via IDialogService.ShowSingleton/Close instead of static fields, and DispatcherUnhandledException-prone try/Invoke/catch{} patterns become Dispatcher.HasShutdownStarted guards.
Co-authored-by: Cursor <cursoragent@cursor.com>
- MainViewModel now exposes OpenDatabaseCommand, NewUserCommand and GeneratePasswordCommand, all built on the new RelayCommand and routed through IDialogService. - MainWindow.xaml binds Ctrl+O / Ctrl+N / Ctrl+P and the matching menu items to these commands, removing the previous CommandBindings/Click handlers. - MainWindow.xaml.cs splits the credential KeyUp handler into _submitUsername and _submitPassword and forwards MessageBox.Show calls through AppServices.Dialogs. - PasswordGenerator constructor becomes internal so IDialogService.ShowDialog can build it from MainViewModel. Co-authored-by: Cursor <cursoragent@cursor.com>
- UserServicesViewModel now inherits ObservableObject and coalesces ServiceFilter/IdentifierFilter/TextFilter/ChangedItemsOnly mutations through a 250ms DispatcherTimer before rebuilding the ServiceViewModel tree, so each keystroke no longer triggers a full refresh. - ClearFilters becomes a public method exposed as ClearFiltersCommand and bound from the XAML Clear button (replacing the Stop RoutedCommand on the button itself). - ListBoxes in UserServicesView, ServiceView, AccountView (identifiers and password history) and DuplicatedPasswordsWarningView now enable VirtualizingStackPanel recycling plus deferred scrolling for noticeably better scroll perf on large databases. Co-authored-by: Cursor <cursoragent@cursor.com>
- PasswordGeneratorViewModel exposes RegenerateCommand, CopyCommand and InsertCommand (raising InsertRequested); InsertVisibility binds the menu item visibility instead of being toggled from code-behind. - AccountPasswordsWarningViewModel and UserActivitiesViewModel expose a ClearFiltersCommand bound from their respective XAML cross buttons. - The matching Click handlers are removed from the views. Co-authored-by: Cursor <cursoragent@cursor.com>
- New SensitiveClipboard helper writes a DataObject with the documented ExcludeClipboardContentFromMonitoring, CanIncludeInClipboardHistory and CanUploadToCloudClipboard flags so Windows 10/11 keeps the payload out of Win+V and Cloud Clipboard. - A DispatcherTimer scheduled per write clears the clipboard after the user's CleaningClipboardTimeout (only when the tracked content is still present, so the user pasting elsewhere is preserved). - QrCodeView.CopyToClipboard now goes through SensitiveClipboard, and SessionService.EndSession proactively clears any still-owned secret on logout. Co-authored-by: Cursor <cursoragent@cursor.com>
…reeBSTR MainWindow no longer materialises _password_PB.Password (which would leak a managed string copy that lives until GC). The PasswordBox.SecurePassword is now bridged through SecureStringExtensions.UseAsString, which marshals the SecureString to an unmanaged BSTR, hands a short-lived managed string to Database.Login, then zero-frees the BSTR with Marshal.ZeroFreeBSTR. PasswordBox.Clear() replaces the previous Password = string.Empty assignments so the underlying SecureString buffer is wiped explicitly. Co-authored-by: Cursor <cursoragent@cursor.com>
All three projects opt in to <AnalysisLevel>latest-all</AnalysisLevel>. A new root .editorconfig pragmatically maps the analyser rules that would require sweeping rewrites (culture-sensitive string APIs, visible-field design, multidimensional array layout, exception base class choice, etc.) to 'suggestion' so they remain visible in the IDE while TreatWarningsAsErrors continues to enforce correctness rules. CA5350/CA5351/CA5394/CA5401 are explicitly noted as follow-ups because changing the algorithms would invalidate every existing on-disk database. One genuine correctness issue surfaced by the new analysers is fixed: HotKeyHelper now compares the wParam IntPtr against the cached IntPtr representation of the hotkey id instead of an int cast that could silently overflow on .NET 7+ (CA2020). Co-authored-by: Cursor <cursoragent@cursor.com>
# Conflicts: # .gitignore # Core/Models/Account.cs # Core/Models/Activity.cs # Core/Models/AutoSave.cs # Core/Models/Change.cs # Core/Models/Database.cs # Core/Models/Service.cs # Core/Models/User.cs # Core/Models/Warning.cs # Core/Upsilon.Apps.Passkey.Core.csproj # Core/Utils/ActivityCenter.cs # Core/Utils/CryptographyCenter.cs # Core/Utils/FileLocker.cs # Core/Utils/ImportExportHelper.cs # Core/Utils/JsonSerializationCenter.cs # Core/Utils/PasswordFactory.cs # Core/Utils/QrCode.cs # Core/Utils/StaticMethods.cs # GUI/WPF/App.xaml # GUI/WPF/App.xaml.cs # GUI/WPF/AssemblyInfo.cs # GUI/WPF/Helper/EnumHelper.cs # GUI/WPF/Helper/HotKeyHelper.cs # GUI/WPF/Helper/IItemHelper.cs # GUI/WPF/Helper/NumericTextBoxHelper.cs # GUI/WPF/Helper/PropertyHelper.cs # GUI/WPF/Helper/WindowHelper.cs # GUI/WPF/MainWindow.xaml # GUI/WPF/MainWindow.xaml.cs # GUI/WPF/OSSpecific/ClipboardManager.cs # GUI/WPF/Properties/PublishProfiles/FolderProfile.pubxml # GUI/WPF/Properties/launchSettings.json # GUI/WPF/Themes/DarkMode.cs # GUI/WPF/Themes/DarkTheme.xaml # GUI/WPF/Upsilon.Apps.Passkey.GUI.WPF.csproj # GUI/WPF/ViewModels/AccountPasswordsWarningViewModel.cs # GUI/WPF/ViewModels/Controls/AccountPasswordWarningViewModel.cs # GUI/WPF/ViewModels/Controls/AccountViewModel.cs # GUI/WPF/ViewModels/Controls/ActivityViewModel.cs # GUI/WPF/ViewModels/Controls/DuplicatedPasswordWarningViewModel.cs # GUI/WPF/ViewModels/Controls/IdentifiantViewModel.cs # GUI/WPF/ViewModels/Controls/PasswordViewModel.cs # GUI/WPF/ViewModels/Controls/ServiceViewModel.cs # GUI/WPF/ViewModels/Controls/UserPasswordItemViewModel.cs # GUI/WPF/ViewModels/Controls/VisiblePasswordBoxViewModel.cs # GUI/WPF/ViewModels/DuplicatedPasswordsWarningViewModel.cs # GUI/WPF/ViewModels/InsertIdentifierViewModel.cs # GUI/WPF/ViewModels/MainViewModel.cs # GUI/WPF/ViewModels/PasswordGeneratorViewModel.cs # GUI/WPF/ViewModels/UserActivitiesViewModel.cs # GUI/WPF/ViewModels/UserServicesViewModel.cs # GUI/WPF/ViewModels/UserSettingsViewModel.cs # GUI/WPF/Views/AccountPasswordsWarningView.xaml # GUI/WPF/Views/AccountPasswordsWarningView.xaml.cs # GUI/WPF/Views/Controls/AccountView.xaml # GUI/WPF/Views/Controls/AccountView.xaml.cs # GUI/WPF/Views/Controls/ServiceView.xaml # GUI/WPF/Views/Controls/ServiceView.xaml.cs # GUI/WPF/Views/Controls/UserPasswordItem.xaml # GUI/WPF/Views/Controls/UserPasswordItem.xaml.cs # GUI/WPF/Views/Controls/UserPasswordsContainer.xaml # GUI/WPF/Views/Controls/UserPasswordsContainer.xaml.cs # GUI/WPF/Views/Controls/VisiblePasswordBox.xaml # GUI/WPF/Views/Controls/VisiblePasswordBox.xaml.cs # GUI/WPF/Views/DuplicatedPasswordsWarningView.xaml # GUI/WPF/Views/DuplicatedPasswordsWarningView.xaml.cs # GUI/WPF/Views/InsertIdentifierView.xaml # GUI/WPF/Views/InsertIdentifierView.xaml.cs # GUI/WPF/Views/PasswordGeneratorView.xaml # GUI/WPF/Views/PasswordGeneratorView.xaml.cs # GUI/WPF/Views/QrCodeView.xaml # GUI/WPF/Views/QrCodeView.xaml.cs # GUI/WPF/Views/UserActivitiesView.xaml # GUI/WPF/Views/UserActivitiesView.xaml.cs # GUI/WPF/Views/UserServicesView.xaml # GUI/WPF/Views/UserServicesView.xaml.cs # GUI/WPF/Views/UserSettingsView.xaml # GUI/WPF/Views/UserSettingsView.xaml.cs # Interfaces/Enums/AccountOption.cs # Interfaces/Enums/ActivityEventType.cs # Interfaces/Enums/AutoSaveMergeBehavior.cs # Interfaces/Enums/WarningType.cs # Interfaces/Events/AutoSaveDetectedEventArgs.cs # Interfaces/Events/LogoutEventArgs.cs # Interfaces/Events/WarningsUpdatedEventArgs.cs # Interfaces/Models/IAccount.cs # Interfaces/Models/IActivity.cs # Interfaces/Models/IDatabase.cs # Interfaces/Models/IItem.cs # Interfaces/Models/IService.cs # Interfaces/Models/IUser.cs # Interfaces/Models/IWarning.cs # Interfaces/Upsilon.Apps.Passkey.Interfaces.csproj # Interfaces/Utils/Exceptions.cs # Interfaces/Utils/IClipboardManager.cs # Interfaces/Utils/ICryptographyCenter.cs # Interfaces/Utils/IPasswordFactory.cs # Interfaces/Utils/ISerializationCenter.cs # Interfaces/Utils/StaticMethods.cs # Upsilon.Apps.Passkey.Windows.slnx
52 use sha512 for hash
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.
No description provided.