mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Add ActivityPub Move validator
This commit is contained in:
parent
42424028b0
commit
909a6c725b
1 changed files with 23 additions and 0 deletions
23
app/Util/ActivityPub/Validator/MoveValidator.php
Normal file
23
app/Util/ActivityPub/Validator/MoveValidator.php
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Util\ActivityPub\Validator;
|
||||
|
||||
use Illuminate\Validation\Rule;
|
||||
use Validator;
|
||||
|
||||
class MoveValidator
|
||||
{
|
||||
public static function validate($payload)
|
||||
{
|
||||
return Validator::make($payload, [
|
||||
'@context' => 'required',
|
||||
'type' => [
|
||||
'required',
|
||||
Rule::in(['Move']),
|
||||
],
|
||||
'actor' => 'required|url',
|
||||
'object' => 'required|url',
|
||||
'target' => 'required|url',
|
||||
])->passes();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue