Skip to content

Commit 200d0fe

Browse files
committed
Remove warning according to GHC and Claude suggestions
1 parent 0e71862 commit 200d0fe

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎SAML2/Metadata/Metadata.hs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ instance XP.XmlPickler RoleDescriptor where
400400
where
401401
xpAnyURIList = XP.xpWrapEither
402402
( mapM (maybe (Left "invalid anyURI") Right . URI.parseURIReference) . words
403-
, tail . foldr ((.) (' ':) . URI.uriToString id) ""
403+
, drop 1 . foldr ((.) (' ':) . URI.uriToString id) ""
404404
) $ XP.xpTextDT $ XPS.scDT (namespaceURIString ns) "anyURIListType" []
405405

406406
instance DS.Signable RoleDescriptor where

‎SAML2/XML/Signature.hs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import GHC.Stack
2828
import Control.Applicative ((<|>))
2929
import Control.Exception (SomeException, handle)
3030
import Control.Monad ((<=<))
31-
import Control.Monad.Except
3231
import Crypto.Number.Serialize (i2ospOf_, os2ip)
3332
import Crypto.Hash (hashlazy, SHA1(..), SHA256(..), SHA512(..), RIPEMD160(..))
3433
import qualified Crypto.PubKey.DSA as DSA
@@ -40,6 +39,7 @@ import qualified Data.ByteString.Base64 as Base64
4039
import qualified Data.ByteString.Lazy as BSL
4140
import qualified Data.List.NonEmpty as NonEmpty
4241
import Data.Either (isRight)
42+
import Data.Maybe (listToMaybe)
4343
import Network.URI (URI(..))
4444
import qualified Text.XML.HXT.Core as HXT
4545
import qualified Text.XML.HXT.DOM.ShowXml as DOM
@@ -72,7 +72,9 @@ applyTransformsXML (Transform (Identified (TransformCanonicalization a)) ins x :
7272
applyTransformsXML (Transform (Identified TransformEnvelopedSignature) Nothing [] : tl) =
7373
-- XXX assumes "this" signature in top-level
7474
applyTransformsXML tl
75-
. head . HXT.runLA (HXT.processChildren $ HXT.processChildren
75+
. maybe (error "applyTransformsXML: EnvelopedSignature transform produced no result") id
76+
. listToMaybe
77+
. HXT.runLA (HXT.processChildren $ HXT.processChildren
7678
$ HXT.neg (isDSElem "Signature"))
7779
applyTransformsXML tl = applyTransformsBytes tl . DOM.xshowBlob . return
7880

0 commit comments

Comments
 (0)