< Summary - Kestrun — Combined Coverage

Information
Class: Public.JWT.Add-KrJWTHeader
Assembly: Kestrun.PowerShell.Public
File(s): /home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/JWT/Add-KrJWTHeader.ps1
Tag: Kestrun/Kestrun@9d3a582b2d63930269564a7591aa77ef297cadeb
Line coverage
0%
Covered lines: 0
Uncovered lines: 1
Coverable lines: 1
Total lines: 40
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

File(s)

/home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/JWT/Add-KrJWTHeader.ps1

#LineLine coverage
 1<#
 2    .SYNOPSIS
 3        Adds a header to the JWT token builder.
 4    .DESCRIPTION
 5        This function adds a header to the JWT token builder, allowing for the specification of additional header fields
 6    .PARAMETER Builder
 7        The JWT token builder to modify.
 8    .PARAMETER Name
 9        The name of the header to add.
 10    .PARAMETER Value
 11        The value of the header to add.
 12    .OUTPUTS
 13        [Kestrun.Jwt.JwtTokenBuilder]
 14        The modified JWT token builder.
 15    .EXAMPLE
 16        $builder = New-KrJWTTokenBuilder | Add-KrJWTHeader -Name "customHeader" -Value "headerValue"
 17        This example creates a new JWT token builder and adds a custom header to it.
 18    .NOTES
 19        This function is part of the Kestrun.Jwt module and is used to build JWT tokens.
 20        Maps to JwtTokenBuilder.AddHeader
 21    .LINK
 22        https://docs.microsoft.com/en-us/dotnet/api/system.identitymodel.tokens.jwt.jwtsecuritytoken
 23#>
 24function Add-KrJWTHeader {
 25    [KestrunRuntimeApi('Everywhere')]
 26    [CmdletBinding()]
 27    [OutputType([Kestrun.Jwt.JwtTokenBuilder])]
 28    param(
 29        [Parameter(Mandatory = $true, ValueFromPipeline)]
 30        [Kestrun.Jwt.JwtTokenBuilder] $Builder,
 31        [Parameter(Mandatory)]
 32        [string] $Name,
 33        [Parameter(Mandatory)]
 34        [object] $Value
 35    )
 36    process {
 037        return $Builder.AddHeader($Name, $Value)
 38    }
 39}
 40

Methods/Properties

Add-KrJWTHeader()