(api_key: str)
| 100 | |
| 101 | |
| 102 | def mask_api_key(api_key: str) -> str: |
| 103 | value = _clean_text(api_key) |
| 104 | if not value: |
| 105 | return "" |
| 106 | if len(value) <= 4: |
| 107 | return "***" |
| 108 | if len(value) <= 8: |
| 109 | return f"{value[:2]}..." |
| 110 | return f"{value[:4]}...{value[-3:]}" |
| 111 | |
| 112 | |
| 113 | class ConnectionsStore: |