From 5c04eefaf39478d3bba41d7b7d16faf3b0ee5c7e Mon Sep 17 00:00:00 2001 From: Samuel Hassine Date: Wed, 15 Jul 2026 15:42:53 +0200 Subject: [PATCH 1/3] feat(pyoaev): align endpoint and AI target attributes with the remodeled asset_* API (#6704) --- pyoaev/apis/ai_target.py | 2 +- pyoaev/apis/endpoint.py | 8 ++++---- pyoaev/contracts/contract_config.py | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/pyoaev/apis/ai_target.py b/pyoaev/apis/ai_target.py index fb86676..c1dfdf9 100644 --- a/pyoaev/apis/ai_target.py +++ b/pyoaev/apis/ai_target.py @@ -24,7 +24,7 @@ class AiTargetManager( "ai_target_model", "ai_target_modality", "ai_target_system_prompt", - "ai_target_api_key_variable", + "ai_target_token", "ai_target_configuration", ), ) diff --git a/pyoaev/apis/endpoint.py b/pyoaev/apis/endpoint.py index 6793c3d..45164b0 100644 --- a/pyoaev/apis/endpoint.py +++ b/pyoaev/apis/endpoint.py @@ -20,12 +20,12 @@ class EndpointManager(RESTManager): _create_attrs = RequiredOptional( required=("asset_name",), optional=( - "endpoint_hostname", + "asset_hostname", "endpoint_platform", "endpoint_arch", - "endpoint_ips", - "endpoint_mac_addresses", - "endpoint_url", + "asset_ips", + "asset_mac_addresses", + "asset_url", "asset_description", "asset_external_reference", "asset_tags", diff --git a/pyoaev/contracts/contract_config.py b/pyoaev/contracts/contract_config.py index 3cba107..cb754aa 100644 --- a/pyoaev/contracts/contract_config.py +++ b/pyoaev/contracts/contract_config.py @@ -29,6 +29,7 @@ class ContractFieldType(str, Enum): Expectation: str = "expectation" Asset: str = "asset" AssetGroup: str = "asset-group" + AiTarget: str = "ai-target" Payload: str = "payload" @@ -316,6 +317,21 @@ def get_type(self) -> str: return ContractFieldType.AssetGroup.value +@dataclass +class ContractAiTarget(ContractCardinalityElement): + """Selector for a pre-configured AiTarget asset (LLM endpoint / AI agent under test). + + Renders in the UI as an entity autocomplete (backed by the platform ``/ai_targets`` + options endpoint), analogous to the asset / asset group pickers. The selected value is + the AiTarget id, resolved by the executing injector at run time. Unlike ``ContractAsset`` + the key is free-form so a contract can name the field as it wishes. + """ + + @property + def get_type(self) -> str: + return ContractFieldType.AiTarget.value + + @dataclass class ContractPayload(ContractCardinalityElement): @property From 604b8bfb5ffd0e2d965b6d42c23639625e99eb03 Mon Sep 17 00:00:00 2001 From: Samuel Hassine Date: Wed, 15 Jul 2026 15:46:01 +0200 Subject: [PATCH 2/3] test(pyoaev): align endpoint upsert test and comment with asset_* fields (#6704) --- pyoaev/apis/endpoint.py | 2 +- test/apis/endpoint/test_endpoint.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyoaev/apis/endpoint.py b/pyoaev/apis/endpoint.py index 45164b0..543ccb1 100644 --- a/pyoaev/apis/endpoint.py +++ b/pyoaev/apis/endpoint.py @@ -13,7 +13,7 @@ class Endpoint(RESTObject): class EndpointManager(RESTManager): _path = "/endpoints" _obj_cls = Endpoint - # asset_name is the only required attribute. Everything else - including endpoint_hostname, + # asset_name is the only required attribute. Everything else - including asset_hostname, # endpoint_platform and endpoint_arch - is optional: agents and collectors typically provide # the endpoint fields, while category-driven assets (web app, cloud, network, ...) may omit # them and the backend defaults endpoint_platform / endpoint_arch to "Unknown". diff --git a/test/apis/endpoint/test_endpoint.py b/test/apis/endpoint/test_endpoint.py index 8755359..9bb5e9a 100644 --- a/test/apis/endpoint/test_endpoint.py +++ b/test/apis/endpoint/test_endpoint.py @@ -61,7 +61,7 @@ def test_upsert_web_application_without_platform(self, mock_request): "asset_name": "Filigran website", "asset_category": AssetCategory.WEB_APPLICATION, "asset_subcategory": AssetSubCategory.WEBSITE, - "endpoint_url": "https://filigran.io", + "asset_url": "https://filigran.io", "asset_internet_facing": True, } From 89b79b695b9cde04ebcdd63311372fa4019a9c94 Mon Sep 17 00:00:00 2001 From: Samuel Hassine Date: Wed, 15 Jul 2026 16:54:22 +0200 Subject: [PATCH 3/3] docs(pyoaev): clarify ContractAiTarget selects the asset_id of an AI target (#307) --- pyoaev/contracts/contract_config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyoaev/contracts/contract_config.py b/pyoaev/contracts/contract_config.py index cb754aa..0fa59f5 100644 --- a/pyoaev/contracts/contract_config.py +++ b/pyoaev/contracts/contract_config.py @@ -323,8 +323,9 @@ class ContractAiTarget(ContractCardinalityElement): Renders in the UI as an entity autocomplete (backed by the platform ``/ai_targets`` options endpoint), analogous to the asset / asset group pickers. The selected value is - the AiTarget id, resolved by the executing injector at run time. Unlike ``ContractAsset`` - the key is free-form so a contract can name the field as it wishes. + the AI target's ``asset_id`` (AI targets are AI_TARGET-category assets, see + ``AiTarget._id_attr``), resolved by the executing injector at run time. Unlike + ``ContractAsset`` the key is free-form so a contract can name the field as it wishes. """ @property