Add namespace to expire_all auth signature

This commit is contained in:
Jason Rhinelander 2022-05-05 17:42:25 -03:00
parent 0264de1daa
commit 9d3d02cf9a
No known key found for this signature in database
GPG key ID: C4992CE7A88D4262
2 changed files with 5 additions and 2 deletions

View file

@ -405,8 +405,10 @@ struct delete_before final : recursive {
/// namespace (namespace 0).
/// - expiry -- the new expiry timestamp (milliseconds since unix epoch). Should be >= now, but
/// tolerance acceptance allows >= 60s ago.
/// - signature -- signature of ("expire_all" || expiry), signed by `pubkey`. Must be base64
/// encoded (json) or bytes (OMQ).
/// - signature -- signature of ("expire_all" || namespace || expiry), signed by `pubkey`. Must be
/// base64 encoded (json) or bytes (OMQ). namespace should be the stringified namespace for
/// non-default namespace expiries (i.e. "42", "-99", "all"), or an empty string for the default
/// namespace (whether or not explicitly provided).
///
/// Returns dict of:
/// - "swarms" dict mapping ed25519 pubkeys (in hex) of swarm members to dict values of:

View file

@ -968,6 +968,7 @@ void RequestHandler::process_client_req(rpc::expire_all&& req, std::function<voi
std::nullopt, // no subkey allowed
req.signature,
"expire_all",
signature_value(req.msg_namespace),
req.expiry)) {
OXEN_LOG(debug, "expire_all: signature verification failed");
return cb(Response{http::UNAUTHORIZED, "expire_all signature verification failed"sv});