From 58593d7da6a893e681b7c64fdf21a02c93dfa0d0 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 10 Jan 2024 13:33:57 +0000 Subject: prepare outbound fep-8b32 (object integrity) but do not enable yet since the additional context seems to break ldsig for some reason, introduce Activity::build_packet() and Activity::ap_context() to reduce code duplication, implement fep-2c59 (webfinger) and some cleanup --- include/network.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'include/network.php') diff --git a/include/network.php b/include/network.php index 13339eccd..854434d5a 100644 --- a/include/network.php +++ b/include/network.php @@ -1,6 +1,6 @@ [ - ACTIVITYSTREAMS_JSONLD_REV, - 'https://w3id.org/security/v1', - z_root() . ZOT_APSCHEMA_REV - ]], $obj ); + $ret = Activity::build_packet($obj, $channel); + logger('data: ' . jindent($ret), LOGGER_DATA); - $headers = []; $headers['Content-Type'] = 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"' ; - $x['signature'] = LDSignatures::sign($x,$channel); - $ret = json_encode($x, JSON_UNESCAPED_SLASHES); - logger('data: ' . jindent($ret), LOGGER_DATA); $headers['Date'] = datetime_convert('UTC','UTC', 'now', 'D, d M Y H:i:s \\G\\M\\T'); $headers['Digest'] = HTTPSig::generate_digest_header($ret); $headers['(request-target)'] = strtolower($_SERVER['REQUEST_METHOD']) . ' ' . $_SERVER['REQUEST_URI']; - $h = HTTPSig::create_sig($headers,$channel['channel_prvkey'],channel_url($channel)); + $h = HTTPSig::create_sig($headers, $channel['channel_prvkey'], channel_url($channel)); HTTPSig::set_headers($h); echo $ret; -- cgit v1.2.3