-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored the use of ClaimsLite and ClaimsRecord into a single type
- Loading branch information
1 parent
68ef1f8
commit 97db29d
Showing
10 changed files
with
91 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project> | ||
<PropertyGroup> | ||
<!-- This line is needed because: | ||
Aspire needs a single target framework | ||
(until this is resolved: https://github.com/dotnet/aspire/issues/2962) | ||
Strangely enough, <TargetFrameworks>net9.0</TargetFrameworks> in the csproj file is not enough. | ||
But, to use a Directory.Packages.props where we check for $(TargetFramework) == 'net9.0', | ||
we need to set the TargetFramework to 'net9.0' here. | ||
--> | ||
<TargetFramework>net9.0</TargetFramework> | ||
</PropertyGroup> | ||
<Import Project="../../samples.props" /> | ||
</Project> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Duende.Bff; | ||
|
||
/// <summary> | ||
/// Serialization friendly claim. | ||
/// | ||
/// Note, this is a copy of the ClaimsLite class from Duende.Bff, but since we can't create a reference to it, we need to copy it here. | ||
/// We also can't link to it (as we do with the extensions) because we had to make it public. | ||
/// </summary> | ||
internal class ClaimLite() | ||
{ | ||
/// <summary> | ||
/// Serialization friendly claim | ||
/// </summary> | ||
/// <param name="type">The type</param> | ||
/// <param name="value">The Value</param> | ||
internal ClaimLite(string type, object value) : this() | ||
{ | ||
Type = type; | ||
Value = value; | ||
} | ||
|
||
/// <summary> | ||
/// The type | ||
/// </summary> | ||
[JsonPropertyName("type")] | ||
public string Type { get; init; } = default!; | ||
|
||
/// <summary> | ||
/// The value | ||
/// </summary> | ||
[JsonPropertyName("value")] | ||
public object Value { get; init; } = default!; | ||
|
||
/// <summary> | ||
/// The value type | ||
/// </summary> | ||
[JsonPropertyName("valueType")] | ||
public string? ValueType { get; init; } | ||
} |
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
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,25 +1,41 @@ | ||
// Copyright (c) Duende Software. All rights reserved. | ||
// See LICENSE in the project root for license information. | ||
|
||
using System.Text.Json.Serialization; | ||
|
||
namespace Duende.Bff; | ||
|
||
/// <summary> | ||
/// Serialization friendly claim | ||
/// </summary> | ||
internal class ClaimLite | ||
public class ClaimLite() | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="type"></param> | ||
/// <param name="value"></param> | ||
public ClaimLite(string type, object value) : this() | ||
{ | ||
Type = type; | ||
Value = value; | ||
} | ||
|
||
/// <summary> | ||
/// The type | ||
/// </summary> | ||
[JsonPropertyName("type")] | ||
public string Type { get; init; } = default!; | ||
|
||
/// <summary> | ||
/// The value | ||
/// </summary> | ||
public string Value { get; init; } = default!; | ||
[JsonPropertyName("value")] | ||
public object Value { get; init; } = default!; | ||
|
||
/// <summary> | ||
/// The value type | ||
/// </summary> | ||
[JsonPropertyName("valueType")] | ||
public string? ValueType { get; init; } | ||
} |
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