From fb9d75d94a043b815187a19998b4d953cfae4a78 Mon Sep 17 00:00:00 2001 From: Michael Markoski Date: Tue, 21 May 2019 16:02:08 -0500 Subject: [PATCH] Add Crypto endpoints to crypto.php, update TLS.php add php docs for methods add test class work on crypto tests add tls tests finish crypto tests update doc returns add type to parameter --- src/Endpoints/Crypto.php | 233 ++++++++++++++++++ src/Endpoints/TLS.php | 109 ++++---- tests/Endpoints/CryptoTest.php | 220 +++++++++++++++++ tests/Endpoints/TLSTest.php | 51 +++- .../Endpoints/getHTTPSRedirectSetting.json | 6 + .../Endpoints/getHTTPSRewritesSetting.json | 6 + .../Endpoints/getOnionRoutingSetting.json | 6 + .../getOpportunisticEncryptionSetting.json | 11 + tests/Fixtures/Endpoints/getSSLSetting.json | 11 + .../Endpoints/getSSLVerificationStatus.json | 16 ++ .../Fixtures/Endpoints/getTLSClientAuth.json | 11 + .../Endpoints/updateHTTPSRedirectSetting.json | 6 + .../Endpoints/updateHTTPSRewritesSetting.json | 6 + .../Endpoints/updateOnionRoutingSetting.json | 6 + .../updateOpportunisticEncryptionSetting.json | 11 + .../Fixtures/Endpoints/updateSSLSetting.json | 11 + .../Endpoints/updateTLSClientAuth.json | 11 + 17 files changed, 666 insertions(+), 65 deletions(-) create mode 100644 src/Endpoints/Crypto.php create mode 100644 tests/Endpoints/CryptoTest.php create mode 100644 tests/Fixtures/Endpoints/getHTTPSRedirectSetting.json create mode 100644 tests/Fixtures/Endpoints/getHTTPSRewritesSetting.json create mode 100644 tests/Fixtures/Endpoints/getOnionRoutingSetting.json create mode 100644 tests/Fixtures/Endpoints/getOpportunisticEncryptionSetting.json create mode 100644 tests/Fixtures/Endpoints/getSSLSetting.json create mode 100644 tests/Fixtures/Endpoints/getSSLVerificationStatus.json create mode 100644 tests/Fixtures/Endpoints/getTLSClientAuth.json create mode 100644 tests/Fixtures/Endpoints/updateHTTPSRedirectSetting.json create mode 100644 tests/Fixtures/Endpoints/updateHTTPSRewritesSetting.json create mode 100644 tests/Fixtures/Endpoints/updateOnionRoutingSetting.json create mode 100644 tests/Fixtures/Endpoints/updateOpportunisticEncryptionSetting.json create mode 100644 tests/Fixtures/Endpoints/updateSSLSetting.json create mode 100644 tests/Fixtures/Endpoints/updateTLSClientAuth.json diff --git a/src/Endpoints/Crypto.php b/src/Endpoints/Crypto.php new file mode 100644 index 0000000..a5a03f3 --- /dev/null +++ b/src/Endpoints/Crypto.php @@ -0,0 +1,233 @@ +adapter = $adapter; + } + + /** + * Get the SSL setting for the zone + * + * @param string $zoneID The ID of the zone + * @return string|false + */ + public function getSSLSetting(string $zoneID) + { + $return = $this->adapter->get( + 'zones/' . $zoneID . '/settings/ssl' + ); + $body = json_decode($return->getBody()); + if (isset($body->result)) { + return $body->result->value; + } + return false; + } + + /** + * Get SSL Verification Info for a Zone + * + * @param string $zoneID The ID of the zone + * @return array|false + */ + public function getSSLVerificationStatus(string $zoneID) + { + $return = $this->adapter->get( + 'zones/' . $zoneID . '/ssl/verification' + ); + $body = json_decode($return->getBody()); + if (isset($body->result)) { + return $body; + } + return false; + } + + /** + * Get the Opportunistic Encryption feature for a zone. + * + * @param string $zoneID The ID of the zone + * @return string|false + */ + public function getOpportunisticEncryptionSetting(string $zoneID) + { + $return = $this->adapter->get( + 'zones/' . $zoneID . '/settings/opportunistic_encryption' + ); + $body = json_decode($return->getBody()); + if (isset($body->result)) { + return $body->result->value; + } + return false; + } + + /** + * Get the Onion Routing feature for a zone. + * + * @param string $zoneID The ID of the zone + * @return string|false + */ + public function getOnionRoutingSetting(string $zoneID) + { + $return = $this->adapter->get( + 'zones/' . $zoneID . '/settings/opportunistic_onion' + ); + $body = json_decode($return->getBody()); + if (isset($body->result)) { + return $body->result; + } + return false; + } + + /** + * Get the HTTPS Redirect setting for the zone + * + * @param string $zoneID The ID of the zone + * @return string|false + */ + public function getHTTPSRedirectSetting(string $zoneID) + { + $return = $this->adapter->get( + 'zones/' . $zoneID . '/settings/always_use_https' + ); + $body = json_decode($return->getBody()); + if (isset($body->result)) { + return $body->result; + } + return false; + } + + /** + * Get the HTTPS Rewrite setting for the zone + * + * @param string $zoneID The ID of the zone + * @return string|false + */ + public function getHTTPSRewritesSetting(string $zoneID) + { + $return = $this->adapter->get( + 'zones/' . $zoneID . '/settings/automatic_https_rewrites' + ); + $body = json_decode($return->getBody()); + if (isset($body->result)) { + return $body->result; + } + return false; + } + + /** + * Update the SSL setting for the zone + * + * @param string $zoneID The ID of the zone + * @param string $value The value of the zone setting + * @return bool + */ + public function updateSSLSetting(string $zoneID, string $value) + { + $return = $this->adapter->patch( + 'zones/' . $zoneID . '/settings/ssl', + [ + 'value' => $value, + ] + ); + $body = json_decode($return->getBody()); + if (isset($body->success) && $body->success == true) { + return true; + } + return false; + } + + /** + * Update the HTTPS Redirect setting for the zone + * + * @param string $zoneID The ID of the zone + * @param string $value The value of the zone setting + * @return bool + */ + public function updateHTTPSRedirectSetting(string $zoneID, string $value) + { + $return = $this->adapter->patch( + 'zones/' . $zoneID . '/settings/always_use_https', + [ + 'value' => $value, + ] + ); + $body = json_decode($return->getBody()); + if (isset($body->success) && $body->success == true) { + return true; + } + return false; + } + + /** + * Update the HTTPS Rewrite setting for the zone + * + * @param string $zoneID The ID of the zone + * @param string $value The value of the zone setting + * @return bool + */ + public function updateHTTPSRewritesSetting(string $zoneID, string $value) + { + $return = $this->adapter->patch( + 'zones/' . $zoneID . '/settings/automatic_https_rewrites', + [ + 'value' => $value, + ] + ); + $body = json_decode($return->getBody()); + if (isset($body->success) && $body->success == true) { + return true; + } + return false; + } + + /** + * Update the Oppurtunistic Encryption setting for the zone + * + * @param string $zoneID The ID of the zone + * @param string $value The value of the zone setting + * @return bool + */ + public function updateOpportunisticEncryptionSetting(string $zoneID, string $value) + { + $return = $this->adapter->patch( + 'zones/' . $zoneID . '/settings/opportunistic_encryption', + [ + 'value' => $value, + ] + ); + $body = json_decode($return->getBody()); + if (isset($body->success) && $body->success == true) { + return true; + } + return false; + } + + /** + * Update the Onion Routing setting for the zone + * + * @param string $zoneID The ID of the zone + * @param string $value The value of the zone setting + * @return bool + */ + public function updateOnionRoutingSetting(string $zoneID, string $value) + { + $return = $this->adapter->patch( + 'zones/' . $zoneID . '/settings/opportunistic_onion', + [ + 'value' => $value, + ] + ); + $body = json_decode($return->getBody()); + if (isset($body->success) && $body->success == true) { + return true; + } + return false; + } +} diff --git a/src/Endpoints/TLS.php b/src/Endpoints/TLS.php index 46c960e..b6ca671 100644 --- a/src/Endpoints/TLS.php +++ b/src/Endpoints/TLS.php @@ -19,6 +19,30 @@ class TLS implements API $this->adapter = $adapter; } + /** + * Get the TLS Client Auth setting for the zone + * + * @param string $zoneID The ID of the zone + * @return string|false + */ + public function getTLSClientAuth($zoneID) + { + $return = $this->adapter->get( + 'zones/' . $zoneID . '/settings/tls_client_auth' + ); + $body = json_decode($return->getBody()); + if (isset($body->result)) { + return $body->result->value; + } + return false; + } + + /** + * Enable TLS 1.3 for the zone + * + * @param string $zoneID The ID of the zone + * @return bool + */ public function enableTLS13($zoneID) { $return = $this->adapter->patch( @@ -26,14 +50,18 @@ class TLS implements API ['value' => 'on'] ); $body = json_decode($return->getBody()); - - if ($body->success) { + if (isset($body->success) && $body->success == true) { return true; } - return false; } + /** + * Disable TLS 1.3 for the zone + * + * @param string $zoneID The ID of the zone + * @return bool + */ public function disableTLS13($zoneID) { $return = $this->adapter->patch( @@ -41,15 +69,19 @@ class TLS implements API ['value' => 'off'] ); $body = json_decode($return->getBody()); - - if ($body->success) { + if (isset($body->success) && $body->success == true) { return true; } - return false; } - + /** + * Update the minimum TLS version setting for the zone + * + * @param string $zoneID The ID of the zone + * @param string $minimumVersion The version to update to + * @return bool + */ public function changeMinimumTLSVersion($zoneID, $minimumVersion) { $return = $this->adapter->patch( @@ -59,73 +91,32 @@ class TLS implements API ] ); $body = json_decode($return->getBody()); - - if ($body->success) { + if (isset($body->success) && $body->success == true) { return true; } - return false; } - public function getHTTPSRedirectSetting($zoneID) - { - $return = $this->adapter->get( - 'zones/' . $zoneID . '/settings/always_use_https' - ); - $body = json_decode($return->getBody()); - - if ($body->success) { - return $body->result->value; - } - - return false; - } - - public function getHTTPSRewritesSetting($zoneID) - { - $return = $this->adapter->get( - 'zones/' . $zoneID . '/settings/automatic_https_rewrites' - ); - $body = json_decode($return->getBody()); - - if ($body->success) { - return $body->result->value; - } - - return false; - } - - public function updateHTTPSRedirectStatus($zoneID, $value) + /** + * Update the TLS Client Auth setting for the zone + * + * @param string $zoneID The ID of the zone + * @param string $value The value of the zone setting + * @return bool + */ + public function updateTLSClientAuth($zoneID, $value) { $return = $this->adapter->patch( - 'zones/' . $zoneID . '/settings/always_use_https', + 'zones/' . $zoneID . '/settings/tls_client_auth', [ 'value' => $value, ] ); $body = json_decode($return->getBody()); - - if ($body->success) { + if (isset($body->success) && $body->success == true) { return true; } - return false; } - public function updateHTTPSRewritesStatus($zoneID, $value) - { - $return = $this->adapter->patch( - 'zones/' . $zoneID . '/settings/automatic_https_rewrites', - [ - 'value' => $value, - ] - ); - $body = json_decode($return->getBody()); - - if ($body->success) { - return true; - } - - return false; - } } diff --git a/tests/Endpoints/CryptoTest.php b/tests/Endpoints/CryptoTest.php new file mode 100644 index 0000000..5019308 --- /dev/null +++ b/tests/Endpoints/CryptoTest.php @@ -0,0 +1,220 @@ +getPsr7JsonResponseForFixture('Endpoints/getSSLSetting.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('get')->willReturn($response); + + $mock->expects($this->once()) + ->method('get') + ->with( + $this->equalTo('zones/c2547eb745079dac9320b638f5e225cf483cc5cfdda41/settings/ssl') + ); + + $cryptoMock = new \Cloudflare\API\Endpoints\Crypto($mock); + $result = $cryptoMock->getSSLSetting('c2547eb745079dac9320b638f5e225cf483cc5cfdda41'); + + $this->assertEquals('off', $result); + } + + public function testGetSSLVerificationStatus() + { + $response = $this->getPsr7JsonResponseForFixture('Endpoints/getSSLVerificationStatus.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('get')->willReturn($response); + + $mock->expects($this->once()) + ->method('get') + ->with( + $this->equalTo('zones/c2547eb745079dac9320b638f5e225cf483cc5cfdda41/ssl/verification') + ); + + $cryptoMock = new \Cloudflare\API\Endpoints\Crypto($mock); + $result = $cryptoMock->getSSLVerificationStatus('c2547eb745079dac9320b638f5e225cf483cc5cfdda41'); + + $this->assertObjectHasAttribute('result', $result); + $this->assertEquals('active', $result->result{0}->certificate_status); + } + + public function testGetOpportunisticEncryptionSetting() + { + $response = $this->getPsr7JsonResponseForFixture('Endpoints/getOpportunisticEncryptionSetting.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('get')->willReturn($response); + + $mock->expects($this->once()) + ->method('get') + ->with( + $this->equalTo('zones/c2547eb745079dac9320b638f5e225cf483cc5cfdda41/settings/opportunistic_encryption') + ); + + $cryptoMock = new \Cloudflare\API\Endpoints\Crypto($mock); + $result = $cryptoMock->getOpportunisticEncryptionSetting('c2547eb745079dac9320b638f5e225cf483cc5cfdda41'); + + $this->assertEquals('off', $result); + } + + public function testGetOnionRoutingSetting() + { + $response = $this->getPsr7JsonResponseForFixture('Endpoints/getOnionRoutingSetting.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('get')->willReturn($response); + + $mock->expects($this->once()) + ->method('get') + ->with( + $this->equalTo('zones/c2547eb745079dac9320b638f5e225cf483cc5cfdda41/settings/opportunistic_onion') + ); + + $cryptoMock = new \Cloudflare\API\Endpoints\Crypto($mock); + $result = $cryptoMock->getOnionRoutingSetting('c2547eb745079dac9320b638f5e225cf483cc5cfdda41'); + + $this->assertEquals('off', $result); + } + + public function testGetHTTPSRedirectSetting() + { + $response = $this->getPsr7JsonResponseForFixture('Endpoints/getHTTPSRedirectSetting.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('get')->willReturn($response); + + $mock->expects($this->once()) + ->method('get') + ->with( + $this->equalTo('zones/c2547eb745079dac9320b638f5e225cf483cc5cfdda41/settings/always_use_https') + ); + + $cryptoMock = new \Cloudflare\API\Endpoints\Crypto($mock); + $result = $cryptoMock->getHTTPSRedirectSetting('c2547eb745079dac9320b638f5e225cf483cc5cfdda41'); + + $this->assertEquals('off', $result); + } + + public function testGetHTTPSRewritesSetting() + { + $response = $this->getPsr7JsonResponseForFixture('Endpoints/getHTTPSRewritesSetting.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('get')->willReturn($response); + + $mock->expects($this->once()) + ->method('get') + ->with( + $this->equalTo('zones/c2547eb745079dac9320b638f5e225cf483cc5cfdda41/settings/automatic_https_rewrites') + ); + + $cryptoMock = new \Cloudflare\API\Endpoints\Crypto($mock); + $result = $cryptoMock->getHTTPSRewritesSetting('c2547eb745079dac9320b638f5e225cf483cc5cfdda41'); + + $this->assertEquals('off', $result); + } + + public function testUpdateSSLSetting() + { + $response = $this->getPsr7JsonResponseForFixture('Endpoints/updateSSLSetting.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('patch')->willReturn($response); + + $mock->expects($this->once()) + ->method('patch') + ->with( + $this->equalTo('zones/c2547eb745079dac9320b638f5e225cf483cc5cfdda41/settings/ssl'), + $this->equalTo(['value' => 'full']) + ); + + $cryptoMock = new \Cloudflare\API\Endpoints\Crypto($mock); + $result = $cryptoMock->updateSSLSetting('c2547eb745079dac9320b638f5e225cf483cc5cfdda41', 'full'); + + $this->assertTrue($result); + } + + public function testUpdateHTTPSRedirectSetting() + { + $response = $this->getPsr7JsonResponseForFixture('Endpoints/updateHTTPSRedirectSetting.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('patch')->willReturn($response); + + $mock->expects($this->once()) + ->method('patch') + ->with( + $this->equalTo('zones/c2547eb745079dac9320b638f5e225cf483cc5cfdda41/settings/always_use_https'), + $this->equalTo(['value' => 'off']) + ); + + $cryptoMock = new \Cloudflare\API\Endpoints\Crypto($mock); + $result = $cryptoMock->updateHTTPSRedirectSetting('c2547eb745079dac9320b638f5e225cf483cc5cfdda41', 'off'); + + $this->assertTrue($result); + } + + public function testUpdateHTTPSRewritesSetting() + { + $response = $this->getPsr7JsonResponseForFixture('Endpoints/updateHTTPSRewritesSetting.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('patch')->willReturn($response); + + $mock->expects($this->once()) + ->method('patch') + ->with( + $this->equalTo('zones/c2547eb745079dac9320b638f5e225cf483cc5cfdda41/settings/automatic_https_rewrites'), + $this->equalTo(['value' => 'off']) + ); + + $cryptoMock = new \Cloudflare\API\Endpoints\Crypto($mock); + $result = $cryptoMock->updateHTTPSRewritesSetting('c2547eb745079dac9320b638f5e225cf483cc5cfdda41', 'off'); + + $this->assertTrue($result); + } + + public function testUpdateOpportunisticEncryptionSetting() + { + $response = $this->getPsr7JsonResponseForFixture('Endpoints/updateOpportunisticEncryptionSetting.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('patch')->willReturn($response); + + $mock->expects($this->once()) + ->method('patch') + ->with( + $this->equalTo('zones/c2547eb745079dac9320b638f5e225cf483cc5cfdda41/settings/opportunistic_encryption'), + $this->equalTo(['value' => 'off']) + ); + + $cryptoMock = new \Cloudflare\API\Endpoints\Crypto($mock); + $result = $cryptoMock->updateOpportunisticEncryptionSetting('c2547eb745079dac9320b638f5e225cf483cc5cfdda41', 'off'); + + $this->assertTrue($result); + } + + public function testUpdateOnionRoutingSetting() + { + $response = $this->getPsr7JsonResponseForFixture('Endpoints/updateOnionRoutingSetting.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('patch')->willReturn($response); + + $mock->expects($this->once()) + ->method('patch') + ->with( + $this->equalTo('zones/c2547eb745079dac9320b638f5e225cf483cc5cfdda41/settings/opportunistic_onion'), + $this->equalTo(['value' => 'off']) + ); + + $cryptoMock = new \Cloudflare\API\Endpoints\Crypto($mock); + $result = $cryptoMock->updateOnionRoutingSetting('c2547eb745079dac9320b638f5e225cf483cc5cfdda41', 'off'); + + $this->assertTrue($result); + } + +} diff --git a/tests/Endpoints/TLSTest.php b/tests/Endpoints/TLSTest.php index d17aabb..cf0018c 100644 --- a/tests/Endpoints/TLSTest.php +++ b/tests/Endpoints/TLSTest.php @@ -9,6 +9,25 @@ class TLSTest extends TestCase { + public function testGetTLSClientAuth() + { + $response = $this->getPsr7JsonResponseForFixture('Endpoints/getTLSClientAuth.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('get')->willReturn($response); + + $mock->expects($this->once()) + ->method('get') + ->with( + $this->equalTo('zones/c2547eb745079dac9320b638f5e225cf483cc5cfdda41/settings/tls_client_auth') + ); + + $tlsMock = new \Cloudflare\API\Endpoints\TLS($mock); + $result = $tlsMock->getTLSClientAuth('c2547eb745079dac9320b638f5e225cf483cc5cfdda41'); + + $this->assertEquals('off', $result); + } + public function testEnableTLS13() { $response = $this->getPsr7JsonResponseForFixture('Endpoints/enableTLS13.json'); @@ -23,8 +42,8 @@ class TLSTest extends TestCase $this->equalTo(['value' => 'on']) ); - $zoneTLSSettings = new \Cloudflare\API\Endpoints\TLS($mock); - $result = $zoneTLSSettings->enableTLS13('c2547eb745079dac9320b638f5e225cf483cc5cfdda41', true); + $tlsMock = new \Cloudflare\API\Endpoints\TLS($mock); + $result = $tlsMock->enableTLS13('c2547eb745079dac9320b638f5e225cf483cc5cfdda41', true); $this->assertTrue($result); } @@ -43,8 +62,8 @@ class TLSTest extends TestCase $this->equalTo(['value' => 'off']) ); - $zoneTLSSettings = new \Cloudflare\API\Endpoints\TLS($mock); - $result = $zoneTLSSettings->disableTLS13('c2547eb745079dac9320b638f5e225cf483cc5cfdda41', true); + $tlsMock = new \Cloudflare\API\Endpoints\TLS($mock); + $result = $tlsMock->disableTLS13('c2547eb745079dac9320b638f5e225cf483cc5cfdda41', true); $this->assertTrue($result); } @@ -63,8 +82,28 @@ class TLSTest extends TestCase $this->equalTo(['value' => '1.1']) ); - $zoneTLSSettings = new \Cloudflare\API\Endpoints\TLS($mock); - $result = $zoneTLSSettings->changeMinimumTLSVersion('c2547eb745079dac9320b638f5e225cf483cc5cfdda41', '1.1'); + $tlsMock = new \Cloudflare\API\Endpoints\TLS($mock); + $result = $tlsMock->changeMinimumTLSVersion('c2547eb745079dac9320b638f5e225cf483cc5cfdda41', '1.1'); + + $this->assertTrue($result); + } + + public function testUpdateTLSClientAuth() + { + $response = $this->getPsr7JsonResponseForFixture('Endpoints/updateTLSClientAuth.json'); + + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('patch')->willReturn($response); + + $mock->expects($this->once()) + ->method('patch') + ->with( + $this->equalTo('zones/c2547eb745079dac9320b638f5e225cf483cc5cfdda41/settings/tls_client_auth'), + $this->equalTo(['value' => 'off']) + ); + + $tlsMock = new \Cloudflare\API\Endpoints\TLS($mock); + $result = $tlsMock->updateTLSClientAuth('c2547eb745079dac9320b638f5e225cf483cc5cfdda41', 'off'); $this->assertTrue($result); } diff --git a/tests/Fixtures/Endpoints/getHTTPSRedirectSetting.json b/tests/Fixtures/Endpoints/getHTTPSRedirectSetting.json new file mode 100644 index 0000000..878457d --- /dev/null +++ b/tests/Fixtures/Endpoints/getHTTPSRedirectSetting.json @@ -0,0 +1,6 @@ +{ + "success": true, + "errors": [], + "messages": [], + "result": "off" +} \ No newline at end of file diff --git a/tests/Fixtures/Endpoints/getHTTPSRewritesSetting.json b/tests/Fixtures/Endpoints/getHTTPSRewritesSetting.json new file mode 100644 index 0000000..878457d --- /dev/null +++ b/tests/Fixtures/Endpoints/getHTTPSRewritesSetting.json @@ -0,0 +1,6 @@ +{ + "success": true, + "errors": [], + "messages": [], + "result": "off" +} \ No newline at end of file diff --git a/tests/Fixtures/Endpoints/getOnionRoutingSetting.json b/tests/Fixtures/Endpoints/getOnionRoutingSetting.json new file mode 100644 index 0000000..878457d --- /dev/null +++ b/tests/Fixtures/Endpoints/getOnionRoutingSetting.json @@ -0,0 +1,6 @@ +{ + "success": true, + "errors": [], + "messages": [], + "result": "off" +} \ No newline at end of file diff --git a/tests/Fixtures/Endpoints/getOpportunisticEncryptionSetting.json b/tests/Fixtures/Endpoints/getOpportunisticEncryptionSetting.json new file mode 100644 index 0000000..b5df0a4 --- /dev/null +++ b/tests/Fixtures/Endpoints/getOpportunisticEncryptionSetting.json @@ -0,0 +1,11 @@ +{ + "success": true, + "errors": [], + "messages": [], + "result": { + "id": "opportunistic_encryption", + "value": "off", + "editable": true, + "modified_on": "2014-01-01T05:20:00.12345Z" + } +} \ No newline at end of file diff --git a/tests/Fixtures/Endpoints/getSSLSetting.json b/tests/Fixtures/Endpoints/getSSLSetting.json new file mode 100644 index 0000000..43fa3ee --- /dev/null +++ b/tests/Fixtures/Endpoints/getSSLSetting.json @@ -0,0 +1,11 @@ +{ + "success": true, + "errors": [], + "messages": [], + "result": { + "id": "ssl", + "value": "off", + "editable": true, + "modified_on": "2014-01-01T05:20:00.12345Z" + } +} \ No newline at end of file diff --git a/tests/Fixtures/Endpoints/getSSLVerificationStatus.json b/tests/Fixtures/Endpoints/getSSLVerificationStatus.json new file mode 100644 index 0000000..5e2a4f3 --- /dev/null +++ b/tests/Fixtures/Endpoints/getSSLVerificationStatus.json @@ -0,0 +1,16 @@ +{ + "result": [ + { + "certificate_status": "active", + "verification_type": "cname", + "verification_status": true, + "verification_info": { + "record_name": "b3b90cfedd89a3e487d3e383c56c4267.example.com", + "record_target": "6979be7e4cfc9e5c603e31df7efac9cc60fee82d.comodoca.com" + }, + "brand_check": false, + "validation_method": "txt", + "cert_pack_uuid": "a77f8bd7-3b47-46b4-a6f1-75cf98109948" + } + ] +} \ No newline at end of file diff --git a/tests/Fixtures/Endpoints/getTLSClientAuth.json b/tests/Fixtures/Endpoints/getTLSClientAuth.json new file mode 100644 index 0000000..fac9fa5 --- /dev/null +++ b/tests/Fixtures/Endpoints/getTLSClientAuth.json @@ -0,0 +1,11 @@ +{ + "success": true, + "errors": [], + "messages": [], + "result": { + "id": "tls_client_auth", + "value": "off", + "editable": true, + "modified_on": "2014-01-01T05:20:00.12345Z" + } +} \ No newline at end of file diff --git a/tests/Fixtures/Endpoints/updateHTTPSRedirectSetting.json b/tests/Fixtures/Endpoints/updateHTTPSRedirectSetting.json new file mode 100644 index 0000000..878457d --- /dev/null +++ b/tests/Fixtures/Endpoints/updateHTTPSRedirectSetting.json @@ -0,0 +1,6 @@ +{ + "success": true, + "errors": [], + "messages": [], + "result": "off" +} \ No newline at end of file diff --git a/tests/Fixtures/Endpoints/updateHTTPSRewritesSetting.json b/tests/Fixtures/Endpoints/updateHTTPSRewritesSetting.json new file mode 100644 index 0000000..878457d --- /dev/null +++ b/tests/Fixtures/Endpoints/updateHTTPSRewritesSetting.json @@ -0,0 +1,6 @@ +{ + "success": true, + "errors": [], + "messages": [], + "result": "off" +} \ No newline at end of file diff --git a/tests/Fixtures/Endpoints/updateOnionRoutingSetting.json b/tests/Fixtures/Endpoints/updateOnionRoutingSetting.json new file mode 100644 index 0000000..878457d --- /dev/null +++ b/tests/Fixtures/Endpoints/updateOnionRoutingSetting.json @@ -0,0 +1,6 @@ +{ + "success": true, + "errors": [], + "messages": [], + "result": "off" +} \ No newline at end of file diff --git a/tests/Fixtures/Endpoints/updateOpportunisticEncryptionSetting.json b/tests/Fixtures/Endpoints/updateOpportunisticEncryptionSetting.json new file mode 100644 index 0000000..e8077c9 --- /dev/null +++ b/tests/Fixtures/Endpoints/updateOpportunisticEncryptionSetting.json @@ -0,0 +1,11 @@ +{ + "success": true, + "errors": [], + "messages": [], + "result": { + "id": "opportunistic_encryption", + "value": "on", + "editable": true, + "modified_on": "2014-01-01T05:20:00.12345Z" + } +} \ No newline at end of file diff --git a/tests/Fixtures/Endpoints/updateSSLSetting.json b/tests/Fixtures/Endpoints/updateSSLSetting.json new file mode 100644 index 0000000..43fa3ee --- /dev/null +++ b/tests/Fixtures/Endpoints/updateSSLSetting.json @@ -0,0 +1,11 @@ +{ + "success": true, + "errors": [], + "messages": [], + "result": { + "id": "ssl", + "value": "off", + "editable": true, + "modified_on": "2014-01-01T05:20:00.12345Z" + } +} \ No newline at end of file diff --git a/tests/Fixtures/Endpoints/updateTLSClientAuth.json b/tests/Fixtures/Endpoints/updateTLSClientAuth.json new file mode 100644 index 0000000..fac9fa5 --- /dev/null +++ b/tests/Fixtures/Endpoints/updateTLSClientAuth.json @@ -0,0 +1,11 @@ +{ + "success": true, + "errors": [], + "messages": [], + "result": { + "id": "tls_client_auth", + "value": "off", + "editable": true, + "modified_on": "2014-01-01T05:20:00.12345Z" + } +} \ No newline at end of file