mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-28 23:54:51 +09:00
AP: Recognize "CryptographicKey" as a type of http sig keys
The examples in the security vocabulary's spec use "Key" but the JSON-LD context doesn't define that term. From now on, just in case, recognizing both "Key" and "CryptographicKey" as indication that the object is a key. zPlus, thanks for finding this bug!
This commit is contained in:
parent
417fcd3e94
commit
55c87b8a54
1 changed files with 2 additions and 2 deletions
|
@ -223,8 +223,8 @@ instance ActivityPub PublicKey where
|
||||||
parseObject o = do
|
parseObject o = do
|
||||||
mtyp <- optional $ o .: "@type" <|> o .: "type"
|
mtyp <- optional $ o .: "@type" <|> o .: "type"
|
||||||
for_ mtyp $ \ t ->
|
for_ mtyp $ \ t ->
|
||||||
when (t /= ("Key" :: Text)) $
|
unless (t == ("Key" :: Text) || t == "CryptographicKey") $
|
||||||
fail "PublicKey @type isn't Key"
|
fail "PublicKey @type isn't Key or CryptographicKey"
|
||||||
RefURI authority id_ <- o .: "@id" <|> o .: "id"
|
RefURI authority id_ <- o .: "@id" <|> o .: "id"
|
||||||
shared <- o .:|? "isShared" .!= False
|
shared <- o .:|? "isShared" .!= False
|
||||||
fmap (authority,) $
|
fmap (authority,) $
|
||||||
|
|
Loading…
Reference in a new issue