🌟[Major]: Introducing ContextVaults - Multi-Vault Support#90
Conversation
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
ContextVaults - Multi-Vault Support for Context PowerShell Module|
Lets add one more function. |
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Added Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Lets remove the loading logic that exists in main.ps1. The main.ps1 script is run when the module is loaded, if it exists. As there is no vault or settings to load anylonger during module import, we can safely remove the main.ps1 file and the private Set-ContextVault function. |
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Removed main.ps1 file and private Set-ContextVault function as requested. Also removed the initialization logic from all context functions (Get-Context, Set-Context, etc.) since vault initialization is no longer needed during module import. All ContextVaults tests continue to pass (13/13). Commit: 90ea688 Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
ContextVaults - Multi-Vault Support
…structure - Updated `Remove-Context.ps1` to change the search path for vaults. - Deleted obsolete functions: `Remove-ContextVault.ps1`, `Rename-ContextVault.ps1`, `Reset-ContextVault.ps1`, and `Set-ContextVault.ps1`. - Introduced new functions for vault management: `Get-ContextVault.ps1`, `Remove-ContextVault.ps1`, `Reset-ContextVault.ps1`, and `Set-ContextVault.ps1` with improved functionality. - Enhanced `Set-Context.ps1` to align with new vault structure. - Updated configuration variables in `Config.ps1` to reflect new paths and naming conventions. - Refactored tests in `ContextVaults.Tests.ps1` to accommodate changes in vault management functions and ensure proper cleanup of test vaults.
… functions; streamline object creation in Set-ContextVault function
- Update Remove-ContextVault and Reset-ContextVault to support pipeline input and wildcards. - Refactor logic for removing and resetting vaults based on parameter sets. - Introduce ContextVault class for better structure and handling. - Remove unnecessary validation in Set-ContextVault function.
…improved readability and performance
…ss confirmation prompt
…t management and error handling
…e retrieval process
…xt information processing
…etter traceability during execution
…g quotes and improve debug output formatting for clarity
…up code for clarity
…add Get-ContextVaultKeyPair, Convert-ContextHashtableToObjectRecursive, ConvertFrom-ContextJson, Convert-ContextObjectToHashtableRecursive, ConvertTo-ContextJson, and Get-PSCallStackPath functions for enhanced context management and data handling.
…r all vaults, specific vaults, and wildcard matching
…r all vaults, specific vaults, and wildcard matching; remove redundant Get-ContextInfo tests from ContextVaults.Tests
…lt removal before and after tests, and update vault creation test for clarity.
…put display and streamline Get-ContextInfo tests by removing unnecessary vault setup.
|
Module Context - 8.0.0-copilotfix772001 published to the PowerShell Gallery. |
|
GitHub release for Context v8.0.0-copilotfix772001 has been created. |
…e clarity on context storage and management, and improve organization of examples.
…istency in Context.Tests.ps1 and ContextVaults.Tests.ps1
|
Module Context - 8.0.0-copilotfix772002 published to the PowerShell Gallery. |
|
GitHub release for Context v8.0.0-copilotfix772002 has been created. |
…-ContextID and Complete-ContextVaultName for improved parameter handling
|
Module Context - 8.0.0-copilotfix772003 published to the PowerShell Gallery. |
|
GitHub release for Context v8.0.0-copilotfix772003 has been created. |
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces multi-vault support by adding the new ContextVault concept along with helper functions for vault and context management, enhanced encryption key handling, and updated documentation.
- Introduces contextual segregation of contexts into vaults with the new ContextVault class
- Adds and updates public functions (Set-Context, Get-Context, Remove-Context, Rename-Context) to support vault parameters
- Revises documentation and examples to reflect the new vault-based storage structure
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/functions/public/Vault/Remove-ContextVault.ps1 | Implements removal of vaults with iterative matching |
| src/functions/public/Vault/Get-ContextVault.ps1 | Retrieves vaults and constructs ContextVault objects |
| src/functions/public/Set-Context.ps1 | Updates context setting to include vault support and encryption |
| src/functions/public/Rename-Context.ps1 | Updates renaming with vault parameter and enhanced error messages |
| src/functions/public/Remove-Context.ps1 | Updates context removal to filter by vault |
| src/functions/public/Get-ContextInfo.ps1 | Supports vault filtering when retrieving context info |
| src/functions/public/Get-Context.ps1 | Gets contexts using vault parameter and updated decryption logic |
| src/functions/private/Get-PSCallStackPath.ps1 | Minor comment update |
| src/functions/private/Set-ContextVault.ps1 | Removed entirely |
| src/functions/private/ObjectToJson/ConvertTo-ContextJson.ps1 | Documentation comment update for JSON conversion |
| src/functions/private/ObjectToJson/Convert-ContextObjectToHashtableRecursive.ps1 | Documentation adjustment |
| src/functions/private/JsonToObject/ConvertFrom-ContextJson.ps1 | Comment update for decryption output type |
| src/functions/private/JsonToObject/Convert-ContextHashtableToObjectRecursive.ps1 | Comment update for output type |
| src/functions/private/Get-ContextVaultKeyPair.ps1 | Retrieves encryption key pair but calls a removed function |
| src/functions/private/Completers/Complete-ContextVaultName.ps1 | Provides vault name tab completion |
| src/functions/private/Completers/Complete-ContextID.ps1 | Provides context ID tab completion |
| src/formats/ContextVault.Format.ps1xml | Adds custom formatting for ContextVault objects |
| src/completers.ps1 | Removed obsolete completer registration |
| src/classes/public/ContextVault.ps1 | Defines the new ContextVault class |
| README.md | Updates documentation to demonstrate new multi-vault usage |
Comments suppressed due to low confidence (2)
src/functions/public/Set-Context.ps1:79
- The call to 'Set-ContextVault' is now broken as the function has been removed from the codebase. Update this reference to use the new vault initialization logic or reintroduce the missing function.
$vaultObject = Set-ContextVault -Name $Vault
src/functions/private/Get-ContextVaultKeyPair.ps1:35
- The reference to 'Set-ContextVault' is now broken due to its removal. Update the vault key retrieval to initialize the vault using the new mechanism or restore the missing function.
$vaultObject = Set-ContextVault -Name $Vault
|
Module Context - 8.0.0 published to the PowerShell Gallery. |
|
GitHub release for Context v8.0.0 has been created. |
This pull request introduces significant enhancements to data organization, encryption, and usability. Key changes include the addition of
ContextVaultsfor grouping contexts, new helper functions for context and vault management, and updates to documentation and code formatting. These changes aim to make the module more user-friendly and scalable for managing secure, persistent data.Enhancements to Context Management
ContextVaultsto group related contexts into logical containers. Vaults are automatically created during context storage, and contexts in different vaults are isolated.Complete-ContextIDandComplete-ContextVaultNamefor tab completion of context IDs and vault names.Encryption and Security
Get-ContextVaultKeyPairfunction to retrieve public and private keys for encrypting and decrypting contexts securely.Documentation and Developer Guidance
README.mdwith a detailed implementation guide for module developers, including best practices for integrating contexts and vaults into modules.Contextmodule in a hypothetical GitHub module, showcasing practical usage patterns.Codebase Improvements
ContextVaultclass to represent vaults with properties likeNameandPath, and added formatting definitions for better display in PowerShell.