Refactoring - #14
Merged
Merged
Refactoring#14
Conversation
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.
This pull request refactors the CLI and TUI code to consistently use the
Silicatestruct for all password manager operations, improving code organization and encapsulation. Instead of calling free functions fromsilicate_core, the CLI and TUI now create aSilicateinstance and use its methods, which simplifies dependency management and makes the codebase more modular and maintainable.Refactoring to use the
Silicatestruct for all operations:Replaced all direct calls to
silicate_corefree functions inmain.rswith corresponding methods on aSilicateinstance, including password encryption/decryption, key management, password listing, tag management, and stats retrieval. A singleSilicateinstance is now created at the start ofmain()and passed where needed. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22]Updated helper functions such as
get_keyto accept a&Silicateparameter and use its methods for key retrieval and derivation, further centralizing logic within the struct.TUI integration improvements:
Appstruct to store aSilicateinstance, and updated its constructor and usage to accept and use this instance, ensuring all TUI operations also go through the unified interface. [1] [2]Code style and minor cleanups:
Dependency and import adjustments:
Silicateand its error types directly, removing unused or redundant imports. [1] [2]Initialization consistency:
Silicateis always initialized with the configuration directory, and that all file and password operations are routed through the struct for consistency and future extensibility. [1] [2]