Skip to content

Commit

Permalink
Added a property for xforwardedfor header (#674)
Browse files Browse the repository at this point in the history
* Added a property for xforwardedfor header

* Added jsonignore on XForwardedForHeader to exclude it from deserializing

---------

Co-authored-by: acn-dgopa <acn-dgopa@dev-acn-tje-14>
  • Loading branch information
acn-dgopa and acn-dgopa authored Jan 19, 2024
1 parent a4e5c86 commit 57e1d15
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
</AdditionalFiles>
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="8.0.1" />
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<CodeAnalysisRuleSet>..\..\Altinn3.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace Altinn.Authorization.ABAC.Xacml.JsonProfile
{
Expand Down Expand Up @@ -64,5 +65,11 @@ public class XacmlJsonRequest
/// Gets or sets references to multiple requests.
/// </summary>
public XacmlJsonMultiRequests MultiRequests { get; set; }

/// <summary>
/// Gets the x-forwarded-for header value from the request headers of app
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.Always)]
public string XForwardedForHeader { get; set; }
}
}

0 comments on commit 57e1d15

Please sign in to comment.