tangled
alpha
login
or
join now
citizen428.net
/
pdsls
forked from
pds.ls/pdsls
0
fork
atom
atproto explorer
0
fork
atom
overview
issues
pulls
pipelines
fix handle resolution
handle.invalid
5 months ago
2e07016d
f8898e18
verified
This commit was signed with the committer's
known signature
.
handle.invalid
SSH Key Fingerprint:
SHA256:mBrT4x0JdzLpbVR95g1hjI1aaErfC02kmLRkPXwsYCk=
+8
-14
3 changed files
expand all
collapse all
unified
split
src
components
navbar.tsx
utils
api.ts
views
repo.tsx
+1
-1
src/components/navbar.tsx
···
43
43
didDocCache[props.params.repo]?.alsoKnownAs
44
44
?.filter((alias) => alias.startsWith("at://"))[0]
45
45
.split("at://")[1] ?? props.params.repo;
46
46
-
if (hdl !== handle()) {
46
46
+
if (hdl !== handle() || validHandle() === undefined) {
47
47
setValidHandle(undefined);
48
48
setHandle(hdl);
49
49
setValidHandle(await validateHandle(hdl as Handle, props.params.repo as Did));
+6
-11
src/utils/api.ts
···
12
12
DohJsonHandleResolver,
13
13
PlcDidDocumentResolver,
14
14
WellKnownHandleResolver,
15
15
-
XrpcHandleResolver,
16
15
} from "@atcute/identity-resolver";
17
16
import { Did, Handle } from "@atcute/lexicons";
18
17
import { isHandle } from "@atcute/lexicons/syntax";
···
28
27
},
29
28
});
30
29
31
31
-
const handleResolver = new XrpcHandleResolver({
32
32
-
serviceUrl: "https://public.api.bsky.app",
30
30
+
const handleResolver = new CompositeHandleResolver({
31
31
+
strategy: "dns-first",
32
32
+
methods: {
33
33
+
dns: new DohJsonHandleResolver({ dohUrl: "https://dns.google/resolve?" }),
34
34
+
http: new WellKnownHandleResolver(),
35
35
+
},
33
36
});
34
37
35
38
const didPDSCache: Record<string, string> = {};
···
76
79
77
80
const validateHandle = async (handle: Handle, did: Did) => {
78
81
if (!isHandle(handle)) return false;
79
79
-
80
80
-
const handleResolver = new CompositeHandleResolver({
81
81
-
strategy: "dns-first",
82
82
-
methods: {
83
83
-
dns: new DohJsonHandleResolver({ dohUrl: "https://dns.google/resolve?" }),
84
84
-
http: new WellKnownHandleResolver(),
85
85
-
},
86
86
-
});
87
82
88
83
let resolvedDid: string;
89
84
try {
+1
-2
src/views/repo.tsx
···
8
8
} from "@atcute/did-plc";
9
9
import { DidDocument } from "@atcute/identity";
10
10
import { ActorIdentifier, Handle } from "@atcute/lexicons";
11
11
-
import { resolveHandle } from "@atcute/oauth-browser-client";
12
11
import { A, useLocation, useNavigate, useParams } from "@solidjs/router";
13
12
import { createResource, createSignal, ErrorBoundary, For, Show, Suspense } from "solid-js";
14
13
import { Backlinks } from "../components/backlinks.jsx";
15
14
import { Button } from "../components/button.jsx";
16
15
import { TextInput } from "../components/text-input.jsx";
17
16
import Tooltip from "../components/tooltip.jsx";
18
18
-
import { didDocCache, resolvePDS } from "../utils/api.js";
17
17
+
import { didDocCache, resolveHandle, resolvePDS } from "../utils/api.js";
19
18
import { localDateFromTimestamp } from "../utils/date.js";
20
19
import { createOperationHistory, DiffEntry, groupBy } from "../utils/plc-logs.js";
21
20
import { BlobView } from "./blob.jsx";