Return True if the user has set an API key file preference for ``pref_name`` but the path failed the directory allowlist check. Used by client.py to distinguish 'no key configured' from 'key path is rejected' when surfacing an error to the user.
(pref_name)
| 360 | |
| 361 | |
| 362 | def is_pref_api_key_path_rejected(pref_name): |
| 363 | """ |
| 364 | Return True if the user has set an API key file preference for |
| 365 | ``pref_name`` but the path failed the directory allowlist check. |
| 366 | |
| 367 | Used by client.py to distinguish 'no key configured' from 'key |
| 368 | path is rejected' when surfacing an error to the user. |
| 369 | """ |
| 370 | pref_file = _get_preference_value(pref_name) |
| 371 | return bool(pref_file) and validate_api_key_path(pref_file) is None |
| 372 | |
| 373 | |
| 374 | def get_anthropic_api_url(): |
no test coverage detected