Skip to content

Commit

Permalink
More name fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTechArch committed Nov 7, 2024
1 parent 7895bf8 commit b83d830
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/Altinn.Common.PEP/Altinn.Common.PEP/Helpers/DecisionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ private static List<XacmlJsonAttribute> CreateSubjectAttributes(IEnumerable<Clai
XacmlJsonAttribute personUuidAttribute = null;
XacmlJsonAttribute partyIdAttribute = null;
XacmlJsonAttribute resourceIdAttribute = null;
XacmlJsonAttribute orgLegacy = null;
XacmlJsonAttribute orgAttribute = null;
XacmlJsonAttribute legacyOrganizationNumberAttibute = null;
XacmlJsonAttribute organizationNumberAttribute = null;
XacmlJsonAttribute systemUserAttribute = null;

// Mapping all claims on user to attributes
Expand All @@ -188,8 +188,8 @@ private static List<XacmlJsonAttribute> CreateSubjectAttributes(IEnumerable<Clai
if (IsCamelCaseOrgnumberClaim(claim.Type))
{
// Set by Altinn authentication this format
orgLegacy = CreateXacmlJsonAttribute(AltinnXacmlUrns.OrganizationNumber, claim.Value, DefaultType, claim.Issuer);
orgAttribute = CreateXacmlJsonAttribute(AltinnXacmlUrns.OrganizationNumberAttribute, claim.Value, DefaultType, claim.Issuer);
legacyOrganizationNumberAttibute = CreateXacmlJsonAttribute(AltinnXacmlUrns.OrganizationNumber, claim.Value, DefaultType, claim.Issuer);
organizationNumberAttribute = CreateXacmlJsonAttribute(AltinnXacmlUrns.OrganizationNumberAttribute, claim.Value, DefaultType, claim.Issuer);
}
else if (IsScopeClaim(claim.Type))
{
Expand Down Expand Up @@ -222,8 +222,8 @@ private static List<XacmlJsonAttribute> CreateSubjectAttributes(IEnumerable<Clai
else if (IsOrganizationNumberAttributeClaim(claim.Type))
{
// If claimlist contains new format of orgnumber reset any old. To ensure there is not a mismatch
orgAttribute = CreateXacmlJsonAttribute(AltinnXacmlUrns.OrganizationNumberAttribute, claim.Value, DefaultType, claim.Issuer);
orgLegacy = null;
organizationNumberAttribute = CreateXacmlJsonAttribute(AltinnXacmlUrns.OrganizationNumberAttribute, claim.Value, DefaultType, claim.Issuer);
legacyOrganizationNumberAttibute = null;
}
else if (IsValidUrn(claim.Type))
{
Expand Down Expand Up @@ -252,15 +252,15 @@ private static List<XacmlJsonAttribute> CreateSubjectAttributes(IEnumerable<Clai
{
attributes.Add(systemUserAttribute);
}
else if (orgLegacy != null)
else if (legacyOrganizationNumberAttibute != null)
{
// For legeacy we set both
attributes.Add(orgLegacy);
attributes.Add(orgAttribute);
attributes.Add(legacyOrganizationNumberAttibute);
attributes.Add(organizationNumberAttribute);
}
else if (orgAttribute != null)
else if (organizationNumberAttribute != null)
{
attributes.Add(orgAttribute);
attributes.Add(organizationNumberAttribute);
}

return attributes;
Expand Down

0 comments on commit b83d830

Please sign in to comment.