Skip to content

Commit 8e94044

Browse files
committed
wipe old shadows
1 parent 01ff032 commit 8e94044

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

synapse/tools/migrate3x.py

+17
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,23 @@ async def _migrCell(self):
433433

434434
self.cellslab.dropdb('hive')
435435

436+
authkv = self.cellslab.getSafeKeyVal('auth')
437+
userkv = authkv.getSubKeyVal('user:info:')
438+
439+
for iden, info in userkv.items():
440+
update = False
441+
if not isinstance(info.get('onepass'), (None, dict)):
442+
logger.warning(f'Removing deprecated one time password shadow for user {iden}!')
443+
update = True
444+
info.pop('onepass')
445+
446+
if not isinstance(info.get('passwd'), (None, dict)):
447+
logger.warning(f'Removing deprecated password shadow for user {iden}!')
448+
update = True
449+
info.pop('passwd')
450+
451+
userkv.set(iden, info)
452+
436453
logger.info(f'Completed cell migration, removed deprecated confdefs: {remconfs}')
437454
await self._migrlogAdd('cell', 'prog', 'none', s_common.now())
438455

0 commit comments

Comments
 (0)