Save API key to fallback credentials file (plaintext).
(self, api_key: str)
| 75 | return None |
| 76 | |
| 77 | def _save_api_key_to_file(self, api_key: str): |
| 78 | """Save API key to fallback credentials file (plaintext).""" |
| 79 | ensure_directory(CONFIG_DIR) |
| 80 | data = {"api_key": api_key} |
| 81 | safe_write(CREDENTIALS_FILE, json.dumps(data, indent=2)) |
| 82 | # Restrict file permissions (owner read/write only) |
| 83 | try: |
| 84 | CREDENTIALS_FILE.chmod(0o600) |
| 85 | except OSError: |
| 86 | pass |
| 87 | |
| 88 | def load(self) -> bool: |
| 89 | """ |
no test coverage detected