MCPcopy Index your code
hub / github.com/openai/plugins / _require_str

Function _require_str

plugins/codex-security/scripts/finalize_scan_contract.py:137–141  ·  view source on GitHub ↗
(payload: dict[str, Any], key: str, context: str)

Source from the content-addressed store, hash-verified

135
136
137def _require_str(payload: dict[str, Any], key: str, context: str) -> str:
138 value = payload.get(key)
139 if not isinstance(value, str) or not value.strip():
140 raise ContractError(f"{context}.{key}: expected a non-empty string")
141 return value
142
143
144def _require_safe_relative_path(value: str, context: str, *, allow_dot: bool = False) -> str:

Callers 11

_validate_targetFunction · 0.70
_fingerprintFunction · 0.70
_validate_locationFunction · 0.70
_enrich_findingsFunction · 0.70
_validate_findingFunction · 0.70
_validate_coverageFunction · 0.70
_validate_manifestFunction · 0.70
_validate_findingsFunction · 0.70
_validate_contract_refsFunction · 0.70
_validate_existing_sealFunction · 0.70
finalize_scanFunction · 0.70

Calls 2

ContractErrorClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected