forked from mirror/pixelfed
Add Follow ap validator
This commit is contained in:
parent
a6228ffce7
commit
92f2d5cf74
1 changed files with 25 additions and 0 deletions
25
app/Util/ActivityPub/Validator/Follow.php
Normal file
25
app/Util/ActivityPub/Validator/Follow.php
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Util\ActivityPub\Validator;
|
||||||
|
|
||||||
|
use Validator;
|
||||||
|
use Illuminate\Validation\Rule;
|
||||||
|
|
||||||
|
class Follow {
|
||||||
|
|
||||||
|
public static function validate($payload)
|
||||||
|
{
|
||||||
|
$valid = Validator::make($payload, [
|
||||||
|
'@context' => 'required',
|
||||||
|
'id' => 'required|string',
|
||||||
|
'type' => [
|
||||||
|
'required',
|
||||||
|
Rule::in(['Like'])
|
||||||
|
],
|
||||||
|
'actor' => 'required|url|active_url',
|
||||||
|
'object' => 'required|url|active_url'
|
||||||
|
])->passes();
|
||||||
|
|
||||||
|
return $valid;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue