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

Fix empty x5c header on JwtHeader #2460

Merged
merged 3 commits into from
Jan 27, 2024
Merged

Fix empty x5c header on JwtHeader #2460

merged 3 commits into from
Jan 27, 2024

Conversation

keegan-caruso
Copy link
Contributor

@keegan-caruso keegan-caruso commented Jan 26, 2024

GetStandardClaim is used for first class
properties on JwtHeader, one of these first class
properties can be an array. Refactor to accomadate this.

MultipleX5C test didn't properly exercise the
header x5c API.

Another test was added to show x5c can be
roundtripped as well as that the value is equivalent between being fetched from a JwtSecurityToken or a JsonWebToken

Fixes #2447

Keegan Caruso added 2 commits January 26, 2024 14:06
GetStandardHeader is used for first class
properties on JwtHeader, one of these first class
properties can be an array. Refactor to accomadate this.

MultipleX5C test didn't properly exercise the
header x5c API.

Another test was added to show x5c can be
roundtripped as well as that the value is equivalent
between being fetched from a JwtSecurityToken or a
JsonWebToken
@@ -80,7 +80,7 @@ public static Exception CreateJsonReaderExceptionInvalidType(ref Utf8JsonReader
LogHelper.MarkAsNonPII(reader.BytesConsumed)));
}

public static JsonElement CreateJsonElement(List<string> strings)
public static JsonElement CreateJsonElement(IList<string> strings)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IList

can we avoid the IList? #2242 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IList covers a lot of types...

JsonElement json = JsonPrimitives.CreateJsonElement(stringList);
return json.ToString();
}

// TODO - review dev
return string.Empty;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you know what this is for?

Copy link
Collaborator

@jennyf19 jennyf19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@keegan-caruso keegan-caruso merged commit 2cf55c2 into dev Jan 27, 2024
5 checks passed
@keegan-caruso keegan-caruso deleted the kecaruso/2447 branch January 27, 2024 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] x5c property is empty in JwtHeader after reading a JWT containing x5c in its header
3 participants