kopia lustrzana https://github.com/tsileo/little-boxes
Fix HTTP signatures
rodzic
f29ae556cd
commit
21672a7e4d
|
@ -63,7 +63,7 @@ def _body_digest(body: str) -> str:
|
|||
|
||||
def _get_public_key(key_id: str) -> Key:
|
||||
actor = get_backend().fetch_iri(key_id)
|
||||
k = Key(actor["id"])
|
||||
k = Key(actor["id"], key_id)
|
||||
k.load_pub(actor["publicKey"]["publicKeyPem"])
|
||||
return k
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ class Key(object):
|
|||
self.privkey = k
|
||||
|
||||
def key_id(self) -> str:
|
||||
return f"{self.owner}#main-key"
|
||||
return self._id or f"{self.owner}#main-key"
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
return {
|
||||
|
|
|
@ -16,9 +16,9 @@ def test_httpsig():
|
|||
back = InMemBackend()
|
||||
ap.use_backend(back)
|
||||
|
||||
k = Key("https://lol.com")
|
||||
k = Key("https://lol.com", "https://lol.com#lol")
|
||||
k.new()
|
||||
back.FETCH_MOCK["https://lol.com#main-key"] = {
|
||||
back.FETCH_MOCK["https://lol.com#lol"] = {
|
||||
"publicKey": k.to_dict(),
|
||||
"id": "https://lol.com",
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue