From cd4a45c81165e1d8caf64168748c144f5db763e3 Mon Sep 17 00:00:00 2001 From: netkas Date: Fri, 31 Jan 2025 18:14:36 -0500 Subject: [PATCH] Added SettingsSignatureExists --- .../Settings/SettingsSignatureExists.php | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/Socialbox/Classes/StandardMethods/Settings/SettingsSignatureExists.php diff --git a/src/Socialbox/Classes/StandardMethods/Settings/SettingsSignatureExists.php b/src/Socialbox/Classes/StandardMethods/Settings/SettingsSignatureExists.php new file mode 100644 index 0000000..86a7c9d --- /dev/null +++ b/src/Socialbox/Classes/StandardMethods/Settings/SettingsSignatureExists.php @@ -0,0 +1,50 @@ +containsParameter('uuid')) + { + throw new MissingRpcArgumentException('uuid'); + } + + try + { + $uuid = Uuid::fromString($rpcRequest->getParameter('uuid')); + } + catch(InvalidArgumentException) + { + throw new InvalidRpcArgumentException('uuid'); + } + + try + { + return $rpcRequest->produceResponse(SigningKeysManager::signingKeyExists($request->getPeer()->getUuid(), $uuid)); + } + catch(DatabaseOperationException $e) + { + throw new StandardRpcException('Failed to check the signing key existence', StandardError::INTERNAL_SERVER_ERROR, $e); + } + + } + } \ No newline at end of file