Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Commit

Permalink
Removed unused get_actor code
Browse files Browse the repository at this point in the history
Signed-off-by: John Andersen <[email protected]>
  • Loading branch information
pdxjohnny committed Oct 23, 2023
1 parent 0ed4298 commit f9f7206
Showing 1 changed file with 1 addition and 35 deletions.
36 changes: 1 addition & 35 deletions scitt_emulator/federation_activitypub_bovine.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,39 +39,6 @@
import pprint


@dataclasses.dataclass
class Follow:
actor_id: str
domain: str = None


async def get_actor_url(
domain: str,
handle_name: str = None,
did_key: str = None,
session: aiohttp.ClientSession = None,
):
if did_key:
lookup = did_key
elif handle_name:
# Get domain and port without protocol
url_parse_result = urllib.parse.urlparse(domain)
actor_id = f"{handle_name}@{url_parse_result.netloc}"
lookup = f"acct:{actor_id}"
else:
raise ValueError(
f"One of the following keyword arguments must be provided: handle_name, did_key"
)
async with contextlib.AsyncExitStack() as async_exit_stack:
# Create session if not given
if not session:
session = await async_exit_stack.enter_async_context(
aiohttp.ClientSession(trust_env=True),
)
url, _ = await lookup_uri_with_webfinger(session, lookup, domain=domain)
return url


class SCITTFederationActivityPubBovine(SCITTFederation):
def __init__(self, app, signals, config_path):
super().__init__(app, signals, config_path)
Expand Down Expand Up @@ -154,7 +121,7 @@ async def handle(
data: dict,
# config.toml arguments
signals: SCITTSignals = None,
following: dict[str, Follow] = None,
following: dict[str, dict] = None,
raise_on_follow_failure: bool = False,
# handler arguments
handler_event: HandlerEvent = None,
Expand All @@ -179,7 +146,6 @@ async def federate_created_entries_pass_client(
),
client,
)
# print(signals.federation.created_entry.connect(federate_created_entries))
# Preform ActivityPub related init
if following:
try:
Expand Down

0 comments on commit f9f7206

Please sign in to comment.