Skip to content

Bugfix/adding version fix#280

Closed
meetghodasara-crest wants to merge 2 commits into
eclecticiq:masterfrom
meetghodasara-crest:bugfix/adding-version-fix
Closed

Bugfix/adding version fix#280
meetghodasara-crest wants to merge 2 commits into
eclecticiq:masterfrom
meetghodasara-crest:bugfix/adding-version-fix

Conversation

@meetghodasara-crest
Copy link
Copy Markdown

  • Modified code to store actual serialized object without adding or removing any fields
  • Adding versions in some of the objects where object type does not support versioning

Copy link
Copy Markdown
Contributor

@eric-eclecticiq eric-eclecticiq left a comment

Choose a reason for hiding this comment

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

It would require to add tests.

self.db.session.commit()
job_details = []
for obj in objects:
modified_date = obj.get("modified") or obj.get("created") or datetime.datetime.now(datetime.timezone.utc).strftime(DATETIMEFORMAT)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If a STIX object is not versioned (and therefore does not have a modified timestamp) then this version parameter MUST use the created timestamp. If an object does not have a created or modified timestamp or any other version information that can be used, then the server should use a value for the version that is consistent to the server.

So using created_at makes sense however I disagree with seting datetime.now at this point. This is hardly going to match the DB on version. It should probably go the else branch immediately to look for any version. Then, if not found, the version may be assigned to datetime.now.

Comment thread opentaxii/server.py
{
"id": obj.id,
"type": obj.type,
"spec_version": obj.type,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why ?

@eric-eclecticiq
Copy link
Copy Markdown
Contributor

A different implementation has been added with #280 .

@eric-eclecticiq
Copy link
Copy Markdown
Contributor

Thank you for your contribution in OpenTAXII.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants