Uh oh!
There was an error while loading. Please reload this page.
test: expand Jwt test suite to production-level coverage - #40
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. |
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>
1e0a2cf to
ea6aaf7ComparePowerShell 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>
ea6aaf7 to
d779868Compare3e3d5ca
into
feat/13-implement-jwt-moduleUh oh!
There was an error while loading. Please reload this page.
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