mirror of
https://code.sup39.dev/repos/Wqawg
synced 2025-03-20 04:46:22 +09:00
Allow actor publicKey to be a URI, and require the URI to match the Sig keyId
This commit is contained in:
parent
c336d56036
commit
02da508ed0
3 changed files with 32 additions and 8 deletions
src/Data/Aeson
|
@ -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#"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue