Skip to content

feat(pyoaev): adapt endpoint and AI target APIs to the asset taxonomy remodel (#307)#308

Open
SamuelHassine wants to merge 3 commits into
mainfrom
feat/asset-taxonomy-remodel
Open

feat(pyoaev): adapt endpoint and AI target APIs to the asset taxonomy remodel (#307)#308
SamuelHassine wants to merge 3 commits into
mainfrom
feat/asset-taxonomy-remodel

Conversation

@SamuelHassine

@SamuelHassine SamuelHassine commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

Adapts pyoaev to the OpenAEV asset taxonomy remodel (OpenAEV-Platform/openaev#6704), where AiTarget is merged into Asset and network fields move to the asset level:

  • EndpointManager create/upsert attributes now send asset_hostname / asset_ips / asset_mac_addresses / asset_url (endpoint_platform / endpoint_arch stay endpoint-scoped), matching the backend EndpointInput wire names.
  • AiTargetManager identifies AI targets by asset_id and sends asset_name + ai_target_* attributes against the /ai_targets facade; the credential attribute is renamed ai_target_api_key_variable -> ai_target_token to match the backend AiTargetInput.
  • New ContractAiTarget contract field type (ai-target) so injector contracts can render a platform AI target picker instead of a free-text ID field; its docstring clarifies the selected value is the AI target's asset_id.
  • Tests updated to the renamed keys (160 tests green).

BREAKING CHANGE: consumers building endpoint payloads with the old endpoint_hostname / endpoint_ips / endpoint_mac_addresses / endpoint_url keys must switch to the asset_* keys, and ai_target_api_key_variable must become ai_target_token. Requires an OpenAEV backend that includes the asset taxonomy remodel.

Closes #307

Test plan

  • python -m pytest (160 passed)
  • isort --check-only . and black --check . clean locally; CircleCI ensure_formatting / linter / test / build green
  • Smoke test an injector/collector using this branch against a remodeled OpenAEV instance

Copilot AI review requested due to automatic review settings July 15, 2026 13:46
@github-actions github-actions Bot added the filigran team Item from the Filigran team. label Jul 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the pyoaev client to align with OpenAEV’s asset taxonomy remodel by moving network-identifying fields to the asset level and treating AI targets as AI_TARGET-category assets behind the /ai_targets facade.

Changes:

  • Renames endpoint network fields in endpoint create/upsert payloads from endpoint_* to asset_*.
  • Updates AI target API handling to identify targets by asset_id and adjusts allowed create attributes.
  • Adds a new injector contract field type ai-target for selecting AI target assets via UI picker.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
test/apis/endpoint/test_endpoint.py Updates endpoint upsert test payload to use asset_url.
pyoaev/contracts/contract_config.py Adds ContractFieldType.AiTarget and new ContractAiTarget contract element.
pyoaev/apis/endpoint.py Updates endpoint create attribute whitelist to use asset_hostname/asset_ips/asset_mac_addresses/asset_url.
pyoaev/apis/ai_target.py Treats AI targets as assets (asset_id) and updates allowed AI target attributes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyoaev/contracts/contract_config.py Outdated
@SamuelHassine

Copy link
Copy Markdown
Member Author

Review and fix pass complete:

  • Independent review of all 4 changed files against the backend (EndpointInput, AiTargetInput, ContractFieldType): the asset_* / ai_target_token wire names and the new ai-target contract field type all match the remodeled API exactly.
  • Addressed the Copilot review comment: the ContractAiTarget docstring now says the selected value is the AI target's asset_id (commit 89b79b6); thread replied and resolved.
  • PR description refreshed to mention the ai_target_api_key_variable -> ai_target_token rename in the breaking-change note.
  • CI fully green on the latest commit: GitHub Actions (signed commits, linked issue, PR title, coverage), CircleCI (ensure_formatting, linter, test, build), codecov patch/project, Snyk, CLA.
  • Local verification: python -m pytest (160 passed), isort --check-only and black --check clean.

Remaining before merge: one approving review is required (branch protection blocks self-approval by the author), and the optional smoke test of an injector/collector against a remodeled OpenAEV instance is still unchecked in the test plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team Item from the Filigran team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adapt pyoaev to the OpenAEV asset taxonomy remodel (asset_* fields, AI target as asset)

3 participants