Rename request handler classes for clarity and consistency
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-05 15:13:25 -04:00
parent fe8c5ca350
commit 19b932904a
Signed by: netkas
GPG key ID: 4D8629441B76E4CC
5 changed files with 33 additions and 33 deletions

View file

@ -9,16 +9,16 @@
use FederationServer\Methods\Audit\ListAuditLogs; use FederationServer\Methods\Audit\ListAuditLogs;
use FederationServer\Methods\Audit\ViewAuditEntry; use FederationServer\Methods\Audit\ViewAuditEntry;
use FederationServer\Methods\Entities\DeleteEntity; use FederationServer\Methods\Entities\DeleteEntity;
use FederationServer\Methods\Entities\GetEntity; use FederationServer\Methods\Entities\GetEntityRecord;
use FederationServer\Methods\Entities\ListEntities; use FederationServer\Methods\Entities\ListEntities;
use FederationServer\Methods\Entities\ListEntityAuditLogs; use FederationServer\Methods\Entities\ListEntityAuditLogs;
use FederationServer\Methods\Entities\ListEntityBlacklist; use FederationServer\Methods\Entities\ListEntityBlacklistRecords;
use FederationServer\Methods\Entities\ListEntityEvidence; use FederationServer\Methods\Entities\ListEntityEvidence;
use FederationServer\Methods\Entities\PushEntity; use FederationServer\Methods\Entities\PushEntity;
use FederationServer\Methods\Entities\QueryEntity; use FederationServer\Methods\Entities\QueryEntity;
use FederationServer\Methods\Evidence\CreateEvidence; use FederationServer\Methods\Evidence\SubmitEvidence;
use FederationServer\Methods\Evidence\DeleteEvidence; use FederationServer\Methods\Evidence\DeleteEvidence;
use FederationServer\Methods\Evidence\GetEvidence; use FederationServer\Methods\Evidence\GetEvidenceRecord;
use FederationServer\Methods\Evidence\ListEvidence; use FederationServer\Methods\Evidence\ListEvidence;
use FederationServer\Methods\Operators\CreateOperator; use FederationServer\Methods\Operators\CreateOperator;
use FederationServer\Methods\Operators\DeleteOperator; use FederationServer\Methods\Operators\DeleteOperator;
@ -55,26 +55,26 @@
case LIST_OPERATOR_AUDIT_LOGS; case LIST_OPERATOR_AUDIT_LOGS;
case LIST_OPERATOR_BLACKLIST; case LIST_OPERATOR_BLACKLIST;
case GET_ENTITY; case GET_ENTITY_RECORD;
case DELETE_ENTITY; case DELETE_ENTITY;
case LIST_ENTITIES; case LIST_ENTITIES;
case QUERY_ENTITY; case QUERY_ENTITY;
case PUSH_ENTITY; case PUSH_ENTITY;
case LIST_ENTITY_EVIDENCE; case LIST_ENTITY_EVIDENCE;
case LIST_ENTITY_AUDIT_LOGS; case LIST_ENTITY_AUDIT_LOGS;
case LIST_ENTITY_BLACKLIST; case LIST_ENTITY_BLACKLIST_RECORDS;
case LIST_EVIDENCE; case LIST_EVIDENCE;
case CREATE_EVIDENCE; case SUBMIT_EVIDENCE;
case GET_EVIDENCE; case GET_EVIDENCE_RECORD;
case DELETE_EVIDENCE; case DELETE_EVIDENCE;
case LIST_BLACKLIST; case LIST_BLACKLIST;
case CREATE_BLACKLIST; case BLACKLIST_ENTITY;
case DELETE_BLACKLIST; case DELETE_BLACKLIST;
case LIFT_BLACKLIST; case LIFT_BLACKLIST;
case ATTACH_EVIDENCE; case BLACKLIST_ATTACH_EVIDENCE;
case GET_BLACKLIST; case GET_BLACKLIST_RECORD;
case UPLOAD_ATTACHMENT; case UPLOAD_ATTACHMENT;
case DOWNLOAD_ATTACHMENT; case DOWNLOAD_ATTACHMENT;
@ -113,8 +113,8 @@
case self::QUERY_ENTITY: case self::QUERY_ENTITY:
QueryEntity::handleRequest(); QueryEntity::handleRequest();
break; break;
case self::GET_ENTITY: case self::GET_ENTITY_RECORD:
GetEntity::handleRequest(); GetEntityRecord::handleRequest();
break; break;
case self::DELETE_ENTITY: case self::DELETE_ENTITY:
DeleteEntity::handleRequest(); DeleteEntity::handleRequest();
@ -128,8 +128,8 @@
case self::LIST_ENTITY_AUDIT_LOGS: case self::LIST_ENTITY_AUDIT_LOGS:
ListEntityAuditLogs::handleRequest(); ListEntityAuditLogs::handleRequest();
break; break;
case self::LIST_ENTITY_BLACKLIST: case self::LIST_ENTITY_BLACKLIST_RECORDS:
ListEntityBlacklist::handleRequest(); ListEntityBlacklistRecords::handleRequest();
break; break;
case self::LIST_OPERATORS: case self::LIST_OPERATORS:
@ -178,11 +178,11 @@
case self::LIST_EVIDENCE: case self::LIST_EVIDENCE:
ListEvidence::handleRequest(); ListEvidence::handleRequest();
break; break;
case self::CREATE_EVIDENCE: case self::SUBMIT_EVIDENCE:
CreateEvidence::handleRequest(); SubmitEvidence::handleRequest();
break; break;
case self::GET_EVIDENCE: case self::GET_EVIDENCE_RECORD:
GetEvidence::handleRequest();; GetEvidenceRecord::handleRequest();;
break; break;
case self::DELETE_EVIDENCE: case self::DELETE_EVIDENCE:
DeleteEvidence::handleRequest(); DeleteEvidence::handleRequest();
@ -191,7 +191,7 @@
case self::LIST_BLACKLIST: case self::LIST_BLACKLIST:
throw new \Exception('To be implemented'); throw new \Exception('To be implemented');
break; break;
case self::CREATE_BLACKLIST: case self::BLACKLIST_ENTITY:
throw new \Exception('To be implemented'); throw new \Exception('To be implemented');
break; break;
case self::DELETE_BLACKLIST: case self::DELETE_BLACKLIST:
@ -200,10 +200,10 @@
case self::LIFT_BLACKLIST: case self::LIFT_BLACKLIST:
throw new \Exception('To be implemented'); throw new \Exception('To be implemented');
break; break;
case self::ATTACH_EVIDENCE: case self::BLACKLIST_ATTACH_EVIDENCE:
throw new \Exception('To be implemented'); throw new \Exception('To be implemented');
break; break;
case self::GET_BLACKLIST: case self::GET_BLACKLIST_RECORD:
throw new \Exception('To be implemented'); throw new \Exception('To be implemented');
} }
} }
@ -229,22 +229,22 @@
$path === '/entities' && $requestMethod === 'GET' => Method::LIST_ENTITIES, $path === '/entities' && $requestMethod === 'GET' => Method::LIST_ENTITIES,
$path === '/entities' && $requestMethod === 'POST' => Method::PUSH_ENTITY, $path === '/entities' && $requestMethod === 'POST' => Method::PUSH_ENTITY,
$path === '/entities/query' && $requestMethod === 'POST' => Method::QUERY_ENTITY, $path === '/entities/query' && $requestMethod === 'POST' => Method::QUERY_ENTITY,
preg_match('#^/entities/([a-fA-F0-9\-]{36,})$#', $path) && $requestMethod === 'GET' => Method::GET_ENTITY, preg_match('#^/entities/([a-fA-F0-9\-]{36,})$#', $path) && $requestMethod === 'GET' => Method::GET_ENTITY_RECORD,
preg_match('#^/entities/([a-fA-F0-9\-]{36,})$#', $path) && $requestMethod === 'DELETE' => Method::DELETE_ENTITY, preg_match('#^/entities/([a-fA-F0-9\-]{36,})$#', $path) && $requestMethod === 'DELETE' => Method::DELETE_ENTITY,
preg_match('#^/entities/([a-fA-F0-9\-]{36,})/evidence$#', $path) && $requestMethod === 'GET' => Method::LIST_ENTITY_EVIDENCE, preg_match('#^/entities/([a-fA-F0-9\-]{36,})/evidence$#', $path) && $requestMethod === 'GET' => Method::LIST_ENTITY_EVIDENCE,
preg_match('#^/entities/([a-fA-F0-9\-]{36,})/audit$#', $path) && $requestMethod === 'GET' => Method::LIST_ENTITY_AUDIT_LOGS, preg_match('#^/entities/([a-fA-F0-9\-]{36,})/audit$#', $path) && $requestMethod === 'GET' => Method::LIST_ENTITY_AUDIT_LOGS,
preg_match('#^/entities/([a-fA-F0-9\-]{36,})/blacklist$#', $path) && $requestMethod === 'GET' => Method::LIST_ENTITY_BLACKLIST, preg_match('#^/entities/([a-fA-F0-9\-]{36,})/blacklist$#', $path) && $requestMethod === 'GET' => Method::LIST_ENTITY_BLACKLIST_RECORDS,
$path === '/blacklist' && $requestMethod === 'GET' => Method::LIST_BLACKLIST, $path === '/blacklist' && $requestMethod === 'GET' => Method::LIST_BLACKLIST,
$path === '/blacklist' && $requestMethod === 'POST' => Method::CREATE_BLACKLIST, $path === '/blacklist' && $requestMethod === 'POST' => Method::BLACKLIST_ENTITY,
preg_match('#^/blacklist/([a-fA-F0-9\-]{36,})$#', $path) && $requestMethod === 'GET' => Method::GET_BLACKLIST, preg_match('#^/blacklist/([a-fA-F0-9\-]{36,})$#', $path) && $requestMethod === 'GET' => Method::GET_BLACKLIST_RECORD,
preg_match('#^/blacklist/([a-fA-F0-9\-]{36,})$#', $path) && $requestMethod === 'DELETE' => Method::DELETE_BLACKLIST, preg_match('#^/blacklist/([a-fA-F0-9\-]{36,})$#', $path) && $requestMethod === 'DELETE' => Method::DELETE_BLACKLIST,
preg_match('#^/blacklist/([a-fA-F0-9\-]{36,})/lift$#', $path) && $requestMethod === 'POST' => Method::LIFT_BLACKLIST, preg_match('#^/blacklist/([a-fA-F0-9\-]{36,})/lift$#', $path) && $requestMethod === 'POST' => Method::LIFT_BLACKLIST,
preg_match('#^/blacklist/([a-fA-F0-9\-]{36,})/attach_evidence$#', $path) && $requestMethod === 'POST' => Method::ATTACH_EVIDENCE, preg_match('#^/blacklist/([a-fA-F0-9\-]{36,})/attach_evidence$#', $path) && $requestMethod === 'POST' => Method::BLACKLIST_ATTACH_EVIDENCE,
$path === '/evidence' && $requestMethod === 'GET' => Method::LIST_EVIDENCE, $path === '/evidence' && $requestMethod === 'GET' => Method::LIST_EVIDENCE,
$path === '/evidence' && $requestMethod === 'POST' => Method::CREATE_EVIDENCE, $path === '/evidence' && $requestMethod === 'POST' => Method::SUBMIT_EVIDENCE,
preg_match('#^/evidence/([a-fA-F0-9\-]{36,})$#', $path) && $requestMethod === 'GET' => Method::GET_EVIDENCE, preg_match('#^/evidence/([a-fA-F0-9\-]{36,})$#', $path) && $requestMethod === 'GET' => Method::GET_EVIDENCE_RECORD,
preg_match('#^/evidence/([a-fA-F0-9\-]{36,})$#', $path) && $requestMethod === 'DELETE' => Method::DELETE_EVIDENCE, preg_match('#^/evidence/([a-fA-F0-9\-]{36,})$#', $path) && $requestMethod === 'DELETE' => Method::DELETE_EVIDENCE,
$path === '/operators' && $requestMethod === 'GET' => Method::LIST_OPERATORS, $path === '/operators' && $requestMethod === 'GET' => Method::LIST_OPERATORS,

View file

@ -9,7 +9,7 @@
use FederationServer\Exceptions\RequestException; use FederationServer\Exceptions\RequestException;
use FederationServer\FederationServer; use FederationServer\FederationServer;
class GetEntity extends RequestHandler class GetEntityRecord extends RequestHandler
{ {
/** /**
* @inheritDoc * @inheritDoc

View file

@ -11,7 +11,7 @@
use FederationServer\Exceptions\RequestException; use FederationServer\Exceptions\RequestException;
use FederationServer\FederationServer; use FederationServer\FederationServer;
class ListEntityBlacklist extends RequestHandler class ListEntityBlacklistRecords extends RequestHandler
{ {
/** /**
* @inheritDoc * @inheritDoc

View file

@ -11,7 +11,7 @@
use FederationServer\Exceptions\RequestException; use FederationServer\Exceptions\RequestException;
use FederationServer\FederationServer; use FederationServer\FederationServer;
class GetEvidence extends RequestHandler class GetEvidenceRecord extends RequestHandler
{ {
/** /**
* @inheritDoc * @inheritDoc

View file

@ -10,7 +10,7 @@
use FederationServer\Exceptions\RequestException; use FederationServer\Exceptions\RequestException;
use FederationServer\FederationServer; use FederationServer\FederationServer;
class CreateEvidence extends RequestHandler class SubmitEvidence extends RequestHandler
{ {
/** /**
* @inheritDoc * @inheritDoc