-
Notifications
You must be signed in to change notification settings - Fork 29
Fix/entities are not optional in maltego transform request message #39
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
Open
reenberg
wants to merge
2
commits into
allfro:master
Choose a base branch
from
reenberg:fix/entities-are-not-optional-in-MaltegoTransformRequestMessage
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| Copy this folder into path and rename it to safedexml or if you have installed | ||
| safedexml from pip, overwrite the dist-packages path | ||
| /usr/local/lib/python2.7/dist-packages/safedexml/ with the content. | ||
|
|
||
| This will generate some debug output. | ||
|
|
||
| It is advised to only copy one of the files at a time (e.g., only __init__.py or | ||
| only fields.py) as their output will mingle and it will be near to impossible to | ||
| tell them apart. Yest the output is wery simple and could probably have been | ||
| made smarter... | ||
|
|
||
| Currently the output of __init__.py is the 'best', in the sense that it tries to | ||
| nest the output and indent it so, it is easier to follow function calls, and the | ||
| 'parsing logic' within the parse() function. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line needs to stay in as it provides backwards compatibility to the older Canari API for a MaltegoTransformRequestMessage. If you take a look below, there is a property called fields which provides access to the first input entity's fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wan't to make sure I understand your argument for backwards compatability.
You are saying that someone might be accessing a private/internal field (as indicated by the leading underscore) of the request message class?
In any case, no one should use private/internal fields, besides the library itself.
Currently I can only think of two possible outcomes for setting this value. In the general case, you instantiate the class with no arguments, in which case it gets a non-entity back from self.entity, which results in self._canari_fields being set to the empty dictionary. Aka in this case the field contains no valuable information anyways.
The other, case is that you give a list of entities as argument to the constructor of the request message. However I can't possibly think of an old solution that is using this way of constructing request messages (as the preferred way of adding entities is with appendelement), and also reading the private/internal (which it should not).