Skip to content

feat(asset): add asset categorization support#297

Open
SamuelHassine wants to merge 1 commit into
mainfrom
feature/asset-categorization
Open

feat(asset): add asset categorization support#297
SamuelHassine wants to merge 1 commit into
mainfrom
feature/asset-categorization

Conversation

@SamuelHassine

Copy link
Copy Markdown
Member

Summary

Adds the canonical two-level asset taxonomy to pyoaev so producers (collectors, custom
integrations) can classify endpoints with the new fields introduced in OpenAEV.

Changes

  • New pyoaev.asset_types module with AssetCategory, AssetSubCategory, CloudProvider and
    AssetCriticality enums, exported from the package.
  • EndpointManager: endpoint_platform / endpoint_arch are now optional (the platform defaults
    them to Unknown); added optional attrs asset_category, asset_subcategory,
    asset_criticality, asset_internet_facing, asset_cloud_provider, asset_cloud_native_type,
    asset_cloud_region, asset_metadata and endpoint_url.
  • Version bump.

Test plan

  • test/apis/endpoint/test_endpoint.py: upsert a web application without platform/arch and a cloud
    resource; the categorization fields are sent on the wire.

Related

Dependency of OpenAEV-Platform/openaev#6452 (asset categorization).

Add the canonical two-level asset taxonomy to pyoaev so producers (collectors, custom
integrations) can set the new categorization fields on endpoints:

- new AssetCategory / AssetSubCategory / CloudProvider / AssetCriticality enums in
  pyoaev.asset_types, exported from the package
- EndpointManager: endpoint_platform / endpoint_arch are now optional; add optional attrs
  asset_category, asset_subcategory, asset_criticality, asset_internet_facing,
  asset_cloud_provider, asset_cloud_native_type, asset_cloud_region, asset_metadata and
  endpoint_url
- bump the package version

Relates to OpenAEV-Platform/openaev#6452
Copilot AI review requested due to automatic review settings June 27, 2026 13:43
@github-actions github-actions Bot added the filigran team Item from the Filigran team. label Jun 27, 2026
@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.84%. Comparing base (8283bfe) to head (c5ab481).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #297      +/-   ##
==========================================
+ Coverage   73.58%   74.84%   +1.25%     
==========================================
  Files          54       55       +1     
  Lines        2404     2512     +108     
==========================================
+ Hits         1769     1880     +111     
+ Misses        635      632       -3     
Flag Coverage Δ
connectors 74.84% <100.00%> (+1.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Adds first-class asset categorization support to the Python client so endpoint producers can send the canonical (backend-aligned) asset taxonomy fields to OpenAEV.

Changes:

  • Introduces pyoaev.asset_types with AssetCategory, AssetSubCategory, CloudProvider, and AssetCriticality enums and exports them from pyoaev.
  • Expands EndpointManager allowed create payload attributes to include asset categorization/cloud metadata fields and makes platform/arch optional.
  • Bumps package version and adds endpoint upsert tests for categorization payload serialization.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
test/apis/endpoint/test_endpoint.py Adds tests asserting categorization fields are serialized on endpoint upsert calls.
pyoaev/asset_types.py New module defining canonical asset taxonomy and related enums as str enums.
pyoaev/apis/endpoint.py Updates endpoint create-attrs to support new categorization/cloud fields and relax platform/arch requirements.
pyoaev/init.py Version bump and re-exports new enums from the package root.

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

Comment on lines +70 to +73
_, kwargs = mock_request.call_args
self.assertEqual(kwargs["method"], "post")
self.assertEqual(kwargs["url"], "url/api/endpoints/agentless/upsert")
self.assertEqual(kwargs["json"]["asset_category"], "WEB_APPLICATION")
Comment on lines +89 to +92
_, kwargs = mock_request.call_args
self.assertEqual(kwargs["url"], "url/api/endpoints/agentless/upsert")
self.assertEqual(kwargs["json"]["asset_cloud_provider"], "AWS")
self.assertEqual(kwargs["json"]["asset_cloud_native_type"], "s3_bucket")
Comment thread pyoaev/apis/endpoint.py
Comment on lines +16 to +18
# endpoint_platform / endpoint_arch are optional: agents and collectors always provide
# them, while category-driven assets (web app, cloud, network, ...) may omit them - the
# platform defaults them to "Unknown" server-side.
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.

3 participants