Plugin Directory

Changeset 2638204


Ignore:
Timestamp:
12/01/2021 06:04:32 PM (4 years ago)
Author:
2fas
Message:

Release v3.2.0

Location:
2fas/trunk
Files:
4 deleted
24 edited

Legend:

Unmodified
Added
Removed
  • 2fas/trunk/changelog.txt

    r2615458 r2638204  
    11== Changelog ==
     2
     3= 3.2.0 (Dec.1, 2021) =
     4* Removed push notifications
    25
    36= 3.1.0 (Oct. 17, 2021) =
  • 2fas/trunk/config.php

    r1974165 r2638204  
    55    'account_url'      => 'https://account.2fas.com',
    66    'dashboard_url'    => 'https://dashboard.2fas.com',
    7     'pusher_key'       => '9e2d2476a82fec3240c6',
    87    'readme_url'       => 'https://plugins.svn.wordpress.org/2fas/trunk/readme.txt',
    98    'sentry_dsn'       => 'https://84e107f106ea4d58be2efc8107be1ea0@sentry.io/1298202',
  • 2fas/trunk/constants.php

    r2615458 r2638204  
    1515define( 'TWOFAS_TEMPLATES_PATH', $templates_path );
    1616define( 'TWOFAS_WP_ADMIN_PATH', $admin_url );
    17 define( 'TWOFAS_PLUGIN_VERSION', '3.1.0' );
     17define( 'TWOFAS_PLUGIN_VERSION', '3.2.0' );
    1818define( 'TWOFAS_DEPRECATE_PHP_OLDER_THAN', '5.6' );
  • 2fas/trunk/dependencies/authentication.php

    r2343404 r2638204  
    77use TwoFAS\TwoFAS\Authentication\Handler\Configuration_Reset;
    88use TwoFAS\TwoFAS\Authentication\Handler\Login_Configuration;
    9 use TwoFAS\TwoFAS\Authentication\Handler\Mobile_Login;
    109use TwoFAS\TwoFAS\Authentication\Handler\Standard_Login;
    1110use TwoFAS\TwoFAS\Authentication\Login_Process;
     
    5655            ->add_handler( $c->get(Configuration_Reset::class) )
    5756            ->add_handler( $c->get(Configuration_Confirmation::class) )
    58             ->add_handler( $c->get(Mobile_Login::class) )
    5957            ->add_handler( $c->get(Standard_Login::class) );
    6058
  • 2fas/trunk/readme.txt

    r2615458 r2638204  
    132132== Changelog ==
    133133
     134= 3.2.0 (Dec. 1, 2021) =
     135* Removed push notifications
     136
    134137= 3.1.0 (Oct. 17, 2021) =
    135138* Add deprecation info
  • 2fas/trunk/routes.php

    r2551311 r2638204  
    1010use TwoFAS\TwoFAS\Http\Controllers\User\Trusted_Devices_Controller;
    1111use TwoFAS\TwoFAS\Http\Controllers\User\Modal_Controller;
    12 use TwoFAS\TwoFAS\Http\Controllers\Ajax\Channel_Controller;
    1312use TwoFAS\TwoFAS\Http\Controllers\Ajax\Deactivation_Controller;
    1413
     
    251250        ],
    252251        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             ],
    259252            Action_Index::ACTION_SEND_DEACTIVATION_REASON => [
    260253                'controller' => Deactivation_Controller::class,
  • 2fas/trunk/src/Authentication/Authenticator.php

    r2343404 r2638204  
    44
    55use TwoFAS\Account\OAuth\TokenNotFoundException;
    6 use TwoFAS\Api\Authentication;
    76use TwoFAS\Api\Exception\Exception as API_Exception;
    87use TwoFAS\Api\IntegrationUser;
     
    109use TwoFAS\TwoFAS\Exceptions\Authentication_Limit_Reached_Exception;
    1110use TwoFAS\TwoFAS\Exceptions\User_Not_Found_Exception;
    12 use TwoFAS\TwoFAS\Hooks\Authenticate_Filter;
    1311use TwoFAS\Core\Http\Request;
    14 use TwoFAS\TwoFAS\Http\Session;
    1512use TwoFAS\TwoFAS\Integration\API_Wrapper;
    16 use TwoFAS\TwoFAS\Randomization\Hash;
    1713use TwoFAS\TwoFAS\Storage\Authentication_Storage;
    1814use TwoFAS\TwoFAS\Storage\Storage;
    1915use TwoFAS\TwoFAS\Storage\User_Storage;
    20 use WhichBrowser\Parser;
    2116
    2217class Authenticator {
     
    3833     */
    3934    private $authentication_storage;
    40 
    41     /**
    42      * @var Parser
    43      */
    44     private $browser;
    45 
    46     /**
    47      * @var Session
    48      */
    49     private $session;
    5035
    5136    /**
     
    5742     * @param API_Wrapper $api_wrapper
    5843     * @param Storage     $storage
    59      * @param Parser      $browser
    60      * @param Session     $session
    6144     * @param Request     $request
    6245     */
    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 ) {
    6447        $this->api_wrapper            = $api_wrapper;
    6548        $this->user_storage           = $storage->get_user_storage();
    6649        $this->authentication_storage = $storage->get_authentication_storage();
    67         $this->browser                = $browser;
    68         $this->session                = $session;
    6950        $this->request                = $request;
    7051    }
     
    215196     */
    216197    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() );
    222199
    223200        $this->authentication_storage->open_authentication( $this->user_storage->get_user_id(), $authentication );
    224     }
    225 
    226     /**
    227      * @param IntegrationUser $integration_user
    228      *
    229      * @return Authentication
    230      *
    231      * @throws TokenNotFoundException
    232      * @throws API_Exception
    233      */
    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 string
    245      */
    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;
    255201    }
    256202
     
    278224        $this->authentication_storage->open_authentication( $this->user_storage->get_user_id(), $authentication );
    279225    }
    280 
    281     /**
    282      * @return string
    283      */
    284     private function get_browser_version() {
    285         return $this->browser->browser->toString() . ' on ' . $this->browser->os->toString();
    286     }
    287226}
  • 2fas/trunk/src/Authentication/Handler/Configuration_Reset.php

    r2343404 r2638204  
    55use TwoFAS\Account\OAuth\TokenNotFoundException;
    66use TwoFAS\Api\Exception\Exception as API_Exception;
    7 use TwoFAS\Api\MobileSecretGenerator;
    87use TwoFAS\Api\QrCodeGenerator;
    98use TwoFAS\Api\TotpSecretGenerator;
     
    150149        } else {
    151150            $this->integration_user->set_totp_secret( null );
    152             $this->integration_user->set_push_id( MobileSecretGenerator::generate() );
    153151            $this->api_wrapper->update_integration_user( $this->integration_user->get_user() );
    154152        }
     
    157155        $this->trusted_devices_storage->delete_trusted_devices( $user_id );
    158156        $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 );
    160158        $qr_code = $this->qr_code_generator->generateBase64( $message );
    161159
  • 2fas/trunk/src/Authentication/Middleware/Login_Template.php

    r2343404 r2638204  
    115115    public function handle( $user, $response = null ) {
    116116        try {
    117             $user_storage    = $this->storage->get_user_storage();
    118             $oauth_storage   = $this->storage->get_oauth();
     117            $user_storage = $this->storage->get_user_storage();
    119118
    120119            if ( $response instanceof JSON_Response || ! $user_storage->is_wp_user_set() ) {
     
    136135            $this->login_response->set_from_integration_user( $this->integration_user->get_user() );
    137136            $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 
    146137            $this->login_response->set( 'actions', $this->login_actions );
    147138
  • 2fas/trunk/src/Codes/QR_Code_Message.php

    r2356137 r2638204  
    4040    /**
    4141     * @param string $totp_secret
    42      * @param string $push_id
    4342     *
    4443     * @return string
     
    4645     * @throws User_Not_Found_Exception
    4746     */
    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 );
    5049        $email       = $this->user_storage->get_email();
    5150        $description = $this->get_description();
     
    5655    /**
    5756     * @param string $totp_secret
    58      * @param string $push_id
    5957     *
    6058     * @return string
    6159     */
    62     private function build_query( $totp_secret, $push_id ) {
     60    private function build_query( $totp_secret ) {
    6361        return build_query( [
    6462            'secret'        => $totp_secret,
    65             'issuer'        => $this->get_issuer(),
    66             'mobile_secret' => $push_id,
     63            'issuer'        => $this->get_issuer()
    6764        ] );
    6865    }
  • 2fas/trunk/src/Helpers/Login_Response.php

    r2343404 r2638204  
    8383
    8484        $this->set( 'offline_codes_count', $integration_user->getBackupCodesCount() );
    85         $this->set( 'has_mobile_user', $integration_user->hasMobileUser() );
    8685
    8786        if ( ! is_null( $phone_number ) ) {
  • 2fas/trunk/src/Http/Controllers/User/TOTP_Configuration_Controller.php

    r2343404 r2638204  
    1010use TwoFAS\Api\Exception\ValidationException;
    1111use TwoFAS\Api\IntegrationUser;
    12 use TwoFAS\Api\MobileSecretGenerator;
    1312use TwoFAS\Api\TotpSecretGenerator;
    1413use TwoFAS\Core\Http\JSON_Response;
     
    2524use TwoFAS\TwoFAS\Http\Action_URL;
    2625use TwoFAS\Core\Http\Request;
    27 use TwoFAS\TwoFAS\Http\Session;
    2826use TwoFAS\TwoFAS\Integration\API_Wrapper;
    2927use TwoFAS\TwoFAS\Integration\Integration_User;
     
    3634
    3735    /**
    38      * @var Session
    39      */
    40     private $session;
    41 
    42     /**
    4336     * @var QR_Code_Message
    4437     */
     
    5043     * @param Integration_User    $integration_user
    5144     * @param Flash               $flash
    52      * @param Session             $session
    5345     * @param QR_Code_Message     $qr_code_message
    5446     * @param Legacy_Mode_Checker $legacy_mode_checker
     
    5951        Integration_User $integration_user,
    6052        Flash $flash,
    61         Session $session,
    6253        QR_Code_Message $qr_code_message,
    6354        Legacy_Mode_Checker $legacy_mode_checker
     
    6556        parent::__construct( $storage, $api_wrapper, $integration_user, $flash, $legacy_mode_checker );
    6657
    67         $this->session         = $session;
    6858        $this->qr_code_message = $qr_code_message;
    6959    }
     
    7262     * @param Request $request
    7363     *
    74      * @return string
     64     * @return View_Response|Redirect_Response
    7565     *
    7666     * @throws AuthorizationException
     
    187177
    188178            $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 ) );
    190180            $user_storage->remove_totp();
    191181
     
    214204     *
    215205     * @return JSON_Response
    216      *
    217      * @throws TokenNotFoundException
    218      * @throws API_Exception
    219206     */
    220207    public function reload( Request $request ) {
     
    226213            }
    227214
    228             $push_id                   = $this->get_integration_user()->getPushId();
    229215            $totp_secret               = TotpSecretGenerator::generate();
    230             $message                   = $this->get_qr_code_message( $totp_secret, $push_id );
     216            $message                   = $this->get_qr_code_message( $totp_secret );
    231217            $response                  = [];
    232218            $response['qrCode']        = $this->get_qr_code( $message );
     
    258244            }
    259245
    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 );
    262247            $qr_code         = $this->get_qr_code( $qr_code_message );
    263248            $status_data     = $this->get_user_status_data();
     
    295280        }
    296281
    297         $this->check_push_id( $this->integration_user->get_user() );
    298 
    299282        return $this->integration_user->get_user();
    300283    }
     
    316299
    317300    /**
    318      * @param IntegrationUser $integration_user
    319      *
    320      * @throws TokenNotFoundException
    321      * @throws ValidationException
    322      * @throws AuthorizationException
    323      * @throws API_Exception
    324      */
    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     /**
    335301     * @param string $message
    336302     *
     
    345311    /**
    346312     * @param string $totp_secret
    347      * @param string $push_id
    348313     *
    349314     * @return string
     
    351316     * @throws User_Not_Found_Exception
    352317     */
    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 );
    355320    }
    356321}
  • 2fas/trunk/src/Integration/API_Wrapper.php

    r2594222 r2638204  
    2626use TwoFAS\Api\Exception\ValidationException as API_Validation_Exception;
    2727use TwoFAS\Api\IntegrationUser;
    28 use TwoFAS\Api\MobileSecretGenerator;
    2928use TwoFAS\Api\Sdk as API;
    3029use TwoFAS\TwoFAS\Factories\Account_Factory;
     
    228227        $integration_user = new IntegrationUser();
    229228        $integration_user->setExternalId( (string) $user_id );
    230         $integration_user->setPushId( MobileSecretGenerator::generate() );
    231229
    232230        return $this->api()->addIntegrationUser( $this->options_storage, $integration_user );
     
    280278
    281279    /**
    282      * @param string $totp_secret
    283      * @param string $push_id
    284      * @param string $session_id
    285      * @param string $browser_version
    286      *
    287      * @return Authentication
    288      *
    289      * @throws TokenNotFoundException
    290      * @throws API_Authorization_Exception
    291      * @throws InvalidDateException
    292      * @throws API_Validation_Exception
    293      * @throws API_Exception
    294      */
    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     /**
    300280     * @param string $phone_number
    301281     *
     
    364344
    365345    /**
    366      * @param string $integration_id
    367      * @param string $session_id
    368      * @param string $socket_id
    369      *
    370      * @return array
    371      *
    372      * @throws TokenNotFoundException
    373      * @throws API_Authorization_Exception
    374      * @throws API_Validation_Exception
    375      * @throws API_Exception
    376      */
    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_name
    383      * @param int    $status_id
    384      * @param string $status
    385      *
    386      * @throws TokenNotFoundException
    387      * @throws API_Authorization_Exception
    388      * @throws API_Validation_Exception
    389      * @throws InvalidArgumentException
    390      * @throws API_Exception
    391      */
    392     public function update_channel_status( $channel_name, $status_id, $status ) {
    393         $this->api()->updateChannelStatus( $channel_name, $status_id, $status );
    394     }
    395 
    396     /**
    397346     * @param IntegrationUser $integration_user
    398347     *
  • 2fas/trunk/src/Integration/Integration_User.php

    r2343404 r2638204  
    213213
    214214    /**
    215      * @return null|string
    216      *
    217      * @throws TokenNotFoundException
    218      * @throws API_Exception
    219      * @throws AuthorizationException
    220      */
    221     public function get_push_id() {
    222         $this->initialize();
    223 
    224         return $this->integration_user->getPushId();
    225     }
    226 
    227     /**
    228      * @param null|string $push_id
    229      *
    230      * @return Integration_User
    231      *
    232      * @throws TokenNotFoundException
    233      * @throws API_Exception
    234      * @throws AuthorizationException
    235      */
    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     /**
    245215     * @return int
    246216     *
     
    268238
    269239        $this->integration_user->setBackupCodesCount( $backup_codes_count );
    270 
    271         return $this;
    272     }
    273 
    274     /**
    275      * @return bool
    276      *
    277      * @throws TokenNotFoundException
    278      * @throws API_Exception
    279      * @throws AuthorizationException
    280      */
    281     public function has_mobile_user() {
    282         $this->initialize();
    283 
    284         return $this->integration_user->hasMobileUser();
    285     }
    286 
    287     /**
    288      * @param bool $has_mobile_user
    289      *
    290      * @return Integration_User
    291      *
    292      * @throws TokenNotFoundException
    293      * @throws API_Exception
    294      * @throws AuthorizationException
    295      */
    296     public function set_has_mobile_user( $has_mobile_user ) {
    297         $this->initialize();
    298 
    299         $this->integration_user->setHasMobileUser( $has_mobile_user );
    300240
    301241        return $this;
     
    328268            ->set_id( $integration_user->getId() )
    329269            ->set_external_id( $integration_user->getExternalId() )
    330             ->set_push_id( $integration_user->getPushId() )
    331270            ->set_totp_secret( $integration_user->getTotpSecret() )
    332271            ->set_email( $integration_user->getEmail() )
    333272            ->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 );
    336274    }
    337275
  • 2fas/trunk/templates/login/totp_authentication_page.html.twig

    r2470780 r2638204  
    3737            <input type="hidden" name="twofas_action" value="{{ actions['verify_totp_code'] }}"/>
    3838        </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 %}
    7939
    8040        <div class="twofas-submit">
  • 2fas/trunk/twofas.php

    r2615458 r2638204  
    44 * Plugin URI:  https://wordpress.org/plugins/2fas/
    55 * Description: 2FAS strengthens WordPress admin security by requiring an additional verification code on untrusted devices.
    6  * Version:     3.1.0
     6 * Version:     3.2.0
    77 * Author:      Two Factor Authentication Service Inc.
    88 * Author URI:  https://2fas.com
  • 2fas/trunk/vendor/composer/autoload_classmap.php

    r2551311 r2638204  
    554554    'TwoFAS\\Api\\IntegrationUser' => $vendorDir . '/twofas/sdk/src/IntegrationUser.php',
    555555    'TwoFAS\\Api\\Methods' => $vendorDir . '/twofas/sdk/src/Methods.php',
    556     'TwoFAS\\Api\\MobileSecretGenerator' => $vendorDir . '/twofas/sdk/src/MobileSecretGenerator.php',
    557556    'TwoFAS\\Api\\QrCodeGenerator' => $vendorDir . '/twofas/sdk/src/QrCodeGenerator.php',
    558557    'TwoFAS\\Api\\QrCode\\EndroidQrClient' => $vendorDir . '/twofas/sdk/src/QrCode/EndroidQrClient.php',
     
    642641    'TwoFAS\\TwoFAS\\Authentication\\Handler\\Login_Configuration' => $baseDir . '/src/Authentication/Handler/Login_Configuration.php',
    643642    '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',
    645643    'TwoFAS\\TwoFAS\\Authentication\\Handler\\Standard_Login' => $baseDir . '/src/Authentication/Handler/Standard_Login.php',
    646644    'TwoFAS\\TwoFAS\\Authentication\\Login_Action' => $baseDir . '/src/Authentication/Login_Action.php',
     
    726724    'TwoFAS\\TwoFAS\\Http\\Controllers\\Admin\\Dashboard_Controller' => $baseDir . '/src/Http/Controllers/Admin/Dashboard_Controller.php',
    727725    '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',
    729726    'TwoFAS\\TwoFAS\\Http\\Controllers\\Ajax\\Deactivation_Controller' => $baseDir . '/src/Http/Controllers/Ajax/Deactivation_Controller.php',
    730727    'TwoFAS\\TwoFAS\\Http\\Controllers\\Controller' => $baseDir . '/src/Http/Controllers/Controller.php',
  • 2fas/trunk/vendor/composer/autoload_static.php

    r2615458 r2638204  
    686686        'TwoFAS\\Api\\IntegrationUser' => __DIR__ . '/..' . '/twofas/sdk/src/IntegrationUser.php',
    687687        'TwoFAS\\Api\\Methods' => __DIR__ . '/..' . '/twofas/sdk/src/Methods.php',
    688         'TwoFAS\\Api\\MobileSecretGenerator' => __DIR__ . '/..' . '/twofas/sdk/src/MobileSecretGenerator.php',
    689688        'TwoFAS\\Api\\QrCodeGenerator' => __DIR__ . '/..' . '/twofas/sdk/src/QrCodeGenerator.php',
    690689        'TwoFAS\\Api\\QrCode\\EndroidQrClient' => __DIR__ . '/..' . '/twofas/sdk/src/QrCode/EndroidQrClient.php',
     
    774773        'TwoFAS\\TwoFAS\\Authentication\\Handler\\Login_Configuration' => __DIR__ . '/../..' . '/src/Authentication/Handler/Login_Configuration.php',
    775774        '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',
    777775        'TwoFAS\\TwoFAS\\Authentication\\Handler\\Standard_Login' => __DIR__ . '/../..' . '/src/Authentication/Handler/Standard_Login.php',
    778776        'TwoFAS\\TwoFAS\\Authentication\\Login_Action' => __DIR__ . '/../..' . '/src/Authentication/Login_Action.php',
     
    858856        'TwoFAS\\TwoFAS\\Http\\Controllers\\Admin\\Dashboard_Controller' => __DIR__ . '/../..' . '/src/Http/Controllers/Admin/Dashboard_Controller.php',
    859857        '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',
    861858        'TwoFAS\\TwoFAS\\Http\\Controllers\\Ajax\\Deactivation_Controller' => __DIR__ . '/../..' . '/src/Http/Controllers/Ajax/Deactivation_Controller.php',
    862859        'TwoFAS\\TwoFAS\\Http\\Controllers\\Controller' => __DIR__ . '/../..' . '/src/Http/Controllers/Controller.php',
  • 2fas/trunk/vendor/composer/installed.json

    r2615458 r2638204  
    707707        {
    708708            "name": "twofas/sdk",
    709             "version": "v7.2.0",
    710             "version_normalized": "7.2.0.0",
     709            "version": "v8.0.0",
     710            "version_normalized": "8.0.0.0",
    711711            "source": {
    712712                "type": "git",
    713713                "url": "https://github.com/twofas/sdk.git",
    714                 "reference": "d6a689aa8479e4f2d6a6a923e6e4c84fae25d829"
    715             },
    716             "dist": {
    717                 "type": "zip",
    718                 "url": "https://api.github.com/repos/twofas/sdk/zipball/d6a689aa8479e4f2d6a6a923e6e4c84fae25d829",
    719                 "reference": "d6a689aa8479e4f2d6a6a923e6e4c84fae25d829",
     714                "reference": "d9a3cdab8586e25be543fe93dcc806f78057c324"
     715            },
     716            "dist": {
     717                "type": "zip",
     718                "url": "https://api.github.com/repos/twofas/sdk/zipball/d9a3cdab8586e25be543fe93dcc806f78057c324",
     719                "reference": "d9a3cdab8586e25be543fe93dcc806f78057c324",
    720720                "shasum": ""
    721721            },
     
    733733                "squizlabs/php_codesniffer": "^2.2"
    734734            },
    735             "time": "2020-03-13T08:55:30+00:00",
     735            "time": "2021-09-17T09:16:05+00:00",
    736736            "type": "library",
    737737            "installation-source": "dist",
     
    758758            "support": {
    759759                "issues": "https://github.com/twofas/sdk/issues",
    760                 "source": "https://github.com/twofas/sdk/tree/v7.2.0"
     760                "source": "https://github.com/twofas/sdk/tree/v8.0.0"
    761761            },
    762762            "install-path": "../twofas/sdk"
  • 2fas/trunk/vendor/composer/installed.php

    r2615458 r2638204  
    66        'install_path' => __DIR__ . '/../../',
    77        'aliases' => array(),
    8         'reference' => '17280cee06f939f62f07096cacf0a8c383eaf79a',
     8        'reference' => '870d1388a49d3007ed311a8dd76ace45b323aec1',
    99        'name' => 'twofas/twofas-wp-plugin',
    1010        'dev' => false,
     
    138138        ),
    139139        'twofas/sdk' => array(
    140             'pretty_version' => 'v7.2.0',
    141             'version' => '7.2.0.0',
     140            'pretty_version' => 'v8.0.0',
     141            'version' => '8.0.0.0',
    142142            'type' => 'library',
    143143            'install_path' => __DIR__ . '/../twofas/sdk',
    144144            'aliases' => array(),
    145             'reference' => 'd6a689aa8479e4f2d6a6a923e6e4c84fae25d829',
     145            'reference' => 'd9a3cdab8586e25be543fe93dcc806f78057c324',
    146146            'dev_requirement' => false,
    147147        ),
     
    152152            'install_path' => __DIR__ . '/../../',
    153153            'aliases' => array(),
    154             'reference' => '17280cee06f939f62f07096cacf0a8c383eaf79a',
     154            'reference' => '870d1388a49d3007ed311a8dd76ace45b323aec1',
    155155            'dev_requirement' => false,
    156156        ),
  • 2fas/trunk/vendor/twofas/sdk/Upgrade.md

    r2299241 r2638204  
    11# Upgrade
     2
     3### 7.2.0 > 8.0.0
     4
     5#### requestAuthViaTotpWithMobileSupport
     6Method has been removed
     7
     8#### authenticateChannel
     9Method has been removed
     10
     11#### updateChannelStatus
     12Method has been removed
     13
     14#### IntegrationUser
     15Field 'push_id' has been removed.
     16Field 'has_mobile_user' has been removed.
    217
    318### 6.0.0 > 7.0.0
  • 2fas/trunk/vendor/twofas/sdk/src/Hydrator.php

    r2343404 r2638204  
    2424            ->setId($data['id'])
    2525            ->setExternalId($data['external_id'])
    26             ->setPushId($data['push_id'])
    2726            ->setBackupCodesCount($data['backup_codes_count'])
    28             ->setHasMobileUser($data['has_mobile_user'])
    2927            ->setPhoneNumber($cryptographer->decrypt($data['phone_number']))
    3028            ->setEmail($cryptographer->decrypt($data['email']))
  • 2fas/trunk/vendor/twofas/sdk/src/IntegrationUser.php

    r2343404 r2638204  
    3939
    4040    /**
    41      * @var null|string
    42      */
    43     private $pushId;
    44 
    45     /**
    4641     * @var int
    4742     */
    4843    private $backupCodesCount;
    49 
    50     /**
    51      * @var bool
    52      */
    53     private $hasMobileUser;
    5444
    5545    /**
     
    171161
    172162    /**
    173      * @return null|string
    174      */
    175     public function getPushId()
    176     {
    177         return $this->pushId;
    178     }
    179 
    180     /**
    181      * @param null|string $pushId
    182      *
    183      * @return IntegrationUser
    184      */
    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      * @deprecated
    197      *
    198      * @return null|string
    199      */
    200     public function getMobileSecret()
    201     {
    202         return $this->getPushId();
    203     }
    204 
    205     /**
    206      * @deprecated
    207      *
    208      * @param null|string $mobileSecret
    209      *
    210      * @return IntegrationUser
    211      */
    212     public function setMobileSecret($mobileSecret)
    213     {
    214         return $this->setPushId($mobileSecret);
    215     }
    216 
    217     /**
    218163     * @return int
    219164     */
     
    235180
    236181        $this->backupCodesCount = $backupCodesCount;
    237         return $this;
    238     }
    239 
    240     /**
    241      * @return bool
    242      */
    243     public function hasMobileUser()
    244     {
    245         return $this->hasMobileUser;
    246     }
    247 
    248     /**
    249      * @param bool $hasMobileUser
    250      *
    251      * @return $this
    252      */
    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;
    260182        return $this;
    261183    }
     
    271193            'id'           => $this->id,
    272194            'external_id'  => $this->externalId,
    273             'push_id'      => $this->pushId,
    274195            'phone_number' => $cryptographer->encrypt($this->getPhoneNumber()->phoneNumber()),
    275196            'email'        => $cryptographer->encrypt($this->getEmail()),
  • 2fas/trunk/vendor/twofas/sdk/src/Sdk.php

    r2343404 r2638204  
    3535     * @var string
    3636     */
    37     const VERSION = '7.2.0';
     37    const VERSION = '8.0.0';
    3838
    3939    /**
     
    303303
    304304    /**
    305      * @param string $secret
    306      * @param string $pushId
    307      * @param string $sessionId
    308      * @param string $browserVersion
    309      *
    310      * @return Authentication
    311      *
    312      * @throws AuthorizationException
    313      * @throws InvalidDateException
    314      * @throws ValidationException
    315      * @throws Exception
    316      */
    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     /**
    338305     * Used for validating code entered by user.
    339306     *
     
    423390
    424391    /**
    425      * @param int    $integrationId
    426      * @param string $sessionId
    427      * @param string $socketId
    428      *
    429      * @return array
    430      *
    431      * @throws AuthorizationException
    432      * @throws ValidationException
    433      * @throws Exception
    434      */
    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) $socketId
    445             ]
    446         );
    447 
    448         if ($response->matchesHttpCode(HttpCodes::OK)) {
    449             return $response->getData();
    450         }
    451 
    452         throw $response->getError();
    453     }
    454 
    455     /**
    456      * @param string $channelName
    457      * @param int    $statusId
    458      * @param string $status
    459      *
    460      * @return array
    461      *
    462      * @throws AuthorizationException
    463      * @throws InvalidArgumentException
    464      * @throws ValidationException
    465      * @throws Exception
    466      */
    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) $status
    478             ]
    479         );
    480 
    481         if ($response->matchesHttpCode(HttpCodes::OK)) {
    482             return $response->getData();
    483         }
    484 
    485         throw $response->getError();
    486     }
    487 
    488     /**
    489392     * Used for getting paginated list of integration users from 2fas.
    490393     *
Note: See TracChangeset for help on using the changeset viewer.