Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #84 from ANSSI-FR/dev
Browse files Browse the repository at this point in the history
Merge branch dev
  • Loading branch information
tpo-anssi authored Feb 13, 2017
2 parents 864b51a + 29e00ae commit 03f23f4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
3 changes: 1 addition & 2 deletions poli/views/apiview.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,7 @@ def api_get_sample_id_from_hash(shash):
abort(400, "Invalid hash length")
if sample is not None:
return jsonify({'sample_id': sample.id})
else:
abort(404)
return jsonify({'sample_id': None})


@apiview.route('/samples/<int:sid>/download/')
Expand Down
3 changes: 2 additions & 1 deletion poli/views/webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def before_request():
Affects global variables for each request
"""
g.user = current_user
g.samples = Sample.query.order_by(Sample.id).limit(15).all()
# Query the last 15 samples for displaying in the index page
g.samples = Sample.query.order_by(Sample.id.desc()).limit(15).all()


"""
Expand Down
15 changes: 9 additions & 6 deletions poliapi/mainapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ class SampleModule(MainModule):
Uses the sample endpoint
"""

def __init__(self):
super(SampleModule, self).__init__()
def __init__(self, server="127.0.0.1", server_port=5000,
base_uri='/api/1.0/'):
super(SampleModule, self).__init__(server, server_port, base_uri)

def send_sample(self, filename, tlp):
"""
Expand Down Expand Up @@ -178,8 +179,9 @@ class FamilyModule(MainModule):
Utilities to manage families
"""

def __init__(self):
super(FamilyModule, self).__init__()
def __init__(self, server="127.0.0.1", server_port=5000,
base_uri='/api/1.0/'):
super(FamilyModule, self).__init__(server, server_port, base_uri)

def create_family(self, name, parent=None, tlp_level=3):
"""
Expand Down Expand Up @@ -229,8 +231,9 @@ class YaraModule(MainModule):
Manage yara rules
"""

def __init__(self):
super(YaraModule, self).__init__()
def __init__(self, server="127.0.0.1", server_port=5000,
base_uri='/api/1.0/'):
super(YaraModule, self).__init__(server, server_port, base_uri)

def create_yara(self, name, rule, tlp_level=2):
"""
Expand Down

0 comments on commit 03f23f4

Please sign in to comment.