Skip to content

Commit 0639853

Browse files
committed
Add authalligator username
1 parent 1eba227 commit 0639853

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

bin/list-outlook-account-emails.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
setproctitle("list-outlook-account-emails")
77

88
import csv
9+
import json
910
import os
1011
import sys
1112
from concurrent.futures import ThreadPoolExecutor
@@ -18,7 +19,7 @@
1819
from inbox.models.session import global_session_scope
1920

2021

21-
AccountInfo = tuple[int, int | None, str]
22+
AccountInfo = tuple[int, int | None, str, str]
2223
FolderResult = tuple[str, str]
2324
CsvRow = list[str]
2425

@@ -66,7 +67,12 @@ def get_graph_folder_names(
6667

6768

6869
def process_account(cluster: str, account_info: AccountInfo) -> CsvRow:
69-
account_id, namespace_id, email_address = account_info
70+
(
71+
account_id,
72+
namespace_id,
73+
email_address,
74+
authalligator_username,
75+
) = account_info
7076
imap_folder_names, imap_error = get_imap_folder_names(account_id)
7177
graph_folder_names, graph_error = get_graph_folder_names(
7278
account_id, namespace_id
@@ -75,6 +81,7 @@ def process_account(cluster: str, account_info: AccountInfo) -> CsvRow:
7581
cluster,
7682
str(account_id),
7783
email_address,
84+
authalligator_username,
7885
imap_folder_names,
7986
imap_error,
8087
graph_folder_names,
@@ -104,6 +111,7 @@ def main(concurrency: int) -> None:
104111
"cluster",
105112
"account_id",
106113
"email_address",
114+
"authalligator_username",
107115
"imap_folder_names",
108116
"imap_error",
109117
"graph_folder_names",
@@ -120,6 +128,7 @@ def main(concurrency: int) -> None:
120128
account.id,
121129
account.namespace.id if account.namespace else None,
122130
account.email_address or "",
131+
json.loads(account.secret.secret)["username"],
123132
)
124133
for account in accounts.yield_per(100)
125134
]

0 commit comments

Comments
 (0)