Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding intent of variables to their name #2674

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -693,15 +693,15 @@ internal static void WriteJwsPayload(
bool setDefaultTimesOnTokenCreation,
int tokenLifetimeInMinutes)
{
bool audienceChecked = false;
bool descriptorClaimsAudienceChecked = false;
bool audienceSet = false;
bool issuerChecked = false;
bool descriptorClaimsIssuerChecked = false;
bool issuerSet = false;
bool expChecked = false;
bool descriptorClaimsExpChecked = false;
bool expSet = false;
bool iatChecked = false;
bool descriptorClaimsIatChecked = false;
bool iatSet = false;
bool nbfChecked = false;
bool descriptorClaimsNbfChecked = false;
bool nbfSet = false;

writer.WriteStartObject();
Expand Down Expand Up @@ -749,9 +749,9 @@ internal static void WriteJwsPayload(
{
foreach (KeyValuePair<string, object> kvp in tokenDescriptor.Claims)
{
if (!audienceChecked && kvp.Key.Equals(JwtRegisteredClaimNames.Aud, StringComparison.Ordinal))
if (!descriptorClaimsAudienceChecked && kvp.Key.Equals(JwtRegisteredClaimNames.Aud, StringComparison.Ordinal))
{
audienceChecked = true;
descriptorClaimsAudienceChecked = true;
if (audienceSet)
{
if (LogHelper.IsEnabled(EventLogLevel.Informational))
Expand All @@ -763,9 +763,9 @@ internal static void WriteJwsPayload(
audienceSet = true;
}

if (!issuerChecked && kvp.Key.Equals(JwtRegisteredClaimNames.Iss, StringComparison.Ordinal))
if (!descriptorClaimsIssuerChecked && kvp.Key.Equals(JwtRegisteredClaimNames.Iss, StringComparison.Ordinal))
{
issuerChecked = true;
descriptorClaimsIssuerChecked = true;
if (issuerSet)
{
if (LogHelper.IsEnabled(EventLogLevel.Informational))
Expand All @@ -777,9 +777,9 @@ internal static void WriteJwsPayload(
issuerSet = true;
}

if (!expChecked && kvp.Key.Equals(JwtRegisteredClaimNames.Exp, StringComparison.Ordinal))
if (!descriptorClaimsExpChecked && kvp.Key.Equals(JwtRegisteredClaimNames.Exp, StringComparison.Ordinal))
{
expChecked = true;
descriptorClaimsExpChecked = true;
if (expSet)
{
if (LogHelper.IsEnabled(EventLogLevel.Informational))
Expand All @@ -791,9 +791,9 @@ internal static void WriteJwsPayload(
expSet = true;
}

if (!iatChecked && kvp.Key.Equals(JwtRegisteredClaimNames.Iat, StringComparison.Ordinal))
if (!descriptorClaimsIatChecked && kvp.Key.Equals(JwtRegisteredClaimNames.Iat, StringComparison.Ordinal))
{
iatChecked = true;
descriptorClaimsIatChecked = true;
if (iatSet)
{
if (LogHelper.IsEnabled(EventLogLevel.Informational))
Expand All @@ -805,9 +805,9 @@ internal static void WriteJwsPayload(
iatSet = true;
}

if (!nbfChecked && kvp.Key.Equals(JwtRegisteredClaimNames.Nbf, StringComparison.Ordinal))
if (!descriptorClaimsNbfChecked && kvp.Key.Equals(JwtRegisteredClaimNames.Nbf, StringComparison.Ordinal))
{
nbfChecked = true;
descriptorClaimsNbfChecked = true;
if (nbfSet)
{
if (LogHelper.IsEnabled(EventLogLevel.Informational))
Expand Down