eclecticiq / OpenTAXII

TAXII server implementation in Python from EclecticIQ
BSD 3-Clause "New" or "Revised" License
185 stars 88 forks source link

"spec_version" property #237

Open magsen opened 1 year ago

magsen commented 1 year ago

When getting a specific object or a list of object ( GET {api-root}/collections/{id}/objects/{object-id}/ ), the property field "spec_version" is equals to the "type", it should be "2.1" (or others version spec).

OBSERVED:

{
  "more": false,
  "objects": [
    {
      "id": "marking-definition--613f2e26-407d-48c7-9eca-b8e91df99dc9",
      "type": "marking-definition",
      "spec_version": "marking-definition",
      "name": "TLP:WHITE",
      "created": "2017-01-20T00:00:00.000Z",
      "modified": "2022-07-29T13:42:44.472979Z",
      "definition": {
        "tlp": "white"
      },
      "definition_type": "tlp"
    }
  ]
}

EXPECTED:

{
  "more": false,
  "objects": [
    {
      "id": "marking-definition--613f2e26-407d-48c7-9eca-b8e91df99dc9",
      "type": "marking-definition",
      "spec_version": "2.1",
      "name": "TLP:WHITE",
      "created": "2017-01-20T00:00:00.000Z",
      "modified": "2022-07-29T13:42:44.472979Z",
      "definition": {
        "tlp": "white"
      },
      "definition_type": "tlp"
    }
  ]
}

You may investigate theses lines: https://github.com/eclecticiq/OpenTAXII/blob/7f585054276272bfcc3c3267b0d471bb740968d0/opentaxii/server.py#L658 https://github.com/eclecticiq/OpenTAXII/blob/7f585054276272bfcc3c3267b0d471bb740968d0/opentaxii/server.py#L741