From 754222952353aa0fd58d653bb897fd83daf184a0 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 6 Jul 2026 08:27:12 +0200 Subject: [PATCH 1/3] Standardize README landing page --- README.md | 59 ++++++++----------------------------------------------- 1 file changed, 8 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index e88a481..1cea617 100644 --- a/README.md +++ b/README.md @@ -1,70 +1,27 @@ # Jwt -`Jwt` is a PowerShell module for creating and verifying JSON Web Tokens. This repository maintains the current `Jwt` module command surface under PSModule maintenance so existing users can continue to install and use the package from PowerShell Gallery. +Jwt is a PowerShell module for working with JSON Web Tokens. ## Installation +Install the module from the PowerShell Gallery: + ```powershell Install-PSResource -Name Jwt Import-Module -Name Jwt ``` -## Commands - -The maintained module exports the same JWT commands and alias used by the current package: - -```powershell -ConvertFrom-Base64UrlString -ConvertTo-Base64UrlString -Get-JwtHeader -Get-JwtPayload -New-Jwt -Test-Jwt -Verify-JwtSignature -``` - -## Usage - -Create and validate an HMAC-signed JWT: - -```powershell -$header = '{"alg":"HS256","typ":"JWT"}' -$payload = '{"sub":"1234567890","name":"John Doe","admin":true,"iat":1516239022}' -$secret = 'a-string-secret-at-least-256-bits-long' - -$jwt = New-Jwt -Header $header -PayloadJson $payload -Secret $secret -Test-Jwt -jwt $jwt -Secret $secret -``` - -Read the header and payload from an existing token: +## Documentation -```powershell -Get-JwtHeader -jwt $jwt -Get-JwtPayload -jwt $jwt -``` +Documentation is published at [psmodule.io/Jwt](https://psmodule.io/Jwt/). -For more information about each command, use PowerShell help: +Use PowerShell help and command discovery for module details: ```powershell Get-Command -Module Jwt -Get-Help New-Jwt -Full +Get-Help -Examples ``` ## Contributing -Coder or not, you can contribute to the project! We welcome all contributions. - -### For Users - -If you don't code, you still sit on valuable information that can make this project even better. If you experience that the -product does unexpected things, throw errors or is missing functionality, you can help by submitting bugs and feature requests. -Please see the issues tab on this project and submit a new issue that matches your needs. - -### For Developers - -If you do code, we'd love to have your contributions. Please read the [Contribution guidelines](CONTRIBUTING.md) for more information. -You can either help by picking up an existing issue or submit a new one if you have an idea for a new feature or improvement. - -## Acknowledgements - -Here is a list of people and projects that helped this project in some way. +Issues and pull requests are welcome. Please use the repository issue tracker to report bugs, request features, or discuss improvements. From da29ae84c8a9c7a8f89677e9348e1eb6743c110f Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 12 Jul 2026 12:43:43 +0200 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=93=96=20[Docs]:=20Add=20Usage=20show?= =?UTF-8?q?case,=20fix=20help=20example,=20drop=20Contributing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1cea617..5437a84 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Jwt -Jwt is a PowerShell module for working with JSON Web Tokens. +Jwt is a PowerShell module for creating, decoding, and verifying JSON Web Tokens (JWTs). It supports HS256 +shared-secret tokens, RS256 certificate-signed tokens, and the `none` algorithm. ## Installation @@ -11,6 +12,24 @@ Install-PSResource -Name Jwt Import-Module -Name Jwt ``` +## Usage + +### Example: Create and validate an HMAC-signed token + +```powershell +$payload = '{"sub":"1234567890","name":"John Doe","admin":true,"iat":1516239022}' +$secret = 'a-string-secret-at-least-256-bits-long' + +$jwt = New-Jwt -Header '{"alg":"HS256","typ":"JWT"}' -PayloadJson $payload -Secret $secret +$jwt | Test-Jwt -Secret $secret +``` + +### Example: Decode the payload of an existing token + +```powershell +$jwt | Get-JwtPayload +``` + ## Documentation Documentation is published at [psmodule.io/Jwt](https://psmodule.io/Jwt/). @@ -19,9 +38,5 @@ Use PowerShell help and command discovery for module details: ```powershell Get-Command -Module Jwt -Get-Help -Examples +Get-Help -Name New-Jwt -Examples ``` - -## Contributing - -Issues and pull requests are welcome. Please use the repository issue tracker to report bugs, request features, or discuss improvements. From 7a769f79df222d64da0127f4508d3f3a25be35aa Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 12 Jul 2026 12:47:06 +0200 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=96=20[Docs]:=20Add=20security=20c?= =?UTF-8?q?aution=20for=20the=20none=20algorithm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 5437a84..c64055e 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,10 @@ Jwt is a PowerShell module for creating, decoding, and verifying JSON Web Tokens (JWTs). It supports HS256 shared-secret tokens, RS256 certificate-signed tokens, and the `none` algorithm. +> [!WARNING] +> The `none` algorithm produces an unsigned token whose integrity cannot be verified. Avoid it for +> authentication or authorization; use HS256 or RS256 for any token that must be trusted. + ## Installation Install the module from the PowerShell Gallery: