···84848585 did = kv.get(handle)
8686 if did is not None and not reload:
8787- print(f"returning cached did for {handle}")
8887 return did
89889089 resolver = DNSResolver()
···9897 if value.startswith("did="):
9998 did = value[4:]
10099 if is_valid_did(did):
101101- print(f"caching did {did} for {handle}")
102100 kv.set(handle, value=did)
103101 return did
104102···122120) -> PdsUrl | None:
123121 pds = kv.get(did)
124122 if pds is not None and not reload:
125125- print(f"returning cached pds for {did}")
126123 return pds
127124128125 doc = await resolve_doc_from_did(client, did)
···131128 pds = doc["service"][0]["serviceEndpoint"]
132129 if pds is None:
133130 return None
134134- print(f"caching pds {pds} for {did}")
135131 kv.set(did, value=pds)
136132 return pds
137133···165161166162 authserver_url = kv.get(pds_url)
167163 if authserver_url is not None and not reload:
168168- print(f"returning cached authserver for PDS {pds_url}")
169164 return authserver_url
170165171166 assert is_safe_url(pds_url)
···175170 return None
176171 parsed: dict[str, list[str]] = await response.json()
177172 authserver_url = parsed["authorization_servers"][0]
178178- print(f"caching authserver {authserver_url} for PDS {pds_url}")
179173 kv.set(pds_url, value=authserver_url)
180174 return authserver_url
181175