< Summary - Kestrun — Combined Coverage

Information
Class: Public.JWT.Limit-KrJWTValidity
Assembly: Kestrun.PowerShell.Public
File(s): /home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/JWT/Limit-KrJWTValidity.ps1
Tag: Kestrun/Kestrun@9d3a582b2d63930269564a7591aa77ef297cadeb
Line coverage
0%
Covered lines: 0
Uncovered lines: 1
Coverable lines: 1
Total lines: 37
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/Limit-KrJWTValidity.ps1

#LineLine coverage
 1
 2<#
 3    .SYNOPSIS
 4        Sets the validity period for the JWT token.
 5    .DESCRIPTION
 6        This function sets the validity period for the JWT token, specifying how long the token will be valid.
 7    .PARAMETER Builder
 8        The JWT token builder to modify.
 9    .PARAMETER Lifetime
 10        The duration for which the JWT token will be valid.
 11    .OUTPUTS
 12        [Kestrun.Jwt.JwtTokenBuilder]
 13        The modified JWT token builder.
 14    .EXAMPLE
 15        $builder = New-KrJWTTokenBuilder | Limit-KrJWTValidity -Lifetime (New-TimeSpan -Hours 1)
 16        This example creates a new JWT token builder and sets its validity period to 1 hour.
 17    .NOTES
 18        This function is part of the Kestrun.Jwt module and is used to build JWT tokens
 19        Maps to JwtTokenBuilder.ValidFor
 20    .LINK
 21        https://docs.microsoft.com/en-us/dotnet/api/system.identitymodel.tokens.jwt.jwtsecuritytoken
 22#>
 23function Limit-KrJWTValidity {
 24    [KestrunRuntimeApi('Everywhere')]
 25    [CmdletBinding()]
 26    [OutputType([Kestrun.Jwt.JwtTokenBuilder])]
 27    param(
 28        [Parameter(Mandatory = $true, ValueFromPipeline)]
 29        [Kestrun.Jwt.JwtTokenBuilder] $Builder,
 30        [Parameter(Mandatory)]
 31        [TimeSpan] $Lifetime
 32    )
 33    process {
 034        return $Builder.ValidFor($Lifetime)
 35    }
 36}
 37

Methods/Properties

Limit-KrJWTValidity()