Skip to content

Commit

Permalink
feat(/metadata): include allow_document_uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
wbaid committed Oct 21, 2019
1 parent 9062742 commit 0db9f22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion securedrop/source_app/api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import platform

from flask import Blueprint, make_response
from flask import Blueprint, current_app, make_response

import version

Expand All @@ -12,6 +12,9 @@ def make_blueprint(config):
@view.route('/metadata')
def metadata():
meta = {
'allow_document_uploads': current_app.config.get(
'ALLOW_DOCUMENT_UPLOADS',
True),
'gpg_fpr': config.JOURNALIST_KEY,
'sd_version': version.__version__,
'server_os': platform.linux_distribution()[1],
Expand Down
2 changes: 2 additions & 0 deletions securedrop/tests/test_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,8 @@ def test_metadata_route(config, source_app):
resp = app.get(url_for('api.metadata'))
assert resp.status_code == 200
assert resp.headers.get('Content-Type') == 'application/json'
assert resp.json.get('allow_document_uploads') ==\
source_app.config.get('ALLOW_DOCUMENT_UPLOADS', True)
assert resp.json.get('sd_version') == version.__version__
assert resp.json.get('server_os') == '16.04'
assert resp.json.get('supported_languages') ==\
Expand Down

0 comments on commit 0db9f22

Please sign in to comment.