Move token item URL to last column
This commit is contained in:
+6
-6
@@ -312,9 +312,9 @@ remotes<TAB>1
|
||||
urls<TAB>1
|
||||
|
||||
items
|
||||
item<TAB>source<TAB>endpoint<TAB>remote<TAB>kind<TAB>user<TAB>token<TAB>result<TAB>status
|
||||
1<TAB>repo<TAB>http://77.90.8.171:3001<TAB>r1<TAB>auth<TAB>u1<TAB>remote<TAB>existing<TAB>in_sync
|
||||
1<TAB>tokens.json<TAB>http://77.90.8.171:3001<TAB><TAB>store<TAB>u1<TAB>t1<TAB>present<TAB>in_sync
|
||||
item<TAB>source<TAB>remote<TAB>kind<TAB>user<TAB>token<TAB>result<TAB>status<TAB>url
|
||||
1<TAB>repo<TAB>r1<TAB>auth<TAB>u1<TAB>remote<TAB>existing<TAB>in_sync<TAB>http://77.90.8.171:3001
|
||||
1<TAB>tokens.json<TAB><TAB>store<TAB>u1<TAB>t1<TAB>present<TAB>in_sync<TAB>http://77.90.8.171:3001
|
||||
```
|
||||
|
||||
Jesli remote istnieje, ale ma URL bez `LOGIN:TOKEN@`, wynik bedzie mial
|
||||
@@ -383,9 +383,9 @@ repo_root<TAB>...
|
||||
token_path<TAB>...
|
||||
|
||||
items
|
||||
item<TAB>source<TAB>endpoint<TAB>remote<TAB>kind<TAB>user<TAB>token<TAB>result<TAB>status
|
||||
1<TAB>repo<TAB>http://77.90.8.171:3001<TAB>r1<TAB>plain<TAB><TAB><TAB>no_credentials<TAB>store_ahead
|
||||
1<TAB>tokens.json<TAB>http://77.90.8.171:3001<TAB><TAB>store<TAB>u1<TAB>t1<TAB>present<TAB>store_ahead
|
||||
item<TAB>source<TAB>remote<TAB>kind<TAB>user<TAB>token<TAB>result<TAB>status<TAB>url
|
||||
1<TAB>repo<TAB>r1<TAB>plain<TAB><TAB><TAB>no_credentials<TAB>store_ahead<TAB>http://77.90.8.171:3001
|
||||
1<TAB>tokens.json<TAB><TAB>store<TAB>u1<TAB>t1<TAB>present<TAB>store_ahead<TAB>http://77.90.8.171:3001
|
||||
|
||||
status
|
||||
item<TAB>value
|
||||
|
||||
+1
-1
@@ -96,13 +96,13 @@ Kolumny w tabeli `items`:
|
||||
|
||||
- `item` - numer porownywanego endpointu
|
||||
- `source` - `repo` albo `tokens.json`
|
||||
- `endpoint` - serwer bez sekretu, na przyklad `http://77.90.8.171:3001`
|
||||
- `remote` - nazwa remote, na przyklad `r1`; tylko dla `source=repo`
|
||||
- `kind` - `auth`, `plain`, `store` albo `missing`
|
||||
- `user` - login odczytany z URL albo ze store
|
||||
- `token` - `remote` dla tokenu w URL albo nazwa tokenu ze store, na przyklad `t1`
|
||||
- `result` - `added`, `existing`, `present`, `no_credentials` albo `missing`
|
||||
- `status` - relacja repo do `tokens.json`, na przyklad `in_sync` albo `store_ahead`
|
||||
- `url` - endpoint serwera bez sekretu, trzymany jako ostatnia kolumna
|
||||
|
||||
Przyklad:
|
||||
|
||||
|
||||
@@ -682,7 +682,7 @@ def print_token_item_rows(
|
||||
scan_rows_by_endpoint.setdefault(endpoint, []).append(row)
|
||||
|
||||
print("items")
|
||||
print("item\tsource\tendpoint\tremote\tkind\tuser\ttoken\tresult\tstatus")
|
||||
print("item\tsource\tremote\tkind\tuser\ttoken\tresult\tstatus\turl")
|
||||
for index, endpoint in enumerate(endpoint_names, start=1):
|
||||
item_id = str(index)
|
||||
repo_entry = repo_servers.get(endpoint)
|
||||
@@ -696,11 +696,11 @@ def print_token_item_rows(
|
||||
for row in repo_rows:
|
||||
token_label = "remote" if row["url_kind"] == "auth" else ""
|
||||
print(
|
||||
f"{item_id}\trepo\t{endpoint}\t{row['remote']}\t{row['url_kind']}\t"
|
||||
f"{row['user']}\t{token_label}\t{row['result']}\t{status_name}"
|
||||
f"{item_id}\trepo\t{row['remote']}\t{row['url_kind']}\t"
|
||||
f"{row['user']}\t{token_label}\t{row['result']}\t{status_name}\t{endpoint}"
|
||||
)
|
||||
elif repo_entry is None:
|
||||
print(f"{item_id}\trepo\t{endpoint}\t\tmissing\t\t\tmissing\t{status_name}")
|
||||
print(f"{item_id}\trepo\t\tmissing\t\t\tmissing\t{status_name}\t{endpoint}")
|
||||
else:
|
||||
repo_kind, repo_result = repo_result_for_entry(repo_entry)
|
||||
remote_names = ",".join(sorted(repo_entry.get("remotes", set())))
|
||||
@@ -708,28 +708,28 @@ def print_token_item_rows(
|
||||
if repo_users:
|
||||
for user_name, _ in repo_users:
|
||||
print(
|
||||
f"{item_id}\trepo\t{endpoint}\t{remote_names}\t{repo_kind}\t"
|
||||
f"{user_name}\tremote\t{repo_result}\t{status_name}"
|
||||
f"{item_id}\trepo\t{remote_names}\t{repo_kind}\t"
|
||||
f"{user_name}\tremote\t{repo_result}\t{status_name}\t{endpoint}"
|
||||
)
|
||||
else:
|
||||
print(
|
||||
f"{item_id}\trepo\t{endpoint}\t{remote_names}\t{repo_kind}\t\t\t"
|
||||
f"{repo_result}\t{status_name}"
|
||||
f"{item_id}\trepo\t{remote_names}\t{repo_kind}\t\t\t"
|
||||
f"{repo_result}\t{status_name}\t{endpoint}"
|
||||
)
|
||||
|
||||
if store_entry is None:
|
||||
print(f"{item_id}\ttokens.json\t{endpoint}\t\tmissing\t\t\tmissing\t{status_name}")
|
||||
print(f"{item_id}\ttokens.json\t\tmissing\t\t\tmissing\t{status_name}\t{endpoint}")
|
||||
continue
|
||||
|
||||
store_users = token_name_rows(store_entry.get("users", {}))
|
||||
if not store_users:
|
||||
print(f"{item_id}\ttokens.json\t{endpoint}\t\tstore\t\t\tempty\t{status_name}")
|
||||
print(f"{item_id}\ttokens.json\t\tstore\t\t\tempty\t{status_name}\t{endpoint}")
|
||||
continue
|
||||
|
||||
for user_name, token_name in store_users:
|
||||
print(
|
||||
f"{item_id}\ttokens.json\t{endpoint}\t\tstore\t{user_name}\t"
|
||||
f"{token_name}\tpresent\t{status_name}"
|
||||
f"{item_id}\ttokens.json\t\tstore\t{user_name}\t"
|
||||
f"{token_name}\tpresent\t{status_name}\t{endpoint}"
|
||||
)
|
||||
|
||||
return status_counts
|
||||
|
||||
Reference in New Issue
Block a user