Add LIST_OPERATORS case to handle operator listing requests
Some checks are pending
CI / release (push) Waiting to run
CI / debug (push) Waiting to run
CI / check-phpunit (push) Waiting to run
CI / check-phpdoc (push) Waiting to run
CI / generate-phpdoc (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / release-documentation (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions

This commit is contained in:
netkas 2025-06-03 01:04:44 -04:00
parent 0d6447f8df
commit 237af23690
Signed by: netkas
GPG key ID: 4D8629441B76E4CC

View file

@ -16,6 +16,7 @@
enum Method enum Method
{ {
case LIST_OPERATORS;
case CREATE_OPERATOR; case CREATE_OPERATOR;
case DELETE_OPERATOR; case DELETE_OPERATOR;
case ENABLE_OPERATOR; case ENABLE_OPERATOR;
@ -38,6 +39,10 @@
{ {
switch($this) switch($this)
{ {
case self::LIST_OPERATORS:
// This method does not have a dedicated handler, it is handled by the main request handler
// in FederationServer::handleRequest()
break;
case self::GET_OPERATOR: case self::GET_OPERATOR:
GetOperator::handleRequest(); GetOperator::handleRequest();
break; break;
@ -86,8 +91,9 @@
$requestMethod === 'POST' && $path === '/' => null, $requestMethod === 'POST' && $path === '/' => null,
preg_match('#^/attachment/([a-fA-F0-9\-]{36,})$#', $path) => Method::DOWNLOAD_ATTACHMENT, preg_match('#^/attachment/([a-fA-F0-9\-]{36,})$#', $path) => Method::DOWNLOAD_ATTACHMENT,
($requestMethod === 'POST' | $requestMethod === 'PUT') && $path === '/attachment/upload' => Method::UPLOAD_ATTACHMENT, ($requestMethod === 'POST' || $requestMethod === 'PUT') && $path === '/attachment/upload' => Method::UPLOAD_ATTACHMENT,
($requestMethod === 'POST' || $requestMethod === 'GET') && $path === '/operators' => Method::LIST_OPERATORS,
$requestMethod === 'POST' && $path === '/operators/create' => Method::CREATE_OPERATOR, $requestMethod === 'POST' && $path === '/operators/create' => Method::CREATE_OPERATOR,
preg_match('#^/operators/([a-fA-F0-9\-]{36,})$#', $path) && $requestMethod === 'POST' => Method::GET_OPERATOR, preg_match('#^/operators/([a-fA-F0-9\-]{36,})$#', $path) && $requestMethod === 'POST' => Method::GET_OPERATOR,
preg_match('#^/operators/([a-fA-F0-9\-]{36,})/delete$#', $path) && $requestMethod === 'DELETE' => Method::DELETE_OPERATOR, preg_match('#^/operators/([a-fA-F0-9\-]{36,})/delete$#', $path) && $requestMethod === 'DELETE' => Method::DELETE_OPERATOR,