Skip to content

Commit

Permalink
Merge pull request #304 from CybercentreCanada/single-filescore-key
Browse files Browse the repository at this point in the history
Single filescore key
  • Loading branch information
cccs-douglass authored Jul 22, 2021
2 parents 1b40d29 + edff383 commit 3361f52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion assemblyline/odm/messages/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Submission(odm.Model):
metadata: Dict[str, str] = odm.FlattenedObject(default={}) # Metadata submitted with the file
notification: Notification = odm.Compound(Notification, default={}) # Notification queue parameters
params: SubmissionParams = odm.Compound(SubmissionParams) # Parameters of the submission
scan_key: str = odm.Optional(odm.Keyword())


def from_datastore_submission(submission: DatabaseSubmission):
Expand All @@ -31,7 +32,8 @@ def from_datastore_submission(submission: DatabaseSubmission):
'sid': submission.sid,
'files': submission.files,
'metadata': submission.metadata,
'params': submission.params
'params': submission.params,
'scan_key': submission.scan_key
})


Expand Down
4 changes: 4 additions & 0 deletions assemblyline/odm/models/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ class Submission(odm.Model):
times = odm.Compound(Times, default={}) # Timing bloc
verdict = odm.Compound(Verdict, default={}) # Verdict timing

# the filescore key, used in deduplication. This is a non-unique key, that is
# shared by submissions that may be processed as duplicates.
scan_key = odm.Optional(odm.Keyword(store=False, index=False))

def is_submit(self):
return self.state == 'submitted'

Expand Down

0 comments on commit 3361f52

Please sign in to comment.