Commit f8904e9
authored
auth: did:nostr resolver prefers local index before external (JavaScriptSolidServer#423) (JavaScriptSolidServer#424)
When the requesting Nostr pubkey belongs to a local account, resolve
to its WebID via the in-process well-known index instead of round-
tripping through the configured external resolver. The local binding
is already verified by construction (the index only admits VMs that
are declared in `verificationMethod` AND referenced from
`authentication` of a local profile), so we also skip the backlink
verification the external path requires.
Eliminates the most common SSO failure mode: user signs into their
own pod, the auth path tries the external resolver
(`nostr.social/.well-known/did/nostr/<pubkey>`) and the external host
is unreachable (network down, SSL cert expired, etc.). With this
change the external resolver is only consulted for cross-pod pubkeys
that no local account claims.
`verifyNostrAuth` (src/auth/nostr.js) already tries the local
resolver first in its chain; duplicating that ordering inside
`resolveDidNostrToWebId` itself is defense-in-depth — any caller from
another code path (or any future caller that forgets the chain
ordering) still gets the cheap, reliable answer for the dominant
case. Dynamic import keeps the IdP module optional for builds that
don't use it.1 parent 1ee75c7 commit f8904e9
1 file changed
Lines changed: 38 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
168 | 171 | | |
169 | 172 | | |
170 | 173 | | |
171 | | - | |
| 174 | + | |
172 | 175 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
177 | 189 | | |
178 | 190 | | |
179 | 191 | | |
| |||
193 | 205 | | |
194 | 206 | | |
195 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
196 | 226 | | |
197 | 227 | | |
198 | 228 | | |
| |||
0 commit comments