Refactor SettingsGetSignature to update parameter handling by changing 'uuid' to 'signature_uuid' and ensure proper type casting for signature retrieval.

https://github.com/nosial/Socialbox-PHP/issues/62
This commit is contained in:
netkas 2025-03-12 20:39:50 -04:00
parent 9806c317e9
commit 97f2c17282
Signed by: netkas
GPG key ID: 4D8629441B76E4CC

View file

@ -19,14 +19,14 @@
*/ */
public static function execute(ClientRequest $request, RpcRequest $rpcRequest): ?SerializableInterface public static function execute(ClientRequest $request, RpcRequest $rpcRequest): ?SerializableInterface
{ {
if(!$rpcRequest->containsParameter('uuid') && $rpcRequest->getParameter('uuid') !== null) if(!$rpcRequest->containsParameter('signature_uuid'))
{ {
throw new MissingRpcArgumentException('uuid'); throw new MissingRpcArgumentException('signature_uuid');
} }
try try
{ {
$key = SigningKeysManager::getSigningKey($request->getPeer()->getUuid(), $rpcRequest->getParameter('uuid')); $key = SigningKeysManager::getSigningKey($request->getPeer()->getUuid(), (string)$rpcRequest->getParameter('signature_uuid'));
} }
catch (DatabaseOperationException $e) catch (DatabaseOperationException $e)
{ {