-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove notification_email job listing filter parameter not supported …
…by aggreation pipeline with non-deterministic decrypt values
- Loading branch information
1 parent
e0b9efe
commit 8aa3d79
Showing
6 changed files
with
26 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import contextlib | ||
import copy | ||
import datetime | ||
import logging | ||
import os | ||
|
@@ -34,6 +35,7 @@ | |
from weaver.datatype import Job, Service | ||
from weaver.execute import ExecuteMode, ExecuteResponse, ExecuteTransmissionMode | ||
from weaver.formats import ContentType | ||
from weaver.notify import decrypt_email | ||
from weaver.processes.wps_testing import WpsTestProcess | ||
from weaver.status import JOB_STATUS_CATEGORIES, Status, StatusCategory | ||
from weaver.utils import get_path_kvp, now | ||
|
@@ -543,6 +545,7 @@ def test_get_jobs_page_out_of_range(self): | |
assert "limit" in str(resp.json["cause"]) and "less than minimum" in str(resp.json["cause"]) | ||
assert "limit" in resp.json["value"] and resp.json["value"]["limit"] == str(0) | ||
|
||
@pytest.mark.skip(reason="Obsolete feature. It is not possible to filter by encrypted notification email anymore.") | ||
def test_get_jobs_by_encrypted_email(self): | ||
""" | ||
Verifies that literal email can be used as search criterion although not saved in plain text within db. | ||
|
@@ -562,13 +565,20 @@ def test_get_jobs_by_encrypted_email(self): | |
resp = self.app.post_json(path, params=body, headers=self.json_headers) | ||
assert resp.status_code == 201 | ||
assert resp.content_type == ContentType.APP_JSON | ||
job_id = resp.json["jobID"] | ||
job_id = resp.json["jobID"] | ||
|
||
# submit a second job just to make sure email doesn't match it as well | ||
other_body = copy.deepcopy(body) | ||
other_body["notification_email"] = "[email protected]" | ||
resp = self.app.post_json(path, params=other_body, headers=self.json_headers) | ||
assert resp.status_code == 201 | ||
|
||
# verify the email is not in plain text | ||
job = self.job_store.fetch_by_id(job_id) | ||
assert job.notification_email != email and job.notification_email is not None | ||
assert int(job.notification_email, 16) != 0 # email should be encrypted with hex string | ||
assert decrypt_email(job.notification_email, self.settings) == email, "Email should be recoverable." | ||
|
||
# make sure that jobs searched using email are found with encryption transparently for the user | ||
path = get_path_kvp(sd.jobs_service.path, detail="true", notification_email=email) | ||
resp = self.app.get(path, headers=self.json_headers) | ||
assert resp.status_code == 200 | ||
|
This file contains 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 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 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 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