cleanup stale consider_arrangement certificate filepaths

pull/447/head
Kieran Prasch 2018-09-24 18:37:25 -07:00
parent 4b7fcd318e
commit 17d35a23ed
3 changed files with 9 additions and 10 deletions

View File

@ -7,11 +7,11 @@ from umbral.fragments import CapsuleFrag
class RestMiddleware:
def consider_arrangement(self, arrangement, certificate_filepath):
def consider_arrangement(self, arrangement):
node = arrangement.ursula
response = requests.post("https://{}/consider_arrangement".format(node.rest_interface),
bytes(arrangement),
verify=certificate_filepath)
verify=node.certificate_filepath)
if not response.status_code == 200:
raise RuntimeError("Bad response: {}".format(response.content))

View File

@ -241,14 +241,14 @@ class Policy:
try:
ursula.verify_node(network_middleware, accept_federated_only=arrangement.federated)
except ursula.InvalidNode:
# TODO: What do we actually do here? Report this at least (355)? Maybe also have another bucket for invalid nodes?
# It's possible that nothing sordid is happening here; this node may be updating its interface info or rotating a signing key
# and we learned about a previous one.
# TODO: What do we actually do here? Report this at least (355)?
# Maybe also have another bucket for invalid nodes?
# It's possible that nothing sordid is happening here;
# this node may be updating its interface info or rotating a signing key
# and we learned about a previous one.
raise
certificate_filepath = os.path.join(self.alice.known_metadata_dir, ursula.certificate_filename)
negotiation_response = network_middleware.consider_arrangement(arrangement=arrangement,
certificate_filepath=certificate_filepath)
negotiation_response = network_middleware.consider_arrangement(arrangement=arrangement)
# TODO: check out the response: need to assess the result and see if we're actually good to go.
negotiation_result = negotiation_response.status_code == 200

View File

@ -31,8 +31,7 @@ class MockRestMiddleware(RestMiddleware):
"Can't find an Ursula with port {} - did you spin up the right test ursulas?".format(port))
return mock_client
def consider_arrangement(self, arrangement, certificate_filepath):
# assert os.path.isfile(certificate_filepath)
def consider_arrangement(self, arrangement):
mock_client = self._get_mock_client_by_ursula(arrangement.ursula)
response = mock_client.post("http://localhost/consider_arrangement", bytes(arrangement))
assert response.status_code == 200