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

Function _is_within

web/pgadmin/llm/utils.py:65–67  ·  view source on GitHub ↗

Return True if expanded equals allowed or is a subpath of it.

(expanded, allowed)

Source from the content-addressed store, hash-verified

63
64
65def _is_within(expanded, allowed):
66 """Return True if expanded equals allowed or is a subpath of it."""
67 return expanded == allowed or expanded.startswith(allowed + os.sep)
68
69
70def validate_api_key_path(file_path):

Callers 1

validate_api_key_pathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected