CybOXProject / mixbox

A library of common code leveraged by python-cybox, python-maec, and python-stix
BSD 3-Clause "New" or "Revised" License
8 stars 15 forks source link

Add common (namespace, xml typename) => classname mapping/registration framework #21

Open bworrell opened 8 years ago

bworrell commented 8 years ago

The way we map @xsi:type to Python classes (and resolve classes for @xsi:type) is different between python-stix, python-cybox, and python-maec.

We could probably factor out that code into a common module and modify existing code to register and resolve extensions via that module.

The may be related to https://github.com/CybOXProject/python-cybox/issues/274 and could require a good amount of rethinking what XML metadata we attach to Entity classes.

Look at stix/__init__.py and stix/bindings/__init__.py as examples of what I did in python-stix (it could be done a lot better).