Skip to content

Commit

Permalink
expand multiple attribute values with the same name instead of concat…
Browse files Browse the repository at this point in the history
…enating them
  • Loading branch information
fumieval committed Aug 2, 2024
1 parent 12003d4 commit 058e936
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Network/Wai/SAML2/Assertion.hs
Original file line number Diff line number Diff line change
Expand Up @@ -230,19 +230,24 @@ data AssertionAttribute = AssertionAttribute {
attributeFriendlyName :: !(Maybe T.Text),
-- | The name format.
attributeNameFormat :: !T.Text,
-- | The value of the attribute, concatened from the 'attributeValues'.
attributeValue :: !T.Text,
-- | The value of the attribute.
attributeValue :: !T.Text
--
-- @since 0.7
attributeValues :: ![T.Text]
} deriving (Eq, Show)

instance FromXML AssertionAttribute where
parseXML cursor = do
let attributeValues = cursor $/ element (saml2Name "AttributeValue") &/ content
pure AssertionAttribute{
attributeName = T.concat $ attribute "Name" cursor,
attributeFriendlyName =
toMaybeText $ attribute "FriendlyName" cursor,
attributeNameFormat = T.concat $ attribute "NameFormat" cursor,
attributeValue = T.concat $
cursor $/ element (saml2Name "AttributeValue") &/ content
attributeValue = T.concat attributeValues,
attributeValues = attributeValues
}

-- | SAML2 assertion statements (collections of assertion attributes).
Expand Down

0 comments on commit 058e936

Please sign in to comment.