[ Index ]

PHP Cross Reference of YOURLS

title

Body

[close]

/tests/tests/auth/ -> login_secure_time.php (source)

   1  <?php
   2  
   3  require_once ( 'login_base.php' );
   4  
   5  /**
   6   * Login tests - API + "secure passwordless" and a time limited token
   7   *
   8   * @group auth
   9   * @group login
  10   * @since 0.1
  11   */
  12  class Auth_Login_API_Secure_TimeToken_Tests extends Login_Base {
  13  
  14      public static function setUpBeforeClass(): void {
  15          yourls_add_filter( 'is_API', 'yourls_return_true' );
  16          $_REQUEST['timestamp'] = time();
  17          $_REQUEST['signature'] = md5( yourls_auth_signature( 'yourls' ) . time() );
  18          /* Attempt login with valid signature & timestamp. Tests with invalid signatures are made directly
  19           *  against the check function, not in a full login procedure. See auth.php
  20           */
  21      }
  22  
  23      public static function tearDownAfterClass(): void {
  24          yourls_remove_filter( 'is_API', 'yourls_return_true' );
  25          unset( $_REQUEST['timestamp'] );
  26          unset( $_REQUEST['signature'] );
  27      }
  28  
  29  }


Generated: Tue Sep 27 05:10:01 2022 Cross-referenced by PHPXref 0.7.1