-
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
9039293
commit 7102def
Showing
19 changed files
with
105 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project> | ||
<PropertyGroup> | ||
<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
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,23 @@ | ||
<?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) | ||
When you add <TargetFrameworks>net9.0</TargetFrameworks> then aspire thinks there are more than | ||
one framework. But this causes a problem for the Directory.Packages.props file. | ||
In the Directory.Packages.props where we check for $(TargetFramework) == 'net9.0', | ||
which is ONLY set if you use <TargetFrameworks>net9.0</TargetFrameworks> in the csproj file, not | ||
if you set <TargetFramework>. | ||
Now normally it's not recommended to set both, however, since this is only for samples, AND | ||
we do need this check, we're setting it here as well. | ||
--> | ||
<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 ClaimRecord 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 the other ClaimRecord class is public and this one is intentionally internal. | ||
/// </summary> | ||
internal class ClaimRecord() | ||
{ | ||
/// <summary> | ||
/// Serialization friendly claim | ||
/// </summary> | ||
/// <param name="type">The type</param> | ||
/// <param name="value">The Value</param> | ||
internal ClaimRecord(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
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
20 changes: 18 additions & 2 deletions
20
bff/src/Duende.Bff/Shared/ClaimLite.cs → bff/src/Duende.Bff/Shared/ClaimRecord.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,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 ClaimRecord() | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="type"></param> | ||
/// <param name="value"></param> | ||
public ClaimRecord(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
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