Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should a duplicate object trigger a failure status-details #131

Closed
saaj opened this issue Jul 16, 2020 · 2 comments
Closed

Should a duplicate object trigger a failure status-details #131

saaj opened this issue Jul 16, 2020 · 2 comments

Comments

@saaj
Copy link

saaj commented Jul 16, 2020

Medallion running on the MongoDB backend, when requested to add duplicate objects into a collection treats them as failures, which is represented in the returned status resource's status-details structures. They look like this and are created here:

{
    "id": "identity--f8aab11f-9085-4baa-b06c-4b11a0ef80ee",
    "message": "Unable to process object because an identical entry already exists in collection '62a0ae...'.",
    "version": "2000-01-01T00:00:00Z"
}

TAXII 2.1 spec in 5.5 Add Objects says:

If a client publishes an exact duplicate of an Object already present in the Collection, the server MUST not return an error for that Object.

It's not fully clear what the spec means by "an error for that Object". There's the error message type, defined in 3.6.1 Error Message. But it's per request, not per object. Per object error in the context of request to POST /{api-root}/collections/{id}/objects/ can only be a status-details.

If the above interpretation is correct, then it's a bug in Medallion.

@zrush-mitre
Copy link
Contributor

Hi @saaj,

We currently do not treat a failure status as an error, so the way the server responds to duplicate objects is not in violation of the spec. While the language is slightly confusing, if anything this is a problem with the specification language, and not the medallion server.

Let me know if I need to clarify my answer any more, or if you have other questions.

Thanks.

@saaj
Copy link
Author

saaj commented Jul 17, 2020

Thanks for clarification @zrush-mitre. Closing this issue as your answer sufficiently covers Medallion's interpretation.

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

No branches or pull requests

2 participants