mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 10:08:05 +00:00
- Consume an ExternalAccount on Account creation - Add a tombstone to an ExternalAccount to ensure non re-usage - Add related tests - Generalize Utils - Stop public registration when there is no ExternalAccounts left - Add GenerateExternalAccounts, ExportToExternalAccounts and ImportExternalAccounts console scripts - Provision the ExternalAccount using the depends_on/idkey pair
25 lines
632 B
PHP
25 lines
632 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\ExternalAccount;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class ExternalAccountFactory extends Factory
|
|
{
|
|
protected $model = ExternalAccount::class;
|
|
|
|
public function definition()
|
|
{
|
|
$username = $this->faker->username;
|
|
$realm = config('app.realm') ?? config('app.sip_domain');
|
|
|
|
return [
|
|
'username' => $username,
|
|
'domain' => config('app.sip_domain'),
|
|
'group' => 'test',
|
|
'password' => hash('sha256', $username.':'.$realm.':testtest'),
|
|
'algorithm' => 'SHA-256',
|
|
];
|
|
}
|
|
}
|