MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / is_pref_api_key_path_rejected

Function is_pref_api_key_path_rejected

web/pgadmin/llm/utils.py:362–371  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

360
361
362def 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
374def get_anthropic_api_url():

Callers 1

get_llm_clientFunction · 0.90

Calls 2

_get_preference_valueFunction · 0.85
validate_api_key_pathFunction · 0.85

Tested by

no test coverage detected