1
0
Fork 0
mirror of https://code.naskya.net/repos/ndqEd synced 2025-03-20 15:14:54 +09:00

Allow actor publicKey to be a URI, and require the URI to match the Sig keyId

This commit is contained in:
fr33domlover 2019-02-04 10:07:25 +00:00
parent c336d56036
commit 02da508ed0
3 changed files with 32 additions and 8 deletions
src/Data/Aeson

View file

@ -15,6 +15,8 @@
module Data.Aeson.Local
( Either' (..)
, toEither
, fromEither
, frg
, parseHttpsURI
, renderURI
@ -37,6 +39,19 @@ data Either' a b = Left' a | Right' b
instance (FromJSON a, FromJSON b) => FromJSON (Either' a b) where
parseJSON v = Left' <$> parseJSON v <|> Right' <$> parseJSON v
instance (ToJSON a, ToJSON b) => ToJSON (Either' a b) where
toJSON = error "toJSON Either'"
toEncoding (Left' x) = toEncoding x
toEncoding (Right' y) = toEncoding y
toEither :: Either' a b -> Either a b
toEither (Left' x) = Left x
toEither (Right' y) = Right y
fromEither :: Either a b -> Either' a b
fromEither (Left x) = Left' x
fromEither (Right y) = Right' y
frg :: Text
frg = "https://forgefed.angeley.es/ns#"