test: expand Jwt test suite to production-level coverage - #40
Merged
Marius Storhaug (MariusStorhaug) merged 3 commits intoAug 3, 2026
Merged
Conversation
No Significant Changes DetectedThis PR does not contain changes to files that would trigger a new release:
Build, test, and publish stages will be skipped for this PR. If you believe this is incorrect, please verify that your changes are in the correct locations. |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
No Significant Changes DetectedThis PR does not contain changes to files that would trigger a new release:
Build, test, and publish stages will be skipped for this PR. If you believe this is incorrect, please verify that your changes are in the correct locations. |
Marius Storhaug (MariusStorhaug)
changed the base branch from
main
to
feat/13-implement-jwt-module
August 3, 2026 01:16
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Updates the reusable workflow pin from v6.1.13 to v6.1.15 and keeps the explicit TestData mapping required by the reusable workflow's secrets interface. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Marius Storhaug (MariusStorhaug)
force-pushed
the
vigilant-guide
branch
2 times, most recently
from
August 3, 2026 01:31
1e0a2cf to
ea6aaf7
Compare
PowerShell functions unwrap [byte[]] to [object[]] when returned through an untyped variable, causing Resolve-JwtKey to reject generated HMAC keys with 'Algorithm HS256 does not accept a key of type [System.Object[]]'. Return the byte array with the unary comma operator so the type is preserved and New-Jwt -Algorithm HS256 -GenerateKey works correctly. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Expands Integration.Jwt.Tests.ps1 with a new 'Production-level edge cases' context covering: - Test-Jwt -Detailed reports failed signature and claim checks. - New-Jwt -GenerateKey produces valid tokens for HS256, RS256, and ES256. - ConvertFrom-Jwt accepts a SecureString token. - Test-Jwt returns false for an empty signature segment on signed algs. - New-Jwt parameter validation rejects non-hashtable payloads. - Test-Jwt parameter validation rejects null tokens. - Verbose output does not leak payload secrets or key material. The new HS256 -GenerateKey test exposed the byte[]-to-object[] regression fixed in the preceding commit. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Marius Storhaug (MariusStorhaug)
force-pushed
the
vigilant-guide
branch
from
August 3, 2026 01:32
ea6aaf7 to
d779868
Compare
Marius Storhaug (MariusStorhaug)
marked this pull request as ready for review
August 3, 2026 01:47
Marius Storhaug (MariusStorhaug)
merged commit Aug 3, 2026
3e3d5ca
into
feat/13-implement-jwt-module
35 checks passed
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.
Summary
Targets
feat/13-implement-jwt-moduleand adds production-level edge-case coverage to the JWT v2 integration suite. While adding tests, it also fixes a regression whereNew-JwtSigningKey -Algorithm HS*returned[object[]]instead of[byte[]], breakingNew-Jwt -GenerateKeyfor HMAC algorithms.What changed
Tests (
tests/Integration.Jwt.Tests.ps1)Added a new
Production-level edge casescontext covering:Test-Jwt -Detailedreports failed signature and failed claim checks.New-Jwt -GenerateKeyproduces valid tokens for HS256, RS256, and ES256.ConvertFrom-Jwtaccepts aSecureStringtoken.Test-Jwtreturns$falsefor an empty signature segment on signed algorithms.New-Jwtparameter validation rejects non-hashtable payloads.Test-Jwtparameter validation rejects$nulltokens.Bug fix (
src/functions/public/Keys/New-JwtSigningKey.ps1)PowerShell unwraps
[byte[]]to[object[]]when returned through an untyped variable. The HS* branch now returns,$bytesso the byte-array type is preserved, allowingNew-Jwt -Algorithm HS256 -GenerateKeyto sign and verify correctly.CI
Bumped the reusable workflow pin to Process-PSModule v6.1.15 while preserving the explicit
TestDatamapping required by the reusable workflow's secrets interface.Verification
Result: 123 passed, 0 failed (1 skipped: optional Azure Key Vault test).
Related
Contributes to #26 (JWT v2 overhaul).
Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com