Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/NGINXTest.php
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | |||||
'Auth-SSL-Serial' => 'C07AD56B846B5BFF', | 'Auth-SSL-Serial' => 'C07AD56B846B5BFF', | ||||
'Auth-SSL-Fingerprint' => '29d6a80a123d13355ed16b4b04605e29cb55a5ad' | 'Auth-SSL-Fingerprint' => '29d6a80a123d13355ed16b4b04605e29cb55a5ad' | ||||
]; | ]; | ||||
// Pass | // Pass | ||||
$response = $this->withHeaders($headers)->get("api/webhooks/nginx"); | $response = $this->withHeaders($headers)->get("api/webhooks/nginx"); | ||||
$response->assertStatus(200); | $response->assertStatus(200); | ||||
$response->assertHeader('auth-status', 'OK'); | $response->assertHeader('auth-status', 'OK'); | ||||
$response->assertHeader('auth-port', '12143'); | $response->assertHeader('auth-port', \config('imap.imap_port')); | ||||
// Invalid Password | // Invalid Password | ||||
$modifiedHeaders = $headers; | $modifiedHeaders = $headers; | ||||
$modifiedHeaders['Auth-Pass'] = "Invalid"; | $modifiedHeaders['Auth-Pass'] = "Invalid"; | ||||
$response = $this->withHeaders($modifiedHeaders)->get("api/webhooks/nginx"); | $response = $this->withHeaders($modifiedHeaders)->get("api/webhooks/nginx"); | ||||
$response->assertStatus(200); | $response->assertStatus(200); | ||||
$response->assertHeader('auth-status', 'authentication failure'); | $response->assertHeader('auth-status', 'authentication failure'); | ||||
Show All 26 Lines | |||||
$response->assertHeader('auth-status', 'authentication failure'); | $response->assertHeader('auth-status', 'authentication failure'); | ||||
// SMTP Auth Protocol | // SMTP Auth Protocol | ||||
$modifiedHeaders = $headers; | $modifiedHeaders = $headers; | ||||
$modifiedHeaders['Auth-Protocol'] = "smtp"; | $modifiedHeaders['Auth-Protocol'] = "smtp"; | ||||
$response = $this->withHeaders($modifiedHeaders)->get("api/webhooks/nginx"); | $response = $this->withHeaders($modifiedHeaders)->get("api/webhooks/nginx"); | ||||
$response->assertStatus(200); | $response->assertStatus(200); | ||||
$response->assertHeader('auth-status', 'OK'); | $response->assertHeader('auth-status', 'OK'); | ||||
$response->assertHeader('auth-server', '127.0.0.1'); | $response->assertHeader('auth-server', \config('smtp.host')); | ||||
$response->assertHeader('auth-port', '10465'); | $response->assertHeader('auth-port', \config('smtp.port')); | ||||
$response->assertHeader('auth-pass', $pass); | $response->assertHeader('auth-pass', $pass); | ||||
// Empty Auth Protocol | // Empty Auth Protocol | ||||
$modifiedHeaders = $headers; | $modifiedHeaders = $headers; | ||||
$modifiedHeaders['Auth-Protocol'] = ""; | $modifiedHeaders['Auth-Protocol'] = ""; | ||||
$response = $this->withHeaders($modifiedHeaders)->get("api/webhooks/nginx"); | $response = $this->withHeaders($modifiedHeaders)->get("api/webhooks/nginx"); | ||||
$response->assertStatus(200); | $response->assertStatus(200); | ||||
$response->assertHeader('auth-status', 'authentication failure'); | $response->assertHeader('auth-status', 'authentication failure'); | ||||
// Guam | // Guam | ||||
$john->setSettings(['guam_enabled' => 'true']); | $john->setSettings(['guam_enabled' => 'true']); | ||||
$response = $this->withHeaders($headers)->get("api/webhooks/nginx"); | $response = $this->withHeaders($headers)->get("api/webhooks/nginx"); | ||||
$response->assertStatus(200); | $response->assertStatus(200); | ||||
$response->assertHeader('auth-status', 'OK'); | $response->assertHeader('auth-status', 'OK'); | ||||
$response->assertHeader('auth-server', '127.0.0.1'); | $response->assertHeader('auth-server', \config('imap.host')); | ||||
$response->assertHeader('auth-port', '9143'); | $response->assertHeader('auth-port', \config('imap.guam_port')); | ||||
$companionApp = $this->getTestCompanionApp( | $companionApp = $this->getTestCompanionApp( | ||||
'testdevice', | 'testdevice', | ||||
$john, | $john, | ||||
[ | [ | ||||
'notification_token' => 'notificationtoken', | 'notification_token' => 'notificationtoken', | ||||
'mfa_enabled' => 1, | 'mfa_enabled' => 1, | ||||
▲ Show 20 Lines • Show All 144 Lines • Show Last 20 Lines |