From abf7e7606decda9838f69e1e57c6aa99691ff0c2 Mon Sep 17 00:00:00 2001 From: Soatok Dreamseeker Date: Mon, 23 Feb 2026 12:31:56 -0500 Subject: [PATCH 1/3] Add fields to history/view https://github.com/fedi-e2ee/public-key-directory-specification/pull/115 --- src/RequestHandlers/Api/HistoryView.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/RequestHandlers/Api/HistoryView.php b/src/RequestHandlers/Api/HistoryView.php index d417af8..89799c8 100644 --- a/src/RequestHandlers/Api/HistoryView.php +++ b/src/RequestHandlers/Api/HistoryView.php @@ -21,6 +21,7 @@ use FediE2EE\PKDServer\Interfaces\HttpCacheInterface; use FediE2EE\PKDServer\Tables\MerkleState; use JsonException as BaseJsonException; +use ParagonIE\ConstantTime\Base64UrlSafe; use ParagonIE\HPKE\HPKEException; use Psr\SimpleCache\InvalidArgumentException; use SodiumException; @@ -96,6 +97,8 @@ function () use ($hash) { return [ '!pkd-context' => 'fedi-e2ee:v1/api/history/view', 'created' => $leaf->created, + 'dir-publickeyhash' => Base64UrlSafe::encodeUnpadded(sodium_bin2hex($leaf->publicKeyhash)), + 'dir-signature' => Base64UrlSafe::encodeUnpadded(sodium_bin2hex($leaf->signature)), 'encrypted-message' => $leaf->contents, 'inclusion-proof' => $leaf->inclusionProof, 'message' => $message, From 4fe5997bb555c07057c8b3091ab088d83301d53b Mon Sep 17 00:00:00 2001 From: Soatok Dreamseeker Date: Mon, 23 Feb 2026 12:33:03 -0500 Subject: [PATCH 2/3] regenerate docs --- docs/reference/classes/requesthandlers-api.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reference/classes/requesthandlers-api.md b/docs/reference/classes/requesthandlers-api.md index 6e4efa3..01168b0 100644 --- a/docs/reference/classes/requesthandlers-api.md +++ b/docs/reference/classes/requesthandlers-api.md @@ -2432,19 +2432,19 @@ static ยท Returns `string` ### Methods -#### [`__construct`](../../../src/RequestHandlers/Api/HistoryView.php#L50-L57) +#### [`__construct`](../../../src/RequestHandlers/Api/HistoryView.php#L51-L58) Returns `void` **Throws:** `DependencyException`, `TableException`, `CacheException` -#### [`getPrimaryCacheKey`](../../../src/RequestHandlers/Api/HistoryView.php#L60-L63) +#### [`getPrimaryCacheKey`](../../../src/RequestHandlers/Api/HistoryView.php#L61-L64) Returns `string` **Attributes:** `#[Override]` -#### [`handle`](../../../src/RequestHandlers/Api/HistoryView.php#L79-L112) +#### [`handle`](../../../src/RequestHandlers/Api/HistoryView.php#L80-L115) Returns `Psr\Http\Message\ResponseInterface` From dea139e6ce0b97b236ec0fa3e5fb6a236775f38e Mon Sep 17 00:00:00 2001 From: Soatok Dreamseeker Date: Mon, 23 Feb 2026 12:48:59 -0500 Subject: [PATCH 3/3] Fix typo in property name --- src/RequestHandlers/Api/HistoryView.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RequestHandlers/Api/HistoryView.php b/src/RequestHandlers/Api/HistoryView.php index 89799c8..362d25e 100644 --- a/src/RequestHandlers/Api/HistoryView.php +++ b/src/RequestHandlers/Api/HistoryView.php @@ -97,7 +97,7 @@ function () use ($hash) { return [ '!pkd-context' => 'fedi-e2ee:v1/api/history/view', 'created' => $leaf->created, - 'dir-publickeyhash' => Base64UrlSafe::encodeUnpadded(sodium_bin2hex($leaf->publicKeyhash)), + 'dir-publickeyhash' => Base64UrlSafe::encodeUnpadded(sodium_bin2hex($leaf->publicKeyHash)), 'dir-signature' => Base64UrlSafe::encodeUnpadded(sodium_bin2hex($leaf->signature)), 'encrypted-message' => $leaf->contents, 'inclusion-proof' => $leaf->inclusionProof,