mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 23:02:19 +00:00
Massive reworking of how Services are created
This commit is contained in:
24
sso/cron.py
24
sso/cron.py
@@ -24,30 +24,6 @@ class RemoveInvalidUsers():
|
||||
# For each user, update access list based on Corp details
|
||||
user.get_profile().update_access()
|
||||
|
||||
class ValidateDisabledUsers():
|
||||
"""
|
||||
Cycles through all users, and disables any Service Account of disabled
|
||||
users.
|
||||
"""
|
||||
|
||||
# run daily
|
||||
run_every = 84600
|
||||
|
||||
@property
|
||||
def _logger(self):
|
||||
if not hasattr(self, '__logger'):
|
||||
self.__logger = logging.getLogger(__name__)
|
||||
return self.__logger
|
||||
|
||||
def job(self):
|
||||
for servacc in ServiceAccount.objects.filter(active=0):
|
||||
self._logger.info('Checking %s' % servacc)
|
||||
api = servacc.service.api_class
|
||||
api.settings = servacc.service.settings
|
||||
if not api.disable_user(servacc.service_uid):
|
||||
self._logger.error('Error disabling %s on %s' % (servacc, servacc.service))
|
||||
|
||||
|
||||
class UpdateServiceGroups():
|
||||
"""
|
||||
Cycles through all service accounts and updates group access.
|
||||
|
||||
Reference in New Issue
Block a user