-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced JsonDocument.Parse with Utf8JsonReader Standardized roundtrip serialization
- Loading branch information
Brent Schmaltz
committed
Aug 17, 2023
1 parent
7348960
commit f5a7cb7
Showing
51 changed files
with
4,236 additions
and
1,470 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
434 changes: 236 additions & 198 deletions
434
src/Microsoft.IdentityModel.JsonWebTokens/Json/JsonClaimSet.cs
Large diffs are not rendered by default.
Oops, something went wrong.
19 changes: 12 additions & 7 deletions
19
src/Microsoft.IdentityModel.JsonWebTokens/JsonClaimValueTypes.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,34 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System.Security.Claims; | ||
|
||
namespace Microsoft.IdentityModel.JsonWebTokens | ||
{ | ||
/// <summary> | ||
/// Constants for Json Web tokens. | ||
/// Constants that indicate how the <see cref="Claim.Value"/> should be evaluated. | ||
/// </summary> | ||
public static class JsonClaimValueTypes | ||
{ | ||
/// <summary> | ||
/// A URI that represents the JSON XML data type. | ||
/// A value that indicates the <see cref="Claim.Value"/> is a Json object. | ||
/// </summary> | ||
/// <remarks>When mapping json to .Net Claim(s), if the value was not a string (or an enumeration of strings), the ClaimValue will serialized using the current JSON serializer, a property will be added with the .Net type and the ClaimTypeValue will be set to 'JsonClaimValueType'.</remarks> | ||
/// <remarks>When creating a <see cref="Claim"/> from Json to if the value was not a simple type {String, Null, True, False, Number} | ||
/// then <see cref="Claim.Value"/> will contain the Json value. If the Json was a JsonObject, the <see cref="Claim.ValueType"/> will be set to "JSON".</remarks> | ||
public const string Json = "JSON"; | ||
|
||
/// <summary> | ||
/// A URI that represents the JSON array XML data type. | ||
/// A value that indicates the <see cref="Claim.Value"/> is a Json object. | ||
/// </summary> | ||
/// <remarks>When mapping json to .Net Claim(s), if the value was not a string (or an enumeration of strings), the ClaimValue will serialized using the current JSON serializer, a property will be added with the .Net type and the ClaimTypeValue will be set to 'JsonClaimValueType'.</remarks> | ||
/// <remarks>When creating a <see cref="Claim"/> from Json to if the value was not a simple type {String, Null, True, False, Number} | ||
/// then <see cref="Claim.Value"/> will contain the Json value. If the Json was a JsonArray, the <see cref="Claim.ValueType"/> will be set to "JSON_ARRAY".</remarks> | ||
public const string JsonArray = "JSON_ARRAY"; | ||
|
||
/// <summary> | ||
/// A URI that represents the JSON null data type | ||
/// A value that indicates the <see cref="Claim.Value"/> is Json null. | ||
/// </summary> | ||
/// <remarks>When mapping json to .Net Claim(s), we use empty string to represent the claim value and set the ClaimValueType to JsonNull</remarks> | ||
/// <remarks>When creating a <see cref="Claim"/> the <see cref="Claim.Value"/> cannot be null. The the Json value was nil, then the <see cref="Claim.Value"/> | ||
/// will be set to <see cref="string.Empty"/> and the <see cref="Claim.ValueType"/> will be set to "JSON_NULL".</remarks> | ||
public const string JsonNull = "JSON_NULL"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.