Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌟 [Major]: Introducing classes and removing base64 encoding #66

Merged
merged 7 commits into from
Dec 8, 2024

Conversation

MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Dec 8, 2024

Description

This pull request introduces several new classes, removes redundant functions, and refactors existing code to improve the management of contexts and their settings. The most significant changes include the addition of the Context and ContextInfo classes, the removal of Base64-related functions, and updates to the handling of context information.

Removal of Base64 encoding

Base64 encoding of names has been removed from the module for now. We want to make it more flexible for module developers, so this can be decided on the implementation of Context in your modules. However take into consideration that Secret names (from the Microsoft.PowerShell.SecretManagement module) cannot have some special characters, like [] for now.

  • Removed Base64-related functions: ConvertFrom-Base64, ConvertTo-Base64, and Test-Base64 from the src/functions/private/Base64 directory. [1] [2] [3]

New Classes:

Remove ContextSetting functions:

  • Removing the ContextSetting functions so that the implementer can create their own implementation. We want to push using Get-Context to get the object loaded to memory from disk, modify the object in memory (allows to modify one or more settings) and then use Set-Context to write the context object back to disk when all is done. Mantra: Work with objects.
  • Removed context setting functions: Get-ContextSetting, Remove-ContextSetting, and Set-ContextSetting from the src/functions/public/ContextSetting directory. [1] [2] [3]

Refactoring:

  • Made Get-ContextInfo function public src/functions/public/Get-ContextInfo.ps1.
  • Drive consistency on how to identify a Context, which are now identified by their ID throughout the functions.

Configuration Updates:

Mistake in versioning

Before this PR there was two commits to main that created version 4.0.4 and 4.0.5 which was a mistake. Both of these were breaking changes, so they have been reverted and instead gathered into one major updated, covered in this PR.

Type of change

  • 📖 [Docs]
  • 🪲 [Fix]
  • 🩹 [Patch]
  • ⚠️ [Security fix]
  • 🚀 [Feature]
  • 🌟 [Breaking change]

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@MariusStorhaug MariusStorhaug added the Major Breaking changes that are are not backwards compatible label Dec 8, 2024
@MariusStorhaug MariusStorhaug self-assigned this Dec 8, 2024
@MariusStorhaug MariusStorhaug changed the title Classes 🌟 [Major]: Introducing classes and removing base64 encoding Dec 8, 2024
@MariusStorhaug MariusStorhaug marked this pull request as ready for review December 8, 2024 11:30
@MariusStorhaug MariusStorhaug merged commit 026e9e9 into main Dec 8, 2024
21 checks passed
@MariusStorhaug MariusStorhaug deleted the classes branch December 8, 2024 11:34
Copy link

github-actions bot commented Dec 8, 2024

Module [Context - 5.0.0] published to the PowerShell Gallery.

Copy link

github-actions bot commented Dec 8, 2024

GitHub release for Context v5.0.0 has been created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Major Breaking changes that are are not backwards compatible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant