File tree Expand file tree Collapse file tree 4 files changed +12
-4
lines changed
tests/Logitar.Security.UnitTests/Claims Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
1010### Added
1111
12- - Added volumes to Docker Compose.
12+ - Volumes to Docker Compose.
13+
14+ ### Fixed
15+
16+ - ClaimHelper UTC conversion.
1317
1418## [ 1.20.0] - 2024-11-19
1519
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public static class ClaimHelper
1313 /// <returns>The created claim.</returns>
1414 public static Claim Create ( string name , DateTime moment )
1515 {
16- string value = new DateTimeOffset ( moment . ToUniversalTime ( ) ) . ToUnixTimeSeconds ( ) . ToString ( ) ;
16+ string value = new DateTimeOffset ( moment . AsUniversalTime ( ) ) . ToUnixTimeSeconds ( ) . ToString ( ) ;
1717
1818 return new Claim ( name , value , ClaimValueTypes . Integer64 ) ;
1919 }
Original file line number Diff line number Diff line change 3434 <TreatWarningsAsErrors >True</TreatWarningsAsErrors >
3535 </PropertyGroup >
3636
37+ <ItemGroup >
38+ <ProjectReference Include =" ..\Logitar\Logitar.csproj" />
39+ </ItemGroup >
40+
3741 <ItemGroup >
3842 <None Update =" LICENSE" >
3943 <Pack >True</Pack >
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ public void It_should_create_the_correct_claim_from_a_date_and_time()
1515 Assert . Equal ( value , local . Value ) ;
1616 Assert . Equal ( ClaimValueTypes . Integer64 , local . ValueType ) ;
1717
18- Claim utc = ClaimHelper . Create ( name , moment . ToUniversalTime ( ) ) ;
18+ Claim utc = ClaimHelper . Create ( name , moment . AsUniversalTime ( ) ) ;
1919 Assert . Equal ( local . Type , utc . Type ) ;
2020 Assert . Equal ( local . Value , utc . Value ) ;
2121 Assert . Equal ( local . ValueType , utc . ValueType ) ;
@@ -30,7 +30,7 @@ public void It_should_create_the_correct_claim_from_an_unspecified_kind_date_and
3030 Claim claim = ClaimHelper . Create ( Rfc7519ClaimNames . ExpirationTime , unspecified ) ;
3131 DateTime value = ClaimHelper . ExtractDateTime ( claim ) ;
3232 Assert . Equal ( DateTimeKind . Utc , value . Kind ) ;
33- Assert . Equal ( ToUnixTimeSeconds ( local ) , ToUnixTimeSeconds ( value ) ) ;
33+ Assert . Equal ( ToUnixTimeSeconds ( unspecified . AsUniversalTime ( ) ) , ToUnixTimeSeconds ( value ) ) ;
3434 }
3535
3636 [ Fact ( DisplayName = "It should extract the correct date and time from a claim." ) ]
You can’t perform that action at this time.
0 commit comments