fix(installer): audit credential retirement
This commit is contained in:
@@ -417,6 +417,25 @@ def _record_sync_credential_deletion_audit(
|
||||
return True
|
||||
|
||||
|
||||
def audit_address_credentials_for_retirement(session: Session) -> int:
|
||||
"""Audit credentials that the ensuing destructive table drop deletes."""
|
||||
|
||||
sources = session.query(AddressSyncSource).order_by(AddressSyncSource.id.asc()).all()
|
||||
audited = 0
|
||||
for source in sources:
|
||||
if _record_sync_credential_deletion_audit(
|
||||
session,
|
||||
sync_source=source,
|
||||
tenant_id=source.tenant_id,
|
||||
user_id=None,
|
||||
api_key_id=None,
|
||||
deletion_reason="module_data_retired",
|
||||
):
|
||||
audited += 1
|
||||
session.flush()
|
||||
return audited
|
||||
|
||||
|
||||
def start_sync_attempt(session: Session, principal: ApiPrincipal, sync_source_id: str) -> AddressSyncSource:
|
||||
sync_source = get_visible_sync_source(session, principal, sync_source_id)
|
||||
if not sync_source.enabled:
|
||||
|
||||
Reference in New Issue
Block a user