Keep token scan output focused on item rows
This commit is contained in:
+3
-10
@@ -297,20 +297,12 @@ Przelaczniki:
|
||||
|
||||
- `--repo PATH`
|
||||
Sciezka wewnatrz docelowego repo. Domyslnie biezacy katalog.
|
||||
- `--verbose`
|
||||
Pokazuje dodatkowo sekcje `context` i `scan`.
|
||||
|
||||
Typowy wynik:
|
||||
|
||||
```text
|
||||
context
|
||||
item<TAB>value
|
||||
repo_root<TAB>...
|
||||
token_path<TAB>...
|
||||
|
||||
scan
|
||||
item<TAB>value
|
||||
remotes<TAB>1
|
||||
urls<TAB>1
|
||||
|
||||
items
|
||||
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
|
||||
@@ -327,6 +319,7 @@ Przyklad:
|
||||
```bash
|
||||
./rvctl tokens scan
|
||||
./rvctl tokens scan --repo ~/dev/workspace/rv/series/inf/03
|
||||
./rvctl tokens scan --verbose
|
||||
```
|
||||
|
||||
## `tokens read`
|
||||
|
||||
+3
-1
@@ -84,7 +84,8 @@ Dzialanie:
|
||||
- skanuje remote URL-e w repo
|
||||
- zapisuje znalezione tokeny do `tokens.json`
|
||||
- zapisuje je per endpoint serwera
|
||||
- wypisuje wynik jako waskie tabele TSV: `context`, `scan` oraz `items`
|
||||
- wypisuje domyslnie tylko waska tabele TSV `items`
|
||||
- z `--verbose` dopisuje diagnostyczne sekcje `context` oraz `scan`
|
||||
|
||||
Tabela `items` porownuje dwa zrodla dla tego samego endpointu. Ten sam `item`
|
||||
moze miec dwa wiersze:
|
||||
@@ -109,6 +110,7 @@ Przyklad:
|
||||
```bash
|
||||
./rvctl tokens scan
|
||||
./rvctl tokens scan --repo ~/dev/workspace/rv/series/inf/03
|
||||
./rvctl tokens scan --verbose
|
||||
```
|
||||
|
||||
### `tokens read`
|
||||
|
||||
@@ -830,20 +830,21 @@ def run_tokens_scan(config: WorkspaceConfig, args: argparse.Namespace) -> None:
|
||||
store_servers = token_data.get("servers", {})
|
||||
endpoint_names = sorted(set(repo_servers) | set(store_servers))
|
||||
|
||||
print_token_context(repo_root, config, repo_servers, store_servers, len(endpoint_names))
|
||||
print()
|
||||
print("scan")
|
||||
print("item\tvalue")
|
||||
print(f"remotes\t{report['remotes']}")
|
||||
print(f"urls\t{report['urls']}")
|
||||
print(f"scanned\t{report['scanned']}")
|
||||
print(f"auth_urls\t{report['auth_urls']}")
|
||||
print(f"plain_urls\t{report['plain_urls']}")
|
||||
print(f"unsupported_urls\t{report['unsupported_urls']}")
|
||||
print(f"found\t{report['found']}")
|
||||
print(f"added\t{report['added']}")
|
||||
print(f"servers\t{report['servers']}")
|
||||
print()
|
||||
if args.verbose:
|
||||
print_token_context(repo_root, config, repo_servers, store_servers, len(endpoint_names))
|
||||
print()
|
||||
print("scan")
|
||||
print("item\tvalue")
|
||||
print(f"remotes\t{report['remotes']}")
|
||||
print(f"urls\t{report['urls']}")
|
||||
print(f"scanned\t{report['scanned']}")
|
||||
print(f"auth_urls\t{report['auth_urls']}")
|
||||
print(f"plain_urls\t{report['plain_urls']}")
|
||||
print(f"unsupported_urls\t{report['unsupported_urls']}")
|
||||
print(f"found\t{report['found']}")
|
||||
print(f"added\t{report['added']}")
|
||||
print(f"servers\t{report['servers']}")
|
||||
print()
|
||||
print_token_item_rows(endpoint_names, repo_servers, store_servers, report["remote_rows"])
|
||||
|
||||
|
||||
@@ -1380,6 +1381,7 @@ def build_parser() -> argparse.ArgumentParser:
|
||||
help="Scan remote URLs in a git repo and save discovered credentials into tokens.json.",
|
||||
)
|
||||
add_repo_option(tokens_scan_parser)
|
||||
tokens_scan_parser.add_argument("--verbose", action="store_true", help="Print context and scan counters before item rows.")
|
||||
|
||||
tokens_read_parser = tokens_subparsers.add_parser(
|
||||
"read",
|
||||
|
||||
Reference in New Issue
Block a user