File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -62,10 +62,9 @@ instance JSON.FromJSON StringOrURI where
6262 where
6363 isValidURI = (||) <$> not . T. isInfixOf " :" <*> isURI . T. unpack
6464
65- data ValidAud = VANull | VAString StringOrURI | VAArray [StringOrURI ] deriving Generic
65+ data ValidAud = VAString StringOrURI | VAArray [StringOrURI ] deriving Generic
6666instance JSON. FromJSON ValidAud where
67- parseJSON JSON. Null = pure VANull
68- parseJSON o = JSON. genericParseJSON JSON. defaultOptions { JSON. sumEncoding = JSON. UntaggedValue } o
67+ parseJSON = JSON. genericParseJSON JSON. defaultOptions { JSON. sumEncoding = JSON. UntaggedValue }
6968
7069checkForErrors :: (Applicative m , Monoid (m JwtClaimsError )) => UTCTime -> (Text -> Bool ) -> JSON. Object -> m JwtClaimsError
7170checkForErrors time audMatches = mconcat
@@ -89,7 +88,6 @@ checkForErrors time audMatches = mconcat
8988 validAud = \ case
9089 (VAString aud) -> validAudString aud
9190 (VAArray auds) -> null auds || any validAudString auds
92- _ -> True
9391 validAudString = audMatches . unStringOrURI
9492
9593 checkValue invalid msg val =
@@ -100,6 +98,7 @@ checkForErrors time audMatches = mconcat
10098
10199 claim key parseError checkParsed = maybe (pure parseError) (maybe mempty checkParsed) . parseMaybe (.:? key)
102100
101+
103102-- | Receives the JWT secret and audience (from config) and a JWT and returns a
104103-- JSON object of JWT claims.
105104parseToken :: (MonadError Error m , MonadIO m ) => JwkSet -> ByteString -> m JWT. JwtContent
You can’t perform that action at this time.
0 commit comments