mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
6adf9dee3c
commit
ba0518eb56
|
@ -4551,7 +4551,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
get_domain_from_actor(share_actor)
|
get_domain_from_actor(share_actor)
|
||||||
remove_shared_item(base_dir,
|
remove_shared_item(base_dir,
|
||||||
share_nickname, share_domain, item_id,
|
share_nickname, share_domain, item_id,
|
||||||
http_prefix, domain_full, 'shares')
|
'shares')
|
||||||
|
|
||||||
if calling_domain.endswith('.onion') and onion_domain:
|
if calling_domain.endswith('.onion') and onion_domain:
|
||||||
origin_path_str = 'http://' + onion_domain + users_path
|
origin_path_str = 'http://' + onion_domain + users_path
|
||||||
|
@ -4624,7 +4624,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
get_domain_from_actor(share_actor)
|
get_domain_from_actor(share_actor)
|
||||||
remove_shared_item(base_dir,
|
remove_shared_item(base_dir,
|
||||||
share_nickname, share_domain, item_id,
|
share_nickname, share_domain, item_id,
|
||||||
http_prefix, domain_full, 'wanted')
|
'wanted')
|
||||||
|
|
||||||
if calling_domain.endswith('.onion') and onion_domain:
|
if calling_domain.endswith('.onion') and onion_domain:
|
||||||
origin_path_str = 'http://' + onion_domain + users_path
|
origin_path_str = 'http://' + onion_domain + users_path
|
||||||
|
|
|
@ -656,9 +656,8 @@ def post_message_to_outbox(session, translate: {},
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: handle undo share uploads')
|
print('DEBUG: handle undo share uploads')
|
||||||
outbox_undo_share_upload(base_dir, http_prefix,
|
outbox_undo_share_upload(base_dir, post_to_nickname, domain,
|
||||||
post_to_nickname, domain,
|
message_json, debug)
|
||||||
port, message_json, debug)
|
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: handle actor updates from c2s')
|
print('DEBUG: handle actor updates from c2s')
|
||||||
|
|
13
shares.py
13
shares.py
|
@ -119,9 +119,7 @@ def _get_valid_shared_item_id(actor: str, display_name: str) -> str:
|
||||||
|
|
||||||
|
|
||||||
def remove_shared_item(base_dir: str, nickname: str, domain: str,
|
def remove_shared_item(base_dir: str, nickname: str, domain: str,
|
||||||
item_id: str,
|
item_id: str, shares_file_type: str) -> None:
|
||||||
http_prefix: str, domain_full: str,
|
|
||||||
shares_file_type: str) -> None:
|
|
||||||
"""Removes a share for a person
|
"""Removes a share for a person
|
||||||
"""
|
"""
|
||||||
shares_filename = \
|
shares_filename = \
|
||||||
|
@ -992,8 +990,7 @@ def send_undo_wanted_via_server(base_dir: str, session,
|
||||||
return undo_share_json
|
return undo_share_json
|
||||||
|
|
||||||
|
|
||||||
def get_shared_items_catalog_via_server(base_dir, session,
|
def get_shared_items_catalog_via_server(session, nickname: str, password: str,
|
||||||
nickname: str, password: str,
|
|
||||||
domain: str, port: int,
|
domain: str, port: int,
|
||||||
http_prefix: str, debug: bool,
|
http_prefix: str, debug: bool,
|
||||||
signing_priv_key_pem: str) -> {}:
|
signing_priv_key_pem: str) -> {}:
|
||||||
|
@ -1100,8 +1097,7 @@ def outbox_share_upload(base_dir: str, http_prefix: str,
|
||||||
print('DEBUG: shared item received via c2s')
|
print('DEBUG: shared item received via c2s')
|
||||||
|
|
||||||
|
|
||||||
def outbox_undo_share_upload(base_dir: str, http_prefix: str,
|
def outbox_undo_share_upload(base_dir: str, nickname: str, domain: str,
|
||||||
nickname: str, domain: str, port: int,
|
|
||||||
message_json: {}, debug: bool) -> None:
|
message_json: {}, debug: bool) -> None:
|
||||||
""" When a shared item is removed via c2s
|
""" When a shared item is removed via c2s
|
||||||
"""
|
"""
|
||||||
|
@ -1119,10 +1115,9 @@ def outbox_undo_share_upload(base_dir: str, http_prefix: str,
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: displayName missing from Offer')
|
print('DEBUG: displayName missing from Offer')
|
||||||
return
|
return
|
||||||
domain_full = get_full_domain(domain, port)
|
|
||||||
remove_shared_item(base_dir, nickname, domain,
|
remove_shared_item(base_dir, nickname, domain,
|
||||||
message_json['object']['displayName'],
|
message_json['object']['displayName'],
|
||||||
http_prefix, domain_full, 'shares')
|
'shares')
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: shared item removed via c2s')
|
print('DEBUG: shared item removed via c2s')
|
||||||
|
|
||||||
|
|
2
tests.py
2
tests.py
|
@ -1994,7 +1994,7 @@ def test_shared_items_federation(base_dir: str) -> None:
|
||||||
print('Bob can read the shared items catalog on his own instance')
|
print('Bob can read the shared items catalog on his own instance')
|
||||||
signing_priv_key_pem = None
|
signing_priv_key_pem = None
|
||||||
catalog_json = \
|
catalog_json = \
|
||||||
get_shared_items_catalog_via_server(bob_dir, session_bob,
|
get_shared_items_catalog_via_server(session_bob,
|
||||||
'bob', bob_password,
|
'bob', bob_password,
|
||||||
bob_domain, bob_port,
|
bob_domain, bob_port,
|
||||||
http_prefix, True,
|
http_prefix, True,
|
||||||
|
|
Loading…
Reference in New Issue