Changeset 2638204
- Timestamp:
- 12/01/2021 06:04:32 PM (4 years ago)
- Location:
- 2fas/trunk
- Files:
-
- 4 deleted
- 24 edited
-
changelog.txt (modified) (1 diff)
-
config.php (modified) (1 diff)
-
constants.php (modified) (1 diff)
-
dependencies/authentication.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
routes.php (modified) (2 diffs)
-
src/Authentication/Authenticator.php (modified) (6 diffs)
-
src/Authentication/Handler/Configuration_Reset.php (modified) (3 diffs)
-
src/Authentication/Handler/Mobile_Login.php (deleted)
-
src/Authentication/Middleware/Login_Template.php (modified) (2 diffs)
-
src/Codes/QR_Code_Message.php (modified) (3 diffs)
-
src/Helpers/Login_Response.php (modified) (1 diff)
-
src/Http/Controllers/Ajax/Channel_Controller.php (deleted)
-
src/Http/Controllers/User/TOTP_Configuration_Controller.php (modified) (15 diffs)
-
src/Integration/API_Wrapper.php (modified) (4 diffs)
-
src/Integration/Integration_User.php (modified) (3 diffs)
-
templates/login/totp_authentication_page.html.twig (modified) (1 diff)
-
twofas.php (modified) (1 diff)
-
vendor/composer/autoload_classmap.php (modified) (3 diffs)
-
vendor/composer/autoload_static.php (modified) (3 diffs)
-
vendor/composer/installed.json (modified) (3 diffs)
-
vendor/composer/installed.php (modified) (3 diffs)
-
vendor/sentry/sentry/Makefile (deleted)
-
vendor/twofas/sdk/Upgrade.md (modified) (1 diff)
-
vendor/twofas/sdk/src/Hydrator.php (modified) (1 diff)
-
vendor/twofas/sdk/src/IntegrationUser.php (modified) (4 diffs)
-
vendor/twofas/sdk/src/MobileSecretGenerator.php (deleted)
-
vendor/twofas/sdk/src/Sdk.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
2fas/trunk/changelog.txt
r2615458 r2638204 1 1 == Changelog == 2 3 = 3.2.0 (Dec.1, 2021) = 4 * Removed push notifications 2 5 3 6 = 3.1.0 (Oct. 17, 2021) = -
2fas/trunk/config.php
r1974165 r2638204 5 5 'account_url' => 'https://account.2fas.com', 6 6 'dashboard_url' => 'https://dashboard.2fas.com', 7 'pusher_key' => '9e2d2476a82fec3240c6',8 7 'readme_url' => 'https://plugins.svn.wordpress.org/2fas/trunk/readme.txt', 9 8 'sentry_dsn' => 'https://84e107f106ea4d58be2efc8107be1ea0@sentry.io/1298202', -
2fas/trunk/constants.php
r2615458 r2638204 15 15 define( 'TWOFAS_TEMPLATES_PATH', $templates_path ); 16 16 define( 'TWOFAS_WP_ADMIN_PATH', $admin_url ); 17 define( 'TWOFAS_PLUGIN_VERSION', '3. 1.0' );17 define( 'TWOFAS_PLUGIN_VERSION', '3.2.0' ); 18 18 define( 'TWOFAS_DEPRECATE_PHP_OLDER_THAN', '5.6' ); -
2fas/trunk/dependencies/authentication.php
r2343404 r2638204 7 7 use TwoFAS\TwoFAS\Authentication\Handler\Configuration_Reset; 8 8 use TwoFAS\TwoFAS\Authentication\Handler\Login_Configuration; 9 use TwoFAS\TwoFAS\Authentication\Handler\Mobile_Login;10 9 use TwoFAS\TwoFAS\Authentication\Handler\Standard_Login; 11 10 use TwoFAS\TwoFAS\Authentication\Login_Process; … … 56 55 ->add_handler( $c->get(Configuration_Reset::class) ) 57 56 ->add_handler( $c->get(Configuration_Confirmation::class) ) 58 ->add_handler( $c->get(Mobile_Login::class) )59 57 ->add_handler( $c->get(Standard_Login::class) ); 60 58 -
2fas/trunk/readme.txt
r2615458 r2638204 132 132 == Changelog == 133 133 134 = 3.2.0 (Dec. 1, 2021) = 135 * Removed push notifications 136 134 137 = 3.1.0 (Oct. 17, 2021) = 135 138 * Add deprecation info -
2fas/trunk/routes.php
r2551311 r2638204 10 10 use TwoFAS\TwoFAS\Http\Controllers\User\Trusted_Devices_Controller; 11 11 use TwoFAS\TwoFAS\Http\Controllers\User\Modal_Controller; 12 use TwoFAS\TwoFAS\Http\Controllers\Ajax\Channel_Controller;13 12 use TwoFAS\TwoFAS\Http\Controllers\Ajax\Deactivation_Controller; 14 13 … … 251 250 ], 252 251 Action_Index::SUBMENU_AJAX => [ 253 Action_Index::ACTION_AUTHENTICATE_CHANNEL => [254 'controller' => Channel_Controller::class,255 'action' => 'authenticate',256 'method' => [ 'POST' ],257 'middleware' => [ 'account_exists' ]258 ],259 252 Action_Index::ACTION_SEND_DEACTIVATION_REASON => [ 260 253 'controller' => Deactivation_Controller::class, -
2fas/trunk/src/Authentication/Authenticator.php
r2343404 r2638204 4 4 5 5 use TwoFAS\Account\OAuth\TokenNotFoundException; 6 use TwoFAS\Api\Authentication;7 6 use TwoFAS\Api\Exception\Exception as API_Exception; 8 7 use TwoFAS\Api\IntegrationUser; … … 10 9 use TwoFAS\TwoFAS\Exceptions\Authentication_Limit_Reached_Exception; 11 10 use TwoFAS\TwoFAS\Exceptions\User_Not_Found_Exception; 12 use TwoFAS\TwoFAS\Hooks\Authenticate_Filter;13 11 use TwoFAS\Core\Http\Request; 14 use TwoFAS\TwoFAS\Http\Session;15 12 use TwoFAS\TwoFAS\Integration\API_Wrapper; 16 use TwoFAS\TwoFAS\Randomization\Hash;17 13 use TwoFAS\TwoFAS\Storage\Authentication_Storage; 18 14 use TwoFAS\TwoFAS\Storage\Storage; 19 15 use TwoFAS\TwoFAS\Storage\User_Storage; 20 use WhichBrowser\Parser;21 16 22 17 class Authenticator { … … 38 33 */ 39 34 private $authentication_storage; 40 41 /**42 * @var Parser43 */44 private $browser;45 46 /**47 * @var Session48 */49 private $session;50 35 51 36 /** … … 57 42 * @param API_Wrapper $api_wrapper 58 43 * @param Storage $storage 59 * @param Parser $browser60 * @param Session $session61 44 * @param Request $request 62 45 */ 63 public function __construct( API_Wrapper $api_wrapper, Storage $storage, Parser $browser, Session $session,Request $request ) {46 public function __construct( API_Wrapper $api_wrapper, Storage $storage, Request $request ) { 64 47 $this->api_wrapper = $api_wrapper; 65 48 $this->user_storage = $storage->get_user_storage(); 66 49 $this->authentication_storage = $storage->get_authentication_storage(); 67 $this->browser = $browser;68 $this->session = $session;69 50 $this->request = $request; 70 51 } … … 215 196 */ 216 197 private function open_totp_authentication( IntegrationUser $integration_user ) { 217 if ( $integration_user->hasMobileUser() ) { 218 $authentication = $this->open_totp_authentication_with_mobile_support( $integration_user ); 219 } else { 220 $authentication = $this->api_wrapper->request_auth_via_totp( $integration_user->getTotpSecret() ); 221 } 198 $authentication = $this->api_wrapper->request_auth_via_totp( $integration_user->getTotpSecret() ); 222 199 223 200 $this->authentication_storage->open_authentication( $this->user_storage->get_user_id(), $authentication ); 224 }225 226 /**227 * @param IntegrationUser $integration_user228 *229 * @return Authentication230 *231 * @throws TokenNotFoundException232 * @throws API_Exception233 */234 private function open_totp_authentication_with_mobile_support( IntegrationUser $integration_user ) {235 return $this->api_wrapper->request_auth_via_totp_with_mobile_support(236 $integration_user->getTotpSecret(),237 $integration_user->getPushId(),238 $this->get_pusher_session_id(),239 $this->get_browser_version()240 );241 }242 243 /**244 * @return string245 */246 private function get_pusher_session_id() {247 $pusher_session_id = $this->session->get( Authenticate_Filter::PUSHER_SESSION_ID_KEY );248 249 if ( is_null( $pusher_session_id ) ) {250 $pusher_session_id = Hash::get_pusher_session_id();251 $this->session->set( Authenticate_Filter::PUSHER_SESSION_ID_KEY, $pusher_session_id );252 }253 254 return $pusher_session_id;255 201 } 256 202 … … 278 224 $this->authentication_storage->open_authentication( $this->user_storage->get_user_id(), $authentication ); 279 225 } 280 281 /**282 * @return string283 */284 private function get_browser_version() {285 return $this->browser->browser->toString() . ' on ' . $this->browser->os->toString();286 }287 226 } -
2fas/trunk/src/Authentication/Handler/Configuration_Reset.php
r2343404 r2638204 5 5 use TwoFAS\Account\OAuth\TokenNotFoundException; 6 6 use TwoFAS\Api\Exception\Exception as API_Exception; 7 use TwoFAS\Api\MobileSecretGenerator;8 7 use TwoFAS\Api\QrCodeGenerator; 9 8 use TwoFAS\Api\TotpSecretGenerator; … … 150 149 } else { 151 150 $this->integration_user->set_totp_secret( null ); 152 $this->integration_user->set_push_id( MobileSecretGenerator::generate() );153 151 $this->api_wrapper->update_integration_user( $this->integration_user->get_user() ); 154 152 } … … 157 155 $this->trusted_devices_storage->delete_trusted_devices( $user_id ); 158 156 $this->session->set( Authenticate_Filter::LOGIN_CONFIGURATION_IN_PROGRESS_KEY, '1' ); 159 $message = $this->qr_code_message->create( $totp_secret , $this->integration_user->get_push_id());157 $message = $this->qr_code_message->create( $totp_secret ); 160 158 $qr_code = $this->qr_code_generator->generateBase64( $message ); 161 159 -
2fas/trunk/src/Authentication/Middleware/Login_Template.php
r2343404 r2638204 115 115 public function handle( $user, $response = null ) { 116 116 try { 117 $user_storage = $this->storage->get_user_storage(); 118 $oauth_storage = $this->storage->get_oauth(); 117 $user_storage = $this->storage->get_user_storage(); 119 118 120 119 if ( $response instanceof JSON_Response || ! $user_storage->is_wp_user_set() ) { … … 136 135 $this->login_response->set_from_integration_user( $this->integration_user->get_user() ); 137 136 $this->login_response->set_from_storage( $this->storage ); 138 139 if ( $this->integration_user->has_mobile_user() ) {140 $integration_id = $oauth_storage->get_integration_id();141 $this->login_response->set( 'integration_id', $integration_id );142 $session_id = $this->session->get( Authenticate_Filter::PUSHER_SESSION_ID_KEY );143 $this->login_response->set( Authenticate_Filter::PUSHER_SESSION_ID_KEY, $session_id );144 }145 146 137 $this->login_response->set( 'actions', $this->login_actions ); 147 138 -
2fas/trunk/src/Codes/QR_Code_Message.php
r2356137 r2638204 40 40 /** 41 41 * @param string $totp_secret 42 * @param string $push_id43 42 * 44 43 * @return string … … 46 45 * @throws User_Not_Found_Exception 47 46 */ 48 public function create( $totp_secret , $push_id) {49 $query = $this->build_query( $totp_secret , $push_id);47 public function create( $totp_secret ) { 48 $query = $this->build_query( $totp_secret ); 50 49 $email = $this->user_storage->get_email(); 51 50 $description = $this->get_description(); … … 56 55 /** 57 56 * @param string $totp_secret 58 * @param string $push_id59 57 * 60 58 * @return string 61 59 */ 62 private function build_query( $totp_secret , $push_id) {60 private function build_query( $totp_secret ) { 63 61 return build_query( [ 64 62 'secret' => $totp_secret, 65 'issuer' => $this->get_issuer(), 66 'mobile_secret' => $push_id, 63 'issuer' => $this->get_issuer() 67 64 ] ); 68 65 } -
2fas/trunk/src/Helpers/Login_Response.php
r2343404 r2638204 83 83 84 84 $this->set( 'offline_codes_count', $integration_user->getBackupCodesCount() ); 85 $this->set( 'has_mobile_user', $integration_user->hasMobileUser() );86 85 87 86 if ( ! is_null( $phone_number ) ) { -
2fas/trunk/src/Http/Controllers/User/TOTP_Configuration_Controller.php
r2343404 r2638204 10 10 use TwoFAS\Api\Exception\ValidationException; 11 11 use TwoFAS\Api\IntegrationUser; 12 use TwoFAS\Api\MobileSecretGenerator;13 12 use TwoFAS\Api\TotpSecretGenerator; 14 13 use TwoFAS\Core\Http\JSON_Response; … … 25 24 use TwoFAS\TwoFAS\Http\Action_URL; 26 25 use TwoFAS\Core\Http\Request; 27 use TwoFAS\TwoFAS\Http\Session;28 26 use TwoFAS\TwoFAS\Integration\API_Wrapper; 29 27 use TwoFAS\TwoFAS\Integration\Integration_User; … … 36 34 37 35 /** 38 * @var Session39 */40 private $session;41 42 /**43 36 * @var QR_Code_Message 44 37 */ … … 50 43 * @param Integration_User $integration_user 51 44 * @param Flash $flash 52 * @param Session $session53 45 * @param QR_Code_Message $qr_code_message 54 46 * @param Legacy_Mode_Checker $legacy_mode_checker … … 59 51 Integration_User $integration_user, 60 52 Flash $flash, 61 Session $session,62 53 QR_Code_Message $qr_code_message, 63 54 Legacy_Mode_Checker $legacy_mode_checker … … 65 56 parent::__construct( $storage, $api_wrapper, $integration_user, $flash, $legacy_mode_checker ); 66 57 67 $this->session = $session;68 58 $this->qr_code_message = $qr_code_message; 69 59 } … … 72 62 * @param Request $request 73 63 * 74 * @return string64 * @return View_Response|Redirect_Response 75 65 * 76 66 * @throws AuthorizationException … … 187 177 188 178 $user = $this->get_integration_user(); 189 $this->api_wrapper->update_integration_user( $user->setTotpSecret( null ) ->setPushId( null ));179 $this->api_wrapper->update_integration_user( $user->setTotpSecret( null ) ); 190 180 $user_storage->remove_totp(); 191 181 … … 214 204 * 215 205 * @return JSON_Response 216 *217 * @throws TokenNotFoundException218 * @throws API_Exception219 206 */ 220 207 public function reload( Request $request ) { … … 226 213 } 227 214 228 $push_id = $this->get_integration_user()->getPushId();229 215 $totp_secret = TotpSecretGenerator::generate(); 230 $message = $this->get_qr_code_message( $totp_secret , $push_id);216 $message = $this->get_qr_code_message( $totp_secret ); 231 217 $response = []; 232 218 $response['qrCode'] = $this->get_qr_code( $message ); … … 258 244 } 259 245 260 $push_id = $user->getPushId(); 261 $qr_code_message = $this->get_qr_code_message( $totp_secret, $push_id ); 246 $qr_code_message = $this->get_qr_code_message( $totp_secret ); 262 247 $qr_code = $this->get_qr_code( $qr_code_message ); 263 248 $status_data = $this->get_user_status_data(); … … 295 280 } 296 281 297 $this->check_push_id( $this->integration_user->get_user() );298 299 282 return $this->integration_user->get_user(); 300 283 } … … 316 299 317 300 /** 318 * @param IntegrationUser $integration_user319 *320 * @throws TokenNotFoundException321 * @throws ValidationException322 * @throws AuthorizationException323 * @throws API_Exception324 */325 private function check_push_id( IntegrationUser $integration_user ) {326 $push_id = $integration_user->getPushId();327 328 if ( empty( $push_id ) ) {329 $integration_user->setPushId( MobileSecretGenerator::generate() );330 $this->api_wrapper->update_integration_user( $integration_user );331 }332 }333 334 /**335 301 * @param string $message 336 302 * … … 345 311 /** 346 312 * @param string $totp_secret 347 * @param string $push_id348 313 * 349 314 * @return string … … 351 316 * @throws User_Not_Found_Exception 352 317 */ 353 private function get_qr_code_message( $totp_secret , $push_id) {354 return $this->qr_code_message->create( $totp_secret , $push_id);318 private function get_qr_code_message( $totp_secret ) { 319 return $this->qr_code_message->create( $totp_secret ); 355 320 } 356 321 } -
2fas/trunk/src/Integration/API_Wrapper.php
r2594222 r2638204 26 26 use TwoFAS\Api\Exception\ValidationException as API_Validation_Exception; 27 27 use TwoFAS\Api\IntegrationUser; 28 use TwoFAS\Api\MobileSecretGenerator;29 28 use TwoFAS\Api\Sdk as API; 30 29 use TwoFAS\TwoFAS\Factories\Account_Factory; … … 228 227 $integration_user = new IntegrationUser(); 229 228 $integration_user->setExternalId( (string) $user_id ); 230 $integration_user->setPushId( MobileSecretGenerator::generate() );231 229 232 230 return $this->api()->addIntegrationUser( $this->options_storage, $integration_user ); … … 280 278 281 279 /** 282 * @param string $totp_secret283 * @param string $push_id284 * @param string $session_id285 * @param string $browser_version286 *287 * @return Authentication288 *289 * @throws TokenNotFoundException290 * @throws API_Authorization_Exception291 * @throws InvalidDateException292 * @throws API_Validation_Exception293 * @throws API_Exception294 */295 public function request_auth_via_totp_with_mobile_support( $totp_secret, $push_id, $session_id, $browser_version ) {296 return $this->api()->requestAuthViaTotpWithMobileSupport( $totp_secret, $push_id, $session_id, $browser_version );297 }298 299 /**300 280 * @param string $phone_number 301 281 * … … 364 344 365 345 /** 366 * @param string $integration_id367 * @param string $session_id368 * @param string $socket_id369 *370 * @return array371 *372 * @throws TokenNotFoundException373 * @throws API_Authorization_Exception374 * @throws API_Validation_Exception375 * @throws API_Exception376 */377 public function authenticate_channel( $integration_id, $session_id, $socket_id ) {378 return $this->api()->authenticateChannel( $integration_id, $session_id, $socket_id );379 }380 381 /**382 * @param string $channel_name383 * @param int $status_id384 * @param string $status385 *386 * @throws TokenNotFoundException387 * @throws API_Authorization_Exception388 * @throws API_Validation_Exception389 * @throws InvalidArgumentException390 * @throws API_Exception391 */392 public function update_channel_status( $channel_name, $status_id, $status ) {393 $this->api()->updateChannelStatus( $channel_name, $status_id, $status );394 }395 396 /**397 346 * @param IntegrationUser $integration_user 398 347 * -
2fas/trunk/src/Integration/Integration_User.php
r2343404 r2638204 213 213 214 214 /** 215 * @return null|string216 *217 * @throws TokenNotFoundException218 * @throws API_Exception219 * @throws AuthorizationException220 */221 public function get_push_id() {222 $this->initialize();223 224 return $this->integration_user->getPushId();225 }226 227 /**228 * @param null|string $push_id229 *230 * @return Integration_User231 *232 * @throws TokenNotFoundException233 * @throws API_Exception234 * @throws AuthorizationException235 */236 public function set_push_id( $push_id ) {237 $this->initialize();238 239 $this->integration_user->setPushId( $push_id );240 241 return $this;242 }243 244 /**245 215 * @return int 246 216 * … … 268 238 269 239 $this->integration_user->setBackupCodesCount( $backup_codes_count ); 270 271 return $this;272 }273 274 /**275 * @return bool276 *277 * @throws TokenNotFoundException278 * @throws API_Exception279 * @throws AuthorizationException280 */281 public function has_mobile_user() {282 $this->initialize();283 284 return $this->integration_user->hasMobileUser();285 }286 287 /**288 * @param bool $has_mobile_user289 *290 * @return Integration_User291 *292 * @throws TokenNotFoundException293 * @throws API_Exception294 * @throws AuthorizationException295 */296 public function set_has_mobile_user( $has_mobile_user ) {297 $this->initialize();298 299 $this->integration_user->setHasMobileUser( $has_mobile_user );300 240 301 241 return $this; … … 328 268 ->set_id( $integration_user->getId() ) 329 269 ->set_external_id( $integration_user->getExternalId() ) 330 ->set_push_id( $integration_user->getPushId() )331 270 ->set_totp_secret( $integration_user->getTotpSecret() ) 332 271 ->set_email( $integration_user->getEmail() ) 333 272 ->set_phone_number( $integration_user->getPhoneNumber()->phoneNumber() ) 334 ->set_backup_codes_count( ! is_null( $integration_user->getBackupCodesCount() ) ? $integration_user->getBackupCodesCount() : 0 ) 335 ->set_has_mobile_user( is_bool( $integration_user->hasMobileUser() ? $integration_user->hasMobileUser() : false ) ); 273 ->set_backup_codes_count( ! is_null( $integration_user->getBackupCodesCount() ) ? $integration_user->getBackupCodesCount() : 0 ); 336 274 } 337 275 -
2fas/trunk/templates/login/totp_authentication_page.html.twig
r2470780 r2638204 37 37 <input type="hidden" name="twofas_action" value="{{ actions['verify_totp_code'] }}"/> 38 38 </div> 39 40 {% if has_mobile_user %}41 <input type="hidden" id="pusher-session-id" name="pusher_session_id" value="{{ pusher_session_id }}"/>42 <input type="hidden" id="integration-id" name="integration_id" value="{{ integration_id }}"/>43 <input type="hidden" id="status-id" name="status_id" value=""/>44 <input type="hidden" id="totp-token" name="totp_token" value=""/>45 46 <div class="twofas-sockets">47 <i class="twofas-icon twofas-icon-tokens"></i>48 <div class="twofas-token-setup twofas-play">49 <div class="twofas-loading-dot"></div>50 <div class="twofas-loading-dot"></div>51 <div class="twofas-loading-dot"></div>52 <div class="twofas-loading-dot"></div>53 <div class="twofas-loading-dot"></div>54 <div class="twofas-loading-dot"></div>55 </div>56 <div class="twofas-token-loading">57 <div class="twofas-loading-dot"></div>58 <div class="twofas-loading-dot"></div>59 <div class="twofas-loading-dot"></div>60 <div class="twofas-loading-dot"></div>61 <div class="twofas-loading-dot"></div>62 <div class="twofas-loading-dot"></div>63 </div>64 <div class="twofas-token-error">65 <div class="twofas-error-dot"></div>66 <div class="twofas-error-dot"></div>67 <div class="twofas-error-dot"></div>68 <div class="twofas-error-dot"></div>69 <div class="twofas-error-dot"></div>70 <div class="twofas-error-dot"></div>71 </div>72 <div class="twofas-sockets-error twofas-tooltip" data-tooltip="Logging in via Push notifications is blocked by your Adblocker">73 <i class="twofas-icon twofas-icon-info"></i>74 <i class="twofas-icon twofas-icon-remove"></i>75 </div>76 <i class="twofas-icon twofas-icon-padlock"></i>77 </div>78 {% endif %}79 39 80 40 <div class="twofas-submit"> -
2fas/trunk/twofas.php
r2615458 r2638204 4 4 * Plugin URI: https://wordpress.org/plugins/2fas/ 5 5 * Description: 2FAS strengthens WordPress admin security by requiring an additional verification code on untrusted devices. 6 * Version: 3. 1.06 * Version: 3.2.0 7 7 * Author: Two Factor Authentication Service Inc. 8 8 * Author URI: https://2fas.com -
2fas/trunk/vendor/composer/autoload_classmap.php
r2551311 r2638204 554 554 'TwoFAS\\Api\\IntegrationUser' => $vendorDir . '/twofas/sdk/src/IntegrationUser.php', 555 555 'TwoFAS\\Api\\Methods' => $vendorDir . '/twofas/sdk/src/Methods.php', 556 'TwoFAS\\Api\\MobileSecretGenerator' => $vendorDir . '/twofas/sdk/src/MobileSecretGenerator.php',557 556 'TwoFAS\\Api\\QrCodeGenerator' => $vendorDir . '/twofas/sdk/src/QrCodeGenerator.php', 558 557 'TwoFAS\\Api\\QrCode\\EndroidQrClient' => $vendorDir . '/twofas/sdk/src/QrCode/EndroidQrClient.php', … … 642 641 'TwoFAS\\TwoFAS\\Authentication\\Handler\\Login_Configuration' => $baseDir . '/src/Authentication/Handler/Login_Configuration.php', 643 642 'TwoFAS\\TwoFAS\\Authentication\\Handler\\Login_Handler' => $baseDir . '/src/Authentication/Handler/Login_Handler.php', 644 'TwoFAS\\TwoFAS\\Authentication\\Handler\\Mobile_Login' => $baseDir . '/src/Authentication/Handler/Mobile_Login.php',645 643 'TwoFAS\\TwoFAS\\Authentication\\Handler\\Standard_Login' => $baseDir . '/src/Authentication/Handler/Standard_Login.php', 646 644 'TwoFAS\\TwoFAS\\Authentication\\Login_Action' => $baseDir . '/src/Authentication/Login_Action.php', … … 726 724 'TwoFAS\\TwoFAS\\Http\\Controllers\\Admin\\Dashboard_Controller' => $baseDir . '/src/Http/Controllers/Admin/Dashboard_Controller.php', 727 725 'TwoFAS\\TwoFAS\\Http\\Controllers\\Admin\\Settings_Controller' => $baseDir . '/src/Http/Controllers/Admin/Settings_Controller.php', 728 'TwoFAS\\TwoFAS\\Http\\Controllers\\Ajax\\Channel_Controller' => $baseDir . '/src/Http/Controllers/Ajax/Channel_Controller.php',729 726 'TwoFAS\\TwoFAS\\Http\\Controllers\\Ajax\\Deactivation_Controller' => $baseDir . '/src/Http/Controllers/Ajax/Deactivation_Controller.php', 730 727 'TwoFAS\\TwoFAS\\Http\\Controllers\\Controller' => $baseDir . '/src/Http/Controllers/Controller.php', -
2fas/trunk/vendor/composer/autoload_static.php
r2615458 r2638204 686 686 'TwoFAS\\Api\\IntegrationUser' => __DIR__ . '/..' . '/twofas/sdk/src/IntegrationUser.php', 687 687 'TwoFAS\\Api\\Methods' => __DIR__ . '/..' . '/twofas/sdk/src/Methods.php', 688 'TwoFAS\\Api\\MobileSecretGenerator' => __DIR__ . '/..' . '/twofas/sdk/src/MobileSecretGenerator.php',689 688 'TwoFAS\\Api\\QrCodeGenerator' => __DIR__ . '/..' . '/twofas/sdk/src/QrCodeGenerator.php', 690 689 'TwoFAS\\Api\\QrCode\\EndroidQrClient' => __DIR__ . '/..' . '/twofas/sdk/src/QrCode/EndroidQrClient.php', … … 774 773 'TwoFAS\\TwoFAS\\Authentication\\Handler\\Login_Configuration' => __DIR__ . '/../..' . '/src/Authentication/Handler/Login_Configuration.php', 775 774 'TwoFAS\\TwoFAS\\Authentication\\Handler\\Login_Handler' => __DIR__ . '/../..' . '/src/Authentication/Handler/Login_Handler.php', 776 'TwoFAS\\TwoFAS\\Authentication\\Handler\\Mobile_Login' => __DIR__ . '/../..' . '/src/Authentication/Handler/Mobile_Login.php',777 775 'TwoFAS\\TwoFAS\\Authentication\\Handler\\Standard_Login' => __DIR__ . '/../..' . '/src/Authentication/Handler/Standard_Login.php', 778 776 'TwoFAS\\TwoFAS\\Authentication\\Login_Action' => __DIR__ . '/../..' . '/src/Authentication/Login_Action.php', … … 858 856 'TwoFAS\\TwoFAS\\Http\\Controllers\\Admin\\Dashboard_Controller' => __DIR__ . '/../..' . '/src/Http/Controllers/Admin/Dashboard_Controller.php', 859 857 'TwoFAS\\TwoFAS\\Http\\Controllers\\Admin\\Settings_Controller' => __DIR__ . '/../..' . '/src/Http/Controllers/Admin/Settings_Controller.php', 860 'TwoFAS\\TwoFAS\\Http\\Controllers\\Ajax\\Channel_Controller' => __DIR__ . '/../..' . '/src/Http/Controllers/Ajax/Channel_Controller.php',861 858 'TwoFAS\\TwoFAS\\Http\\Controllers\\Ajax\\Deactivation_Controller' => __DIR__ . '/../..' . '/src/Http/Controllers/Ajax/Deactivation_Controller.php', 862 859 'TwoFAS\\TwoFAS\\Http\\Controllers\\Controller' => __DIR__ . '/../..' . '/src/Http/Controllers/Controller.php', -
2fas/trunk/vendor/composer/installed.json
r2615458 r2638204 707 707 { 708 708 "name": "twofas/sdk", 709 "version": "v 7.2.0",710 "version_normalized": " 7.2.0.0",709 "version": "v8.0.0", 710 "version_normalized": "8.0.0.0", 711 711 "source": { 712 712 "type": "git", 713 713 "url": "https://github.com/twofas/sdk.git", 714 "reference": "d 6a689aa8479e4f2d6a6a923e6e4c84fae25d829"715 }, 716 "dist": { 717 "type": "zip", 718 "url": "https://api.github.com/repos/twofas/sdk/zipball/d 6a689aa8479e4f2d6a6a923e6e4c84fae25d829",719 "reference": "d 6a689aa8479e4f2d6a6a923e6e4c84fae25d829",714 "reference": "d9a3cdab8586e25be543fe93dcc806f78057c324" 715 }, 716 "dist": { 717 "type": "zip", 718 "url": "https://api.github.com/repos/twofas/sdk/zipball/d9a3cdab8586e25be543fe93dcc806f78057c324", 719 "reference": "d9a3cdab8586e25be543fe93dcc806f78057c324", 720 720 "shasum": "" 721 721 }, … … 733 733 "squizlabs/php_codesniffer": "^2.2" 734 734 }, 735 "time": "202 0-03-13T08:55:30+00:00",735 "time": "2021-09-17T09:16:05+00:00", 736 736 "type": "library", 737 737 "installation-source": "dist", … … 758 758 "support": { 759 759 "issues": "https://github.com/twofas/sdk/issues", 760 "source": "https://github.com/twofas/sdk/tree/v 7.2.0"760 "source": "https://github.com/twofas/sdk/tree/v8.0.0" 761 761 }, 762 762 "install-path": "../twofas/sdk" -
2fas/trunk/vendor/composer/installed.php
r2615458 r2638204 6 6 'install_path' => __DIR__ . '/../../', 7 7 'aliases' => array(), 8 'reference' => ' 17280cee06f939f62f07096cacf0a8c383eaf79a',8 'reference' => '870d1388a49d3007ed311a8dd76ace45b323aec1', 9 9 'name' => 'twofas/twofas-wp-plugin', 10 10 'dev' => false, … … 138 138 ), 139 139 'twofas/sdk' => array( 140 'pretty_version' => 'v 7.2.0',141 'version' => ' 7.2.0.0',140 'pretty_version' => 'v8.0.0', 141 'version' => '8.0.0.0', 142 142 'type' => 'library', 143 143 'install_path' => __DIR__ . '/../twofas/sdk', 144 144 'aliases' => array(), 145 'reference' => 'd 6a689aa8479e4f2d6a6a923e6e4c84fae25d829',145 'reference' => 'd9a3cdab8586e25be543fe93dcc806f78057c324', 146 146 'dev_requirement' => false, 147 147 ), … … 152 152 'install_path' => __DIR__ . '/../../', 153 153 'aliases' => array(), 154 'reference' => ' 17280cee06f939f62f07096cacf0a8c383eaf79a',154 'reference' => '870d1388a49d3007ed311a8dd76ace45b323aec1', 155 155 'dev_requirement' => false, 156 156 ), -
2fas/trunk/vendor/twofas/sdk/Upgrade.md
r2299241 r2638204 1 1 # Upgrade 2 3 ### 7.2.0 > 8.0.0 4 5 #### requestAuthViaTotpWithMobileSupport 6 Method has been removed 7 8 #### authenticateChannel 9 Method has been removed 10 11 #### updateChannelStatus 12 Method has been removed 13 14 #### IntegrationUser 15 Field 'push_id' has been removed. 16 Field 'has_mobile_user' has been removed. 2 17 3 18 ### 6.0.0 > 7.0.0 -
2fas/trunk/vendor/twofas/sdk/src/Hydrator.php
r2343404 r2638204 24 24 ->setId($data['id']) 25 25 ->setExternalId($data['external_id']) 26 ->setPushId($data['push_id'])27 26 ->setBackupCodesCount($data['backup_codes_count']) 28 ->setHasMobileUser($data['has_mobile_user'])29 27 ->setPhoneNumber($cryptographer->decrypt($data['phone_number'])) 30 28 ->setEmail($cryptographer->decrypt($data['email'])) -
2fas/trunk/vendor/twofas/sdk/src/IntegrationUser.php
r2343404 r2638204 39 39 40 40 /** 41 * @var null|string42 */43 private $pushId;44 45 /**46 41 * @var int 47 42 */ 48 43 private $backupCodesCount; 49 50 /**51 * @var bool52 */53 private $hasMobileUser;54 44 55 45 /** … … 171 161 172 162 /** 173 * @return null|string174 */175 public function getPushId()176 {177 return $this->pushId;178 }179 180 /**181 * @param null|string $pushId182 *183 * @return IntegrationUser184 */185 public function setPushId($pushId)186 {187 if (null === $pushId || '' === $pushId) {188 $this->pushId = null;189 return $this;190 }191 $this->pushId = (string) $pushId;192 return $this;193 }194 195 /**196 * @deprecated197 *198 * @return null|string199 */200 public function getMobileSecret()201 {202 return $this->getPushId();203 }204 205 /**206 * @deprecated207 *208 * @param null|string $mobileSecret209 *210 * @return IntegrationUser211 */212 public function setMobileSecret($mobileSecret)213 {214 return $this->setPushId($mobileSecret);215 }216 217 /**218 163 * @return int 219 164 */ … … 235 180 236 181 $this->backupCodesCount = $backupCodesCount; 237 return $this;238 }239 240 /**241 * @return bool242 */243 public function hasMobileUser()244 {245 return $this->hasMobileUser;246 }247 248 /**249 * @param bool $hasMobileUser250 *251 * @return $this252 */253 public function setHasMobileUser($hasMobileUser)254 {255 if (!is_bool($hasMobileUser)) {256 throw new InvalidArgumentException('Has Mobile User should be a boolean');257 }258 259 $this->hasMobileUser = $hasMobileUser;260 182 return $this; 261 183 } … … 271 193 'id' => $this->id, 272 194 'external_id' => $this->externalId, 273 'push_id' => $this->pushId,274 195 'phone_number' => $cryptographer->encrypt($this->getPhoneNumber()->phoneNumber()), 275 196 'email' => $cryptographer->encrypt($this->getEmail()), -
2fas/trunk/vendor/twofas/sdk/src/Sdk.php
r2343404 r2638204 35 35 * @var string 36 36 */ 37 const VERSION = ' 7.2.0';37 const VERSION = '8.0.0'; 38 38 39 39 /** … … 303 303 304 304 /** 305 * @param string $secret306 * @param string $pushId307 * @param string $sessionId308 * @param string $browserVersion309 *310 * @return Authentication311 *312 * @throws AuthorizationException313 * @throws InvalidDateException314 * @throws ValidationException315 * @throws Exception316 */317 public function requestAuthViaTotpWithMobileSupport($secret, $pushId, $sessionId, $browserVersion)318 {319 $response = $this->call(320 'POST',321 $this->createEndpoint('v3/auth/totp/mobile'),322 [323 'totp_secret' => (string) $secret,324 'push_id' => (string) $pushId,325 'session_id' => (string) $sessionId,326 'browser_version' => (string) $browserVersion,327 ]328 );329 330 if ($response->matchesHttpCode(HttpCodes::CREATED)) {331 return $this->hydrator->getAuthenticationFromResponse($response);332 }333 334 throw $response->getError();335 }336 337 /**338 305 * Used for validating code entered by user. 339 306 * … … 423 390 424 391 /** 425 * @param int $integrationId426 * @param string $sessionId427 * @param string $socketId428 *429 * @return array430 *431 * @throws AuthorizationException432 * @throws ValidationException433 * @throws Exception434 */435 public function authenticateChannel($integrationId, $sessionId, $socketId)436 {437 $channelName = 'private-wp_' . $integrationId . '_' . $sessionId;438 439 $response = $this->call(440 'POST',441 $this->createEndpoint('v2/integration/authenticate_channel'),442 [443 'channel_name' => (string) $channelName,444 'socket_id' => (string) $socketId445 ]446 );447 448 if ($response->matchesHttpCode(HttpCodes::OK)) {449 return $response->getData();450 }451 452 throw $response->getError();453 }454 455 /**456 * @param string $channelName457 * @param int $statusId458 * @param string $status459 *460 * @return array461 *462 * @throws AuthorizationException463 * @throws InvalidArgumentException464 * @throws ValidationException465 * @throws Exception466 */467 public function updateChannelStatus($channelName, $statusId, $status)468 {469 if (!in_array($status, ChannelStatuses::getAllowedStatuses())) {470 throw new InvalidArgumentException('Channel status is not valid.');471 }472 473 $response = $this->call(474 'POST',475 $this->createEndpoint('v2/integration/channel/' . $channelName . '/status/' . $statusId),476 [477 'status' => (string) $status478 ]479 );480 481 if ($response->matchesHttpCode(HttpCodes::OK)) {482 return $response->getData();483 }484 485 throw $response->getError();486 }487 488 /**489 392 * Used for getting paginated list of integration users from 2fas. 490 393 *
Note: See TracChangeset
for help on using the changeset viewer.