Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
cginmn committed Mar 30, 2021
2 parents 380e4be + a1931dd commit 34b97f7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "poetry.lock",
"lines": null
},
"generated_at": "2021-03-24T19:39:53Z",
"generated_at": "2021-03-29T22:29:00Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -154,13 +154,13 @@
{
"hashed_secret": "1348b145fa1a555461c1b790a2f66614781091e9",
"is_verified": false,
"line_number": 1090,
"line_number": 1104,
"type": "Private Key"
},
{
"hashed_secret": "227dea087477346785aefd575f91dd13ab86c108",
"is_verified": false,
"line_number": 1113,
"line_number": 1127,
"type": "Base64 High Entropy String"
}
],
Expand Down
7 changes: 4 additions & 3 deletions fence/blueprints/data/indexd.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ def get_signed_url_for_file(action, file_id, file_name=None):
file_name=file_name,
)

create_presigned_url_audit_log(
protocol=requested_protocol, indexed_file=indexed_file, action=action
)
if action == "download": # for now only record download requests
create_presigned_url_audit_log(
protocol=requested_protocol, indexed_file=indexed_file, action=action
)

return {"url": signed_url}

Expand Down
14 changes: 14 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,20 @@ def indexd_client(app, request):
"created_date": "",
"updated_date": "",
}
elif protocol == "no_urls":
record = {
"did": "",
"baseid": "",
"rev": "",
"size": 10,
"file_name": "file2",
"urls": [],
"hashes": {},
"acl": ["phs000178", "phs000218"],
"form": "",
"created_date": "",
"updated_date": "",
}
elif protocol == "nonexistent_guid":
# throw an error when requested to simulate the GUID not existing
# TODO (rudyardrichter, 2018-11-03): consolidate things needing to do this patch
Expand Down
4 changes: 3 additions & 1 deletion tests/data/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ def test_indexd_download_file(


@pytest.mark.parametrize(
"indexd_client", ["gs", "s3", "gs_acl", "s3_acl", "s3_external"], indirect=True
"indexd_client",
["gs", "s3", "gs_acl", "s3_acl", "s3_external", "no_urls"],
indirect=True,
)
def test_indexd_upload_file(
client,
Expand Down

0 comments on commit 34b97f7

Please sign in to comment.