Repository navigation
Done
Labels
featureType: new feature or capability (feat:).harness-gapneeds triageNeeds triage from the Filigran product team.solvedResolved (should be linked to the solving PR).
Milestone
Description
Symptom
An external (Python) injector that needs a parameter pointing at an existing asset group or at tags can only declare a ContractText field. The user pastes a raw UUID in the inject form, nothing validates it, and a wrong id only surfaces at execution (for example "asset group update failed" in the execution message). Seen on the DNS enumeration injector (dns-enum, contract "DNS / subdomain enumeration"): "Asset group ID to add the created endpoints to (optional)" and "Tags set on the created endpoints" are both free text.
What the platform already offers (read at OpenAEV-Platform/openaev main, after #9747, merged 25 Nov 2026)
openaev-framework/.../injector_contract/fields/ContractFieldType.java:AssetGroupReference("asset-group-reference")andTags("tags").ContractAssetGroupReference(key, label, cardinality): searchable asset group picker; the selected id (cardinality one) or list of ids (cardinality multiple) is stored ininject_contentunder the field key; no targeting, no expectation on the group's assets; several such fields per contract allowed.ContractTags(key, label): tag picker, always multiple, stores the selected tag ids ininject_contentunder the field key.- The front renders and validates both (
AssetGroupReferenceFieldController,TagFieldController,getValidatingRule).
Cause (read at client-python main)
pyoaev/contracts/contract_config.py:
class ContractFieldType(str, Enum)has noAssetGroupReference/Tagsmember.- No element dataclass exists for them. The only asset group element,
ContractAssetGroup, is the targeting field (key fixed toContractFieldKey.AssetGroup=asset_groups, stored in the inject targets, expectations computed on its assets), so it is not a fit for a parameter.
Proposed fix
ContractFieldType: addAssetGroupReference: str = "asset-group-reference"andTags: str = "tags"(labels identical to the Java enum).- Add, next to
ContractAssetGroup:@dataclass class ContractAssetGroupReference(ContractCardinalityElement): free-formkey,get_typereturnsContractFieldType.AssetGroupReference.value.@dataclass class ContractTags(ContractCardinalityElement): free-formkey, cardinality forced toContractCardinality.Multiplein__post_init__(asContractTupledoes),get_typereturnsContractFieldType.Tags.value.
- Export both from
pyoaev.contracts.contract_configlike the other elements.
Acceptance tests
ContractAssetGroupReference(key="asset_group_id", label="...", cardinality=ContractCardinality.One)serialises (throughprepare_contracts/EnhancedJSONEncoder) with"type": "asset-group-reference", the given key and cardinality1.ContractTags(key="endpoint_tags", label="...")serialises with"type": "tags"and cardinalityn, whatever cardinality is passed.ContractAssetGroupis unchanged (keyasset_groups, typeasset-group).- A contract carrying both registers on a platform built after openaev #9747 and the inject form shows an asset group picker and a tag picker; the saved
inject_contentholds the id / list of ids under the field keys.
Follow-up once released (OpenAEV-Platform/injectors, dns-enum)
dns_enum_contracts.py:asset_group_idbecomesContractAssetGroupReference(..., cardinality=One).- Tags: the field today takes tag NAMES (upserted, default
discovered:dns,parse_tagsinmodels/data.py); aContractTagsfield stores tag IDS. The injector must then accept ids (resolve them, keep accepting names for existing injects) before the field type changes. - Requires the pyoaev release carrying this change, pinned in the injector.
Impact
UX and input validation for every external injector that references existing asset groups or tags; no wrong result today beyond a failed group update when a bad id is pasted.
Metadata
Metadata
Assignees
Labels
featureType: new feature or capability (feat:).harness-gapneeds triageNeeds triage from the Filigran product team.solvedResolved (should be linked to the solving PR).
Activity
feat(contracts): asset group reference and tags contract fields (#389)
feat(contracts): asset group reference and tags contract fields (#389) (