Skip to content

Commit d465604

Browse files
committed
PR Feedback
1 parent 9df6eae commit d465604

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/AuthenticationTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using Microsoft.IdentityModel.Tokens;
1414
using System;
1515
using System.Collections.Generic;
16+
using System.Globalization;
1617
using System.IdentityModel.Tokens.Jwt;
1718
using System.Net;
1819
using System.Net.Http;
@@ -824,7 +825,7 @@ private static JwtPayload GetJwtPayload(string audience, string subject, string
824825
if (expiration.HasValue)
825826
{
826827
long expirationSecondsSinceEpoch = EpochTime.GetIntDate(expiration.Value);
827-
Claim expClaim = new Claim(AuthConstants.ClaimExpirationStr, expirationSecondsSinceEpoch.ToString());
828+
Claim expClaim = new Claim(AuthConstants.ClaimExpirationStr, expirationSecondsSinceEpoch.ToString(CultureInfo.InvariantCulture));
828829
claims.Add(expClaim);
829830
}
830831

src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/Options/OptionsExtensions.ApiKey.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Microsoft.Diagnostics.Tools.Monitor;
77
using Microsoft.IdentityModel.Tokens;
88
using System;
9+
using System.Globalization;
910
using System.IdentityModel.Tokens.Jwt;
1011
using System.Security.Claims;
1112

@@ -21,7 +22,7 @@ public static RootOptions UseApiKey(this RootOptions options, string algorithmNa
2122
string subjectStr = subject.ToString("D");
2223
Claim audClaim = new Claim(AuthConstants.ClaimAudienceStr, AuthConstants.ApiKeyJwtAudience);
2324
long expirationSecondsSinceEpoch = EpochTime.GetIntDate(DateTime.UtcNow + AuthConstants.ApiKeyJwtDefaultExpiration);
24-
Claim expClaim = new Claim(AuthConstants.ClaimExpirationStr, expirationSecondsSinceEpoch.ToString());
25+
Claim expClaim = new Claim(AuthConstants.ClaimExpirationStr, expirationSecondsSinceEpoch.ToString(CultureInfo.InvariantCulture));
2526
Claim issClaim = new Claim(AuthConstants.ClaimIssuerStr, AuthConstants.ApiKeyJwtInternalIssuer);
2627
Claim subClaim = new Claim(AuthConstants.ClaimSubjectStr, subjectStr);
2728
JwtPayload newPayload = new JwtPayload(new Claim[] { audClaim, expClaim, issClaim, subClaim });

src/Tools/dotnet-monitor/Strings.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Tools/dotnet-monitor/Strings.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@
946946
<value>The expiration offset must be a positive time span value.</value>
947947
</data>
948948
<data name="HelpDescription_Expiration" xml:space="preserve">
949-
<value>The expiration time on or after the generated key will no longer be accepted. This is a time span offset (e.g. "1:00:00" for one-hour) that will be added to the current date time to create the expiration date time.</value>
949+
<value>The expiration time on or after the generated key will no longer be accepted. This is a time span offset (e.g. "7.00:00:00" for 7 days) that will be added to the current date time to create the expiration date time.</value>
950950
<comment>Gets the string to display in help that explains what the '--expiration' option does.</comment>
951951
</data>
952952
</root>

0 commit comments

Comments
 (0)