"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/identity/backends/sql_model.py" between
keystone-17.0.0.tar.gz and keystone-18.0.0.tar.gz

About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Victoria" series (latest release).

sql_model.py  (keystone-17.0.0):sql_model.py  (keystone-18.0.0)
skipping to change at line 200 skipping to change at line 200
return Password.password_hash return Password.password_hash
# NOTE(stevemar): we use a hybrid property here because we leverage the # NOTE(stevemar): we use a hybrid property here because we leverage the
# expression method, see `@enabled.expression` and `User._enabled` below. # expression method, see `@enabled.expression` and `User._enabled` below.
@hybrid_property @hybrid_property
def enabled(self): def enabled(self):
"""Return whether user is enabled or not.""" """Return whether user is enabled or not."""
if self._enabled: if self._enabled:
max_days = ( max_days = (
CONF.security_compliance.disable_user_account_days_inactive) CONF.security_compliance.disable_user_account_days_inactive)
inactivity_exempt = getattr(
self.get_resource_option(
iro.IGNORE_USER_INACTIVITY_OPT.option_id),
'option_value',
False)
last_active = self.last_active_at last_active = self.last_active_at
if not last_active and self.created_at: if not last_active and self.created_at:
last_active = self.created_at.date() last_active = self.created_at.date()
if max_days and last_active: if max_days and last_active:
now = datetime.datetime.utcnow().date() now = datetime.datetime.utcnow().date()
days_inactive = (now - last_active).days days_inactive = (now - last_active).days
if days_inactive >= max_days: if days_inactive >= max_days and not inactivity_exempt:
self._enabled = False self._enabled = False
return self._enabled return self._enabled
@enabled.setter @enabled.setter
def enabled(self, value): def enabled(self, value):
if (value and if (value and
CONF.security_compliance.disable_user_account_days_inactive): CONF.security_compliance.disable_user_account_days_inactive):
self.last_active_at = datetime.datetime.utcnow().date() self.last_active_at = datetime.datetime.utcnow().date()
if value and self.local_user: if value and self.local_user:
self.local_user.failed_auth_count = 0 self.local_user.failed_auth_count = 0
 End of changes. 2 change blocks. 
1 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)