kopia lustrzana https://github.com/pixelfed/pixelfed
Add Follow ap validator
rodzic
a6228ffce7
commit
92f2d5cf74
|
@ -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;
|
||||
}
|
||||
}
|
Ładowanie…
Reference in New Issue