← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1621200] Re: password created_at does not honor timezones

 

Due to the fact that the created_at column was created in the Newton
milestone 3 release it is best to fix this time sensitive attribute in
the same release. Let's create an rc2 milestone and backport the fix.

** Summary changed:

- MySQLOpportunisticIdentityDriverTestCase.test_change_password fails in UTC+N timezone
+ password created_at does not honor timezones

** Description changed:

+ This was initially discovered when running the unit tests for migration
+ 002 in a timezone that is UTC+3.
+ 
  Migration 002 sets the password created_at column to a TIMESTAMP type
  with a server_default=sql.func.now(). There are a couple problems
  that have been uncovered with this change:
  * We cannot guarantee that func.now() will generate a UTC timestamp.
  * For some older versions of MySQL, the TIMESTAMP column will
  automatically be updated when other columns are updated:
  https://dev.mysql.com/doc/refman/5.5/en/timestamp-initialization.html
  
  Steps to reproduce:
  1. dpkg-reconfigure tzdata and select there Europe/Moscow (UTC+3).
  2. Restart mysql
  3. Configure opportunistic tests with the following command in mysql:
  GRANT ALL PRIVILEGES ON *.* TO 'openstack_citest' @'%' identified by 'openstack_citest' WITH GRANT OPTION;
  4. Run keystone.tests.unit.identity.backends.test_sql.MySQLOpportunisticIdentityDriverTestCase.test_change_password
  
  Expected result: test pass
  
  Actual result:
      Traceback (most recent call last):
        File "keystone/tests/unit/identity/backends/test_base.py", line 255, in test_change_password
          self.driver.authenticate(user['id'], new_password)
        File "keystone/identity/backends/sql.py", line 65, in authenticate
          raise AssertionError(_('Invalid user / password'))
      AssertionError: Invalid user / password
+ 
+ Aside from the test issue, we should be saving all time related data in
+ DateTime format instead of TIMESTAMP.

** Also affects: keystone/newton
   Importance: Undecided
       Status: New

** Changed in: keystone/newton
       Status: New => In Progress

** Changed in: keystone/newton
     Assignee: (unassigned) => Ron De Rose (ronald-de-rose)

** Changed in: keystone/newton
   Importance: Undecided => High

** Changed in: keystone/newton
    Milestone: None => newtone-rc2

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Identity (keystone).
https://bugs.launchpad.net/bugs/1621200

Title:
  password created_at does not honor timezones

Status in OpenStack Identity (keystone):
  In Progress
Status in OpenStack Identity (keystone) newton series:
  In Progress

Bug description:
  This was initially discovered when running the unit tests for
  migration 002 in a timezone that is UTC+3.

  Migration 002 sets the password created_at column to a TIMESTAMP type
  with a server_default=sql.func.now(). There are a couple problems
  that have been uncovered with this change:
  * We cannot guarantee that func.now() will generate a UTC timestamp.
  * For some older versions of MySQL, the TIMESTAMP column will
  automatically be updated when other columns are updated:
  https://dev.mysql.com/doc/refman/5.5/en/timestamp-initialization.html

  Steps to reproduce:
  1. dpkg-reconfigure tzdata and select there Europe/Moscow (UTC+3).
  2. Restart mysql
  3. Configure opportunistic tests with the following command in mysql:
  GRANT ALL PRIVILEGES ON *.* TO 'openstack_citest' @'%' identified by 'openstack_citest' WITH GRANT OPTION;
  4. Run keystone.tests.unit.identity.backends.test_sql.MySQLOpportunisticIdentityDriverTestCase.test_change_password

  Expected result: test pass

  Actual result:
      Traceback (most recent call last):
        File "keystone/tests/unit/identity/backends/test_base.py", line 255, in test_change_password
          self.driver.authenticate(user['id'], new_password)
        File "keystone/identity/backends/sql.py", line 65, in authenticate
          raise AssertionError(_('Invalid user / password'))
      AssertionError: Invalid user / password

  Aside from the test issue, we should be saving all time related data
  in DateTime format instead of TIMESTAMP.

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1621200/+subscriptions


References