🩹 [Patch]: Add JwtTimeTolerance
, dynamically update config and Sodium
as a direct dependency
#369
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.
Description
This pull request introduces several updates to improve functionality, maintainability, and configuration flexibility in the GitHub PowerShell module. The most significant changes include adding a new function to determine the GitHub environment type, enhancing context initialization with dynamic property updates, and introducing a configurable JWT time tolerance.
New functionality
Get-GitHubEnvironmentType
function to dynamically determine the environment type (e.g., GitHub Actions, Azure Functions, or local) based on environment variables. This replaces the previous static logic.Enhancements to configuration handling
Initialize-GitHubConfig
function to dynamically add missing default properties to the stored context, ensuring compatibility with future updates.JwtTimeTolerance
property in theGitHub.DefaultConfig
object to allow configurable time tolerance for JSON Web Token (JWT) generation.Refactoring
EnvironmentType
logic inGitHub.ps1
with a call to the newGet-GitHubEnvironmentType
function for better modularity and maintainability.Improvements to JWT handling
Get-GitHubAppJSONWebToken
to use the newJwtTimeTolerance
property for both issued-at (iat
) and expiration (exp
) times, improving flexibility and time slip.Dependency management
#Requires
statement toSet-GitHubSecret
to ensure the requiredSodium
module is available, improving reliability.Type of change
Checklist