-
Notifications
You must be signed in to change notification settings - Fork 19
feature/secure-mode-support #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
c6dd2f1
a011f8f
5dd1dcd
db96f98
e6036b8
0af8c10
9f3eb1e
40b61ff
fcea02f
128eb19
82e9e79
aee2922
6312dbc
2cd1008
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| 'use-strict'; | ||
|
|
||
| module.exports = { | ||
| 'root': true, | ||
| 'env': { | ||
| 'browser': true, | ||
| 'jquery': true | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -35,6 +35,7 @@ public static function setupBeforeClass(): void { | |||||||||
|
|
||||||||||
| public function setup(): void { | ||||||||||
| self::$web->login(); | ||||||||||
| self::$web->goto_privacy_options(); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| public static function tearDownAfterClass(): void { | ||||||||||
|
|
@@ -60,6 +61,7 @@ public function should_have_data_on_visitor_object_if_logged_in(): void { | |||||||||
| $this->assertNotEmpty( $visitor_data ); | ||||||||||
| $this->assertEquals( self::$admin_name, $visitor_data['name'] ); | ||||||||||
| $this->assertEquals( self::$admin_email, $visitor_data['email'] ); | ||||||||||
| $this->assertArrayNotHasKey( 'hash', $visitor_data ); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| /** | ||||||||||
|
|
@@ -76,4 +78,27 @@ public function should_not_have_data_on_visitor_object_if_not_logged_in(): void | |||||||||
|
|
||||||||||
| $this->assertEmpty( $visitor_data ); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * @test | ||||||||||
| * @group privacy_options | ||||||||||
| */ | ||||||||||
| public function should_have_hash_on_visitor_object_if_logged_in_and_api_key_provided(): void { | ||||||||||
| self::$web->toggle_switch( '#enable-visitor-recognition', true ); | ||||||||||
| self::$driver->find_element_and_input( '#js-api-key', str_repeat( 'a', 40 ) ); | ||||||||||
|
|
||||||||||
| self::$driver->move_mouse_to( '#submit-header' )->click(); | ||||||||||
| self::$driver->wait_for_seconds( 1 ); | ||||||||||
|
||||||||||
| self::$driver->move_mouse_to( '#submit-header' )->click(); | |
| self::$driver->wait_for_seconds( 1 ); | |
| self::$driver->move_mouse_to('#submit-header')->click(); | |
| self::$driver->wait_until_element_is_located('#setting-error-settings_updated'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error handling for openssl_encrypt failures.
The encryption method needs additional error handling:
Apply this diff to improve error handling:
private static function get_encrypted_data( $data ) { + if (!extension_loaded('openssl')) { + throw new Exception('OpenSSL extension is not loaded'); + } + + if (!in_array(self::CIPHER, openssl_get_cipher_methods())) { + throw new Exception('Cipher method not supported'); + } + if ( ! defined( 'SECURE_AUTH_KEY' ) ) { throw new Exception( 'SECURE_AUTH_KEY is not defined' ); }📝 Committable suggestion