mirror of https://github.com/nucypher/nucypher.git
More cleanups throughout Character.
parent
78cf0b66de
commit
c7d2d97d72
|
@ -298,7 +298,8 @@ class Alice(Character):
|
|||
n: int,
|
||||
):
|
||||
"""
|
||||
Alice dictates a new group of policies.
|
||||
Create a Policy to share uri with bob.
|
||||
Generates KFrags and attaches them.
|
||||
"""
|
||||
kfrags = self.generate_kfrags(bob, m, n)
|
||||
# TODO: Access Alice's private key inside this method.
|
||||
|
@ -432,7 +433,9 @@ class Bob(Character):
|
|||
generated_work_orders = {}
|
||||
|
||||
if not treasure_map_to_use:
|
||||
raise ValueError("Bob doesn't have a TreasureMap to match any of these capsules: {}".format(capsules))
|
||||
raise ValueError(
|
||||
"Bob doesn't have a TreasureMap to match any of these capsules: {}".format(
|
||||
capsules))
|
||||
|
||||
for ursula_dht_key in treasure_map_to_use:
|
||||
ursula = self._ursulas[ursula_dht_key]
|
||||
|
@ -521,7 +524,6 @@ class Ursula(Character):
|
|||
|
||||
def attach_server(self, ksize=20, alpha=3, id=None,
|
||||
storage=None, *args, **kwargs):
|
||||
|
||||
# TODO: Network-wide deterministic ID generation (ie, auction or
|
||||
# whatever) See #136.
|
||||
if not id:
|
||||
|
@ -554,7 +556,6 @@ class Ursula(Character):
|
|||
return self.dht_port, self.dht_interface, self.dht_ttl
|
||||
|
||||
class InterfaceDHTKey:
|
||||
|
||||
def __init__(self, seal, interface_hrac):
|
||||
self.pubkey_sig_bytes = bytes(seal)
|
||||
self.interface_hrac = interface_hrac
|
||||
|
@ -642,7 +643,6 @@ class Ursula(Character):
|
|||
TODO: Validate that the kfrag being saved is pursuant to an approved
|
||||
Policy (see #121).
|
||||
"""
|
||||
from nkms.policy.models import Contract # Avoid circular import
|
||||
hrac = binascii.unhexlify(hrac_as_hex)
|
||||
policy_message_kit = MessageKit.from_bytes(request.body)
|
||||
# group_payload_splitter = BytestringSplitter(PublicKey)
|
||||
|
@ -699,7 +699,7 @@ class Ursula(Character):
|
|||
|
||||
for capsule in work_order.capsules:
|
||||
# TODO: Sign the result of this. See #141.
|
||||
cfrag_byte_stream += bytes(umbral.umbral.reencrypt(kfrag, capsule))
|
||||
cfrag_byte_stream += bytes(pre.reencrypt(kfrag, capsule))
|
||||
|
||||
# TODO: Put this in Ursula's datastore
|
||||
self._work_orders.append(work_order)
|
||||
|
|
Loading…
Reference in New Issue