@ghostlytools/cli 1.10.5 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -22
- package/SKILL.md +8 -5
- package/dist/assets/api-B-52sVYp.js +3 -0
- package/dist/assets/{api-DppWqAP3.js → api-CTqIcdu7.js} +532 -197
- package/dist/assets/api-CTqIcdu7.js.map +1 -0
- package/dist/assets/{apiKit-DFIho4Ev.js → apiKit-CZq4Lq4f.js} +97 -13
- package/dist/assets/apiKit-CZq4Lq4f.js.map +1 -0
- package/dist/assets/{apps-yBnbEtfV.js → apps-C_X0zgSG.js} +16 -4
- package/dist/assets/apps-C_X0zgSG.js.map +1 -0
- package/dist/assets/{apps-1MkGMH8m.js → apps-kRsY9S2S.js} +1 -1
- package/dist/assets/{arkade-bFAS6imn.js → arkade-_aaB7VbW.js} +2 -2
- package/dist/assets/{arkade-bFAS6imn.js.map → arkade-_aaB7VbW.js.map} +1 -1
- package/dist/assets/{backup-ejIX59o7.js → backup-DBg388Ke.js} +1 -1
- package/dist/assets/{backup-vj4J7M3e.js → backup-OTvrmk-w.js} +35 -7
- package/dist/assets/backup-OTvrmk-w.js.map +1 -0
- package/dist/assets/{blobFiles-XZ9PEXYy.js → blobFiles-BmsrvZc3.js} +3 -3
- package/dist/assets/{blobFiles-XZ9PEXYy.js.map → blobFiles-BmsrvZc3.js.map} +1 -1
- package/dist/assets/buttons-4EKtQl-7.js +2 -0
- package/dist/assets/{buttons-BoDMx3Ky.js → buttons-DUu7hxxT.js} +61 -30
- package/dist/assets/buttons-DUu7hxxT.js.map +1 -0
- package/dist/assets/{client-BQArefYa.js → client-DDpZP1R1.js} +55 -10
- package/dist/assets/client-DDpZP1R1.js.map +1 -0
- package/dist/assets/{codec-_MwTUz5E.js → codec-DrryGcPT.js} +2 -2
- package/dist/assets/{codec-_MwTUz5E.js.map → codec-DrryGcPT.js.map} +1 -1
- package/dist/assets/{envelope-CeZBNGX-.js → envelope-Q_rMgoE9.js} +2 -2
- package/dist/assets/{envelope-CeZBNGX-.js.map → envelope-Q_rMgoE9.js.map} +1 -1
- package/dist/assets/{irohWeb-C_Wnw7Q9.js → fedimintSdk-CqTeMdF0.js} +2 -354
- package/dist/assets/fedimintSdk-CqTeMdF0.js.map +1 -0
- package/dist/assets/{fileBytes-DqnfKIkj.js → fileBytes-B0z9A6Le.js} +2 -2
- package/dist/assets/{fileBytes-DqnfKIkj.js.map → fileBytes-B0z9A6Le.js.map} +1 -1
- package/dist/assets/{fileBytes-BABGEF13.js → fileBytes-BLPZq9YU.js} +3 -3
- package/dist/assets/{fileBytes-BABGEF13.js.map → fileBytes-BLPZq9YU.js.map} +1 -1
- package/dist/assets/{fileBytes-CQQK2uOh.js → fileBytes-BtIyoDF2.js} +1 -1
- package/dist/assets/{fileBytesIdb-DrXmDUSy.js → fileBytesIdb-Bmlrl9EO.js} +3 -3
- package/dist/assets/{fileBytesIdb-DrXmDUSy.js.map → fileBytesIdb-Bmlrl9EO.js.map} +1 -1
- package/dist/assets/fileBytesIdb-D8mAK4pF.js +2 -0
- package/dist/assets/{fileBytesOpfs-udKCzcLe.js → fileBytesOpfs-DBS0kbPT.js} +3 -3
- package/dist/assets/{fileBytesOpfs-udKCzcLe.js.map → fileBytesOpfs-DBS0kbPT.js.map} +1 -1
- package/dist/assets/{fixedHosts-B_2Rvyja.js → fixedHosts-BV5GDiTU.js} +3 -3
- package/dist/assets/{fixedHosts-B_2Rvyja.js.map → fixedHosts-BV5GDiTU.js.map} +1 -1
- package/dist/assets/{host-DFLzzKNr.js → host-BlUzZgQL.js} +336 -84
- package/dist/assets/host-BlUzZgQL.js.map +1 -0
- package/dist/assets/{hyperdhtRelay-CV6qMrom.js → hyperdhtRelay-BvI_uNZO.js} +2 -2
- package/dist/assets/{hyperdhtRelay-CV6qMrom.js.map → hyperdhtRelay-BvI_uNZO.js.map} +1 -1
- package/dist/assets/{idb-BHsAqENE.js → idb-CEuoNsTv.js} +16 -5
- package/dist/assets/idb-CEuoNsTv.js.map +1 -0
- package/dist/assets/{groupFiles-D-ZUUHrx.js → irohWeb-CqPN8VPY.js} +469 -16
- package/dist/assets/irohWeb-CqPN8VPY.js.map +1 -0
- package/dist/assets/{main-xO8MnXxD.js → main-vQjlgEnt.js} +409 -126
- package/dist/assets/main-vQjlgEnt.js.map +1 -0
- package/dist/assets/{mainline-Bx184Ixg.js → mainline-p6HOW7sb.js} +2 -2
- package/dist/assets/{mainline-Bx184Ixg.js.map → mainline-p6HOW7sb.js.map} +1 -1
- package/dist/assets/{networkReason-BlQhTbXk.js → networkReason-DMffkiJ6.js} +4 -4
- package/dist/assets/{networkReason-BlQhTbXk.js.map → networkReason-DMffkiJ6.js.map} +1 -1
- package/dist/assets/{nwc-B3-PHX0L.js → nwc-2vH18oNy.js} +4 -4
- package/dist/assets/nwc-2vH18oNy.js.map +1 -0
- package/dist/assets/{nwcProvider-BeQBPB2q.js → nwcProvider-DpeDy0bV.js} +11 -3
- package/dist/assets/nwcProvider-DpeDy0bV.js.map +1 -0
- package/dist/assets/{ownDid-DAzW-Urb.js → ownDid-iKz8u_fM.js} +2 -2
- package/dist/assets/{ownDid-DAzW-Urb.js.map → ownDid-iKz8u_fM.js.map} +1 -1
- package/dist/assets/{words-BvdNuw_v.js → ownStatus-BlRKnM5F.js} +56 -4
- package/dist/assets/ownStatus-BlRKnM5F.js.map +1 -0
- package/dist/assets/{profiles-Bg43mRXu.js → profiles-B5e0TyvS.js} +22 -12
- package/dist/assets/profiles-B5e0TyvS.js.map +1 -0
- package/dist/assets/{registry-CAk2-5BQ.js → registry-Cc_PQb3k.js} +1 -1
- package/dist/assets/{registry-BDnsZJBi.js → registry-CnFO2Pp5.js} +123 -99
- package/dist/assets/registry-CnFO2Pp5.js.map +1 -0
- package/dist/assets/{resolve-UAfshn6j.js → resolve-DI8uAM_Y.js} +2 -2
- package/dist/assets/{resolve-UAfshn6j.js.map → resolve-DI8uAM_Y.js.map} +1 -1
- package/dist/assets/{restoredRows-YhlbokEE.js → restoredRows-C3LcxmOw.js} +4 -4
- package/dist/assets/{restoredRows-YhlbokEE.js.map → restoredRows-C3LcxmOw.js.map} +1 -1
- package/dist/assets/{server-DYdR0_Fj.js → server-DdtPxkqI.js} +2057 -655
- package/dist/assets/server-DdtPxkqI.js.map +1 -0
- package/dist/assets/{src-BTRPAi5X.js → src-BnpEQqzk.js} +813 -144
- package/dist/assets/src-BnpEQqzk.js.map +1 -0
- package/dist/assets/{sshForges-KtHK5x1x.js → sshForges-cdIAraDw.js} +2 -2
- package/dist/assets/{sshForges-KtHK5x1x.js.map → sshForges-cdIAraDw.js.map} +1 -1
- package/dist/assets/{translate-CYuygrvA.js → translate-kNopA04L.js} +2 -2
- package/dist/assets/{translate-CYuygrvA.js.map → translate-kNopA04L.js.map} +1 -1
- package/dist/assets/{usdt-Dw9IENe_.js → usdt-CDaLhEYh.js} +3 -3
- package/dist/assets/{usdt-Dw9IENe_.js.map → usdt-CDaLhEYh.js.map} +1 -1
- package/dist/assets/{waitNotice-Ce3YCinu.js → waitNotice-Cn0WJ-He.js} +3 -1
- package/dist/assets/waitNotice-Cn0WJ-He.js.map +1 -0
- package/dist/ghostly.mjs +1 -1
- package/examples/claude-code-agent.sh +5 -0
- package/package.json +2 -2
- package/dist/assets/api-DppWqAP3.js.map +0 -1
- package/dist/assets/api-K-i5MrP-.js +0 -3
- package/dist/assets/apiKit-DFIho4Ev.js.map +0 -1
- package/dist/assets/apps-yBnbEtfV.js.map +0 -1
- package/dist/assets/backup-vj4J7M3e.js.map +0 -1
- package/dist/assets/buttons-BoDMx3Ky.js.map +0 -1
- package/dist/assets/buttons-DG1CKgAI.js +0 -2
- package/dist/assets/client-BQArefYa.js.map +0 -1
- package/dist/assets/fileBytesIdb-BtXATa7j.js +0 -2
- package/dist/assets/groupFiles-D-ZUUHrx.js.map +0 -1
- package/dist/assets/host-DFLzzKNr.js.map +0 -1
- package/dist/assets/idb-BHsAqENE.js.map +0 -1
- package/dist/assets/irohWeb-C_Wnw7Q9.js.map +0 -1
- package/dist/assets/main-xO8MnXxD.js.map +0 -1
- package/dist/assets/nwc-B3-PHX0L.js.map +0 -1
- package/dist/assets/nwcProvider-BeQBPB2q.js.map +0 -1
- package/dist/assets/profiles-Bg43mRXu.js.map +0 -1
- package/dist/assets/registry-BDnsZJBi.js.map +0 -1
- package/dist/assets/server-DYdR0_Fj.js.map +0 -1
- package/dist/assets/src-BTRPAi5X.js.map +0 -1
- package/dist/assets/waitNotice-Ce3YCinu.js.map +0 -1
- package/dist/assets/words-BvdNuw_v.js.map +0 -1
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { $ as SSHSIG_NAMESPACE,
|
|
2
|
-
import { c as boundedIdentityFetch, i as registeredIdentityProviders, s as reserveAdapterIds, t as ownDid, u as testBuild } from "./ownDid-
|
|
3
|
-
import { a as verifiedAtprotoHandle, c as assertDomainRecord, d as chosenResolver, f as resolverById, i as resolveAtprotoHandle, l as assertNip05, p as pkarrRelays, r as resolveAtprotoDid, s as DomainCheckError, t as assertPublicServer, u as assertPublicHost } from "./resolve-
|
|
4
|
-
import { a as PUBKY_RELAYS, c as isConfigured, d as providerForIssuer, i as validForgeLogin, l as issuerFor, n as SSH_FORGE_LABEL, o as audiences, r as checkSshForge, s as clientIdFor, t as SSH_FORGE_HOST, u as oidcProviders } from "./sshForges-
|
|
1
|
+
import { $ as SSHSIG_NAMESPACE, $u as openRelayPayload, At as didJwsAlg, Bt as parseDidSignaturePaste, Cn as pubkyProofFile, Ct as DID_DOCUMENT_MAX_BYTES, Da as wellKnownUrl, Dt as checkDidJws, En as pubkyHomeserverOf, Et as DidError, Ft as didWebFileUrl, Ht as staticDidDocument, It as didWebHost, Lt as normalizeDid, Mt as didWebDocumentUrl, Nt as didWebFile, Ot as checkDidSignature, Pt as didWebFileNames, Rt as parseDid, Sa as normalizeDomain, Sn as pubkyProofCapability, St as verifyAtprotoRecordProof, Tn as homeserverWebEndpoint, Ut as strictBase64Url, Vt as signingKeys, Wt as DidDhtError, Xu as RELAY_PAYLOAD_MAX_BYTES, Yt as resolveDidDht, _a as domainTxtRecord, _d as utf8Decode, _n as PUBKY_PROOF_MAX_BYTES, _t as isAtprotoDid, at as verifySshSignature, bn as newPubkyProofFolder, bt as shortAtprotoDid, ct as decodeAnyBitcoinAddress, dt as ATPROTO_PROOF_COLLECTION, et as SshSigError, fd as fromBase64Url, ft as ATPROTO_PROOF_SCOPE, ga as dnsProofName, gt as checkAtprotoProofRecord, hd as toBase64Url, ht as atprotoProofRkey, it as sshSignCommand, jt as didSignedMessages, kt as didGhostlyServiceEntry, lt as ATPROTO_DECLARED_SCOPE, md as randomBytes, mt as atprotoProofRecord, nt as parseSshSignature, ot as verifyBitcoinMessage, st as BitcoinAddressError, tt as parseSshPublicKey, ut as ATPROTO_FULL_SCOPE, va as domainWellKnownFile, vd as utf8Encode, vn as isPubkyKey, vt as normalizeAtprotoHandle, wn as pubkyProofPath, wt as DID_FILE_MAX_BYTES, xn as normalizePubkyKey, xt as AtprotoProofError, yn as isPubkyProofFolder, zi as IdentityCheckUnavailable, zt as parseDidDocument } from "./src-BnpEQqzk.js";
|
|
2
|
+
import { c as boundedIdentityFetch, i as registeredIdentityProviders, s as reserveAdapterIds, t as ownDid, u as testBuild } from "./ownDid-iKz8u_fM.js";
|
|
3
|
+
import { a as verifiedAtprotoHandle, c as assertDomainRecord, d as chosenResolver, f as resolverById, i as resolveAtprotoHandle, l as assertNip05, p as pkarrRelays, r as resolveAtprotoDid, s as DomainCheckError, t as assertPublicServer, u as assertPublicHost } from "./resolve-DI8uAM_Y.js";
|
|
4
|
+
import { a as PUBKY_RELAYS, c as isConfigured, d as providerForIssuer, i as validForgeLogin, l as issuerFor, n as SSH_FORGE_LABEL, o as audiences, r as checkSshForge, s as clientIdFor, t as SSH_FORGE_HOST, u as oidcProviders } from "./sshForges-cdIAraDw.js";
|
|
5
5
|
import { ed25519 } from "@noble/curves/ed25519.js";
|
|
6
6
|
import { sha256 } from "@noble/hashes/sha2.js";
|
|
7
7
|
import { schnorr } from "@noble/curves/secp256k1.js";
|
|
8
8
|
import { generateSecretKey } from "nostr-tools/pure";
|
|
9
9
|
import { decode, npubEncode } from "nostr-tools/nip19";
|
|
10
|
+
//#region ../browser/src/proofs/contract.ts
|
|
11
|
+
/** `english` with its `{{name}}`s filled in: what `ProviderSay` returns where no app language is at hand (the CLI, tests). */
|
|
12
|
+
var englishSay = (_key, english, values) => values ? english.replace(/\{\{(\w+)\}\}/g, (all, name) => name in values ? String(values[name]) : all) : english;
|
|
13
|
+
//#endregion
|
|
10
14
|
//#region ../browser/src/proofs/bitcoinWallets.ts
|
|
11
15
|
/** What a proof proves and what it does not; shown next to every Bitcoin proof, given or received. */
|
|
12
16
|
var BITCOIN_PROOF_LIMITS = [
|
|
@@ -116,6 +120,7 @@ function guidesFor(script) {
|
|
|
116
120
|
//#region ../browser/src/proofs/providers/bitcoin.ts
|
|
117
121
|
var MAX_SIGNATURE = 8192;
|
|
118
122
|
var SIGNATURE = /^(smp|ful|pof)?[A-Za-z0-9+/]+={0,2}$/;
|
|
123
|
+
/** Each address type's name, said under `scripts.<type>` (exported for the app's drift guard). */
|
|
119
124
|
var SCRIPT_NAMES = {
|
|
120
125
|
p2wpkh: "native SegWit (bc1q…)",
|
|
121
126
|
p2tr: "Taproot (bc1p…)",
|
|
@@ -146,36 +151,47 @@ function shortAddress(address) {
|
|
|
146
151
|
return `${address.slice(0, address.startsWith("bcrt1") ? 9 : 7)}…${address.slice(-4)}${isTestAddress(address) ? " · test network" : ""}`;
|
|
147
152
|
}
|
|
148
153
|
/** Wallet steps for this statement's address: the guide's own, or why this wallet cannot sign for it. */
|
|
149
|
-
function walletInstructions(guide, statement) {
|
|
154
|
+
function walletInstructions(guide, statement, say) {
|
|
150
155
|
const address = statement.binding.subject;
|
|
151
156
|
const info = decodeAnyBitcoinAddress(address);
|
|
152
157
|
const steps = [];
|
|
158
|
+
const at = `wallets.${guide.id}`;
|
|
153
159
|
if (!guide.scripts.includes(info.type)) {
|
|
154
160
|
const others = guidesFor(info.type).filter((g) => g.id !== "other").map((g) => g.name);
|
|
155
|
-
|
|
161
|
+
const cannot = {
|
|
162
|
+
wallet: guide.name,
|
|
163
|
+
type: say(`scripts.${info.type}`, SCRIPT_NAMES[info.type])
|
|
164
|
+
};
|
|
165
|
+
steps.push({ text: others.length ? say("steps.cannotSignTry", "{{wallet}} cannot sign for a {{type}} address in a format Ghostly accepts. Try {{others}}, or another wallet that signs BIP-322.", {
|
|
166
|
+
...cannot,
|
|
167
|
+
others: others.reduce((a, b) => say("steps.either", "{{a}} or {{b}}", {
|
|
168
|
+
a,
|
|
169
|
+
b
|
|
170
|
+
}))
|
|
171
|
+
}) : say("steps.cannotSign", "{{wallet}} cannot sign for a {{type}} address in a format Ghostly accepts. Use a wallet that signs BIP-322.", cannot) });
|
|
156
172
|
} else {
|
|
157
173
|
steps.push({
|
|
158
|
-
text: "Sign exactly this statement, as one line, without adding a line break:",
|
|
174
|
+
text: say("steps.statement", "Sign exactly this statement, as one line, without adding a line break:"),
|
|
159
175
|
copy: statement.text
|
|
160
176
|
});
|
|
161
177
|
steps.push({
|
|
162
|
-
text: "With this address:",
|
|
178
|
+
text: say("steps.address", "With this address:"),
|
|
163
179
|
copy: address
|
|
164
180
|
});
|
|
165
|
-
|
|
181
|
+
guide.steps.forEach((text, i) => steps.push({ text: say(`${at}.step${i + 1}`, text) }));
|
|
166
182
|
if (guide.id === "bitcoin-core") steps.push({
|
|
167
|
-
text:
|
|
183
|
+
text: info.network === "testnet" ? say("steps.commandTestnet", "Command line (add -signet, -testnet4 or -regtest):") : say("steps.command", "Command line:"),
|
|
168
184
|
copy: `bitcoin-cli signmessage "${address}" '${statement.text}'`
|
|
169
185
|
});
|
|
170
|
-
if (info.network === "testnet" && guide.testnet) steps.push({ text:
|
|
171
|
-
if (guide.note) steps.push({ text: guide.note });
|
|
186
|
+
if (info.network === "testnet" && guide.testnet) steps.push({ text: say("steps.testnet", "Test networks: {{how}}", { how: say(`${at}.testnet`, guide.testnet) }) });
|
|
187
|
+
if (guide.note) steps.push({ text: say(`${at}.note`, guide.note) });
|
|
172
188
|
}
|
|
173
|
-
steps.push({ text: "This shows you can sign for the address. It does not show a balance, a past payment, or that you would pay." });
|
|
189
|
+
steps.push({ text: say("steps.limits", "This shows you can sign for the address. It does not show a balance, a past payment, or that you would pay.") });
|
|
174
190
|
return {
|
|
175
191
|
steps,
|
|
176
192
|
paste: {
|
|
177
|
-
label: "Signature",
|
|
178
|
-
placeholder: "smp… (BIP-322) or the base64 signature your wallet shows",
|
|
193
|
+
label: say("paste.label", "Signature"),
|
|
194
|
+
placeholder: say("paste.placeholder", "smp… (BIP-322) or the base64 signature your wallet shows"),
|
|
179
195
|
multiline: true
|
|
180
196
|
}
|
|
181
197
|
};
|
|
@@ -207,7 +223,7 @@ function walletSigner(guide) {
|
|
|
207
223
|
kind: "external-tool",
|
|
208
224
|
label: guide.name,
|
|
209
225
|
description: guide.format === "legacy" ? "Legacy message signature: for a legacy 1… address only." : "BIP-322 message signature.",
|
|
210
|
-
instructions: (statement) => walletInstructions(guide, statement),
|
|
226
|
+
instructions: (statement, say = englishSay) => walletInstructions(guide, statement, say),
|
|
211
227
|
parse(pasted, statement) {
|
|
212
228
|
const signature = cleanSignature(pasted);
|
|
213
229
|
check(statement, signature);
|
|
@@ -262,6 +278,23 @@ var bitcoin = {
|
|
|
262
278
|
}
|
|
263
279
|
};
|
|
264
280
|
//#endregion
|
|
281
|
+
//#region ../browser/src/proofs/displaySource.ts
|
|
282
|
+
/**
|
|
283
|
+
* Where a proof's name came from (`display.source`), and how a Nostr proof was checked (`verified.source`), in the
|
|
284
|
+
* fixed words the providers write them in. The app says these
|
|
285
|
+
* in its own language (`displaySourceOf` reads them back, from new proofs and stored ones alike); any other source is
|
|
286
|
+
* shown as written.
|
|
287
|
+
*/
|
|
288
|
+
/** The user ID is its holder's own words: shown with that caveat, never as a checked name. */
|
|
289
|
+
var OPENPGP_USER_ID_SOURCE = "User ID on the key, written by its holder: not proof that the name or email is theirs";
|
|
290
|
+
var OPENPGP_KEYSERVER_SOURCE = "Email confirmed to keys.openpgp.org by its owner: the keyserver's check, not Ghostly's";
|
|
291
|
+
/** How a Nostr proof was checked (`verified.source`): the event's own signature. */
|
|
292
|
+
var NOSTR_SIGNATURE_SOURCE = "Nostr signature (NIP-01, BIP-340)";
|
|
293
|
+
/** A sign-in provider's ID token: who signed it, and whether it says the email is checked. */
|
|
294
|
+
function oidcDisplaySource(provider, email) {
|
|
295
|
+
return `Signed by ${provider}${email === "verified" ? `; email verified by ${provider}` : email === "unverified" ? `; email not verified by ${provider}` : ""}`;
|
|
296
|
+
}
|
|
297
|
+
//#endregion
|
|
265
298
|
//#region ../browser/src/proofs/nostr.ts
|
|
266
299
|
function extensionSigner() {
|
|
267
300
|
return globalThis.nostr;
|
|
@@ -423,7 +456,7 @@ function nostrSigner(id) {
|
|
|
423
456
|
return work({
|
|
424
457
|
subject: async () => normalizeNostrKey(await signer.getPublicKey()),
|
|
425
458
|
sign: async (statement) => {
|
|
426
|
-
ctx.onProgress("Approve the Ghostly identity statement in your signer.");
|
|
459
|
+
ctx.onProgress((ctx.say ?? englishSay)("approve", "Approve the Ghostly identity statement in your signer."));
|
|
427
460
|
return await signer.signEvent(nostrProofTemplate(statement));
|
|
428
461
|
}
|
|
429
462
|
});
|
|
@@ -492,7 +525,7 @@ var nostr = {
|
|
|
492
525
|
if (!valid) throw new Error("Invalid Nostr signature");
|
|
493
526
|
return {
|
|
494
527
|
subject: event.pubkey,
|
|
495
|
-
source:
|
|
528
|
+
source: NOSTR_SIGNATURE_SOURCE
|
|
496
529
|
};
|
|
497
530
|
}
|
|
498
531
|
};
|
|
@@ -522,19 +555,19 @@ var dnsSigner = {
|
|
|
522
555
|
kind: "publish",
|
|
523
556
|
label: "DNS TXT record",
|
|
524
557
|
description: "Add a TXT record at your DNS host. Contacts' apps look it up through a DNS-over-HTTPS resolver.",
|
|
525
|
-
instructions(statement) {
|
|
558
|
+
instructions(statement, say = englishSay) {
|
|
526
559
|
const domain = statement.binding.subject;
|
|
527
560
|
return { steps: [
|
|
528
561
|
{
|
|
529
|
-
text:
|
|
562
|
+
text: say("dns.name", "Open the DNS settings of {{domain}} at your registrar or DNS host and add a TXT record with this name. Some hosts add the domain themselves: then enter only the part before {{domain}}.", { domain }),
|
|
530
563
|
copy: dnsProofName(domain)
|
|
531
564
|
},
|
|
532
565
|
{
|
|
533
|
-
text: "Value (one string, exactly as shown):",
|
|
566
|
+
text: say("dns.value", "Value (one string, exactly as shown):"),
|
|
534
567
|
copy: domainTxtRecord(recordFor(statement))
|
|
535
568
|
},
|
|
536
|
-
{ text: "Set the TTL to 300 seconds or less, so removing the record takes effect quickly. Then press Check: DNS changes can take a few minutes to appear." },
|
|
537
|
-
{ text: "The record stays public while the proof is in use. Removing it withdraws this proof from every contact at their next check." }
|
|
569
|
+
{ text: say("dns.ttl", "Set the TTL to 300 seconds or less, so removing the record takes effect quickly. Then press Check: DNS changes can take a few minutes to appear.") },
|
|
570
|
+
{ text: say("dns.public", "The record stays public while the proof is in use. Removing it withdraws this proof from every contact at their next check.") }
|
|
538
571
|
] };
|
|
539
572
|
},
|
|
540
573
|
evidence: () => ({ method: "dns" })
|
|
@@ -544,22 +577,22 @@ var httpsSigner = {
|
|
|
544
577
|
kind: "publish",
|
|
545
578
|
label: "File on your website",
|
|
546
579
|
description: "Upload a small file to your website. Contacts' apps download it from your server.",
|
|
547
|
-
instructions(statement) {
|
|
580
|
+
instructions(statement, say = englishSay) {
|
|
548
581
|
const domain = statement.binding.subject;
|
|
549
582
|
return { steps: [
|
|
550
583
|
{
|
|
551
|
-
text:
|
|
584
|
+
text: say("https.file", "Create this file on the web server of {{domain}}:", { domain }),
|
|
552
585
|
copy: wellKnownUrl(domain)
|
|
553
586
|
},
|
|
554
587
|
{
|
|
555
|
-
text: "With exactly this content:",
|
|
588
|
+
text: say("https.content", "With exactly this content:"),
|
|
556
589
|
copy: domainWellKnownFile([recordFor(statement)])
|
|
557
590
|
},
|
|
558
591
|
{
|
|
559
|
-
text: "Serve it over HTTPS at exactly that address, without any redirect (not even to www), and with this header so browsers may read it:",
|
|
592
|
+
text: say("https.serve", "Serve it over HTTPS at exactly that address, without any redirect (not even to www), and with this header so browsers may read it:"),
|
|
560
593
|
copy: "Access-Control-Allow-Origin: *"
|
|
561
594
|
},
|
|
562
|
-
{ text: "Then press Check. The file stays public while the proof is in use; deleting it withdraws this proof from every contact at their next check." }
|
|
595
|
+
{ text: say("https.check", "Then press Check. The file stays public while the proof is in use; deleting it withdraws this proof from every contact at their next check.") }
|
|
563
596
|
] };
|
|
564
597
|
},
|
|
565
598
|
evidence: () => ({ method: "https" })
|
|
@@ -597,7 +630,7 @@ function nip05Signer(id) {
|
|
|
597
630
|
return work({
|
|
598
631
|
subject: async () => domain,
|
|
599
632
|
sign: async (statement) => {
|
|
600
|
-
ctx.onProgress("Approve the Ghostly identity statement in your signer.");
|
|
633
|
+
ctx.onProgress((ctx.say ?? englishSay)("nip05.approve", "Approve the Ghostly identity statement in your signer."));
|
|
601
634
|
return {
|
|
602
635
|
method: "nip05",
|
|
603
636
|
event: await signer.signEvent(nostrProofTemplate(statement))
|
|
@@ -1257,20 +1290,6 @@ async function keyserverVerifiedEmails(keyserverArmored, fingerprint, options =
|
|
|
1257
1290
|
return [...new Set(emails.filter((e) => !!e).map((e) => e.toLowerCase()))];
|
|
1258
1291
|
}
|
|
1259
1292
|
//#endregion
|
|
1260
|
-
//#region ../browser/src/proofs/displaySource.ts
|
|
1261
|
-
/**
|
|
1262
|
-
* Where a proof's name came from (`display.source`), in the fixed words the providers write it in. The app says these
|
|
1263
|
-
* in its own language (`displaySourceOf` reads them back, from new proofs and stored ones alike); any other source is
|
|
1264
|
-
* shown as written.
|
|
1265
|
-
*/
|
|
1266
|
-
/** The user ID is its holder's own words: shown with that caveat, never as a checked name. */
|
|
1267
|
-
var OPENPGP_USER_ID_SOURCE = "User ID on the key, written by its holder: not proof that the name or email is theirs";
|
|
1268
|
-
var OPENPGP_KEYSERVER_SOURCE = "Email confirmed to keys.openpgp.org by its owner: the keyserver's check, not Ghostly's";
|
|
1269
|
-
/** A sign-in provider's ID token: who signed it, and whether it says the email is checked. */
|
|
1270
|
-
function oidcDisplaySource(provider, email) {
|
|
1271
|
-
return `Signed by ${provider}${email === "verified" ? `; email verified by ${provider}` : email === "unverified" ? `; email not verified by ${provider}` : ""}`;
|
|
1272
|
-
}
|
|
1273
|
-
//#endregion
|
|
1274
1293
|
//#region ../browser/src/proofs/providers/openpgp.ts
|
|
1275
1294
|
/**
|
|
1276
1295
|
* OpenPGP keys, signed with the person's own gpg — a YubiKey or another OpenPGP card works unchanged,
|
|
@@ -1283,7 +1302,7 @@ function normalizeFingerprint(input) {
|
|
|
1283
1302
|
if (/^[A-F0-9]{8}$|^[A-F0-9]{16}$/.test(value)) throw new PgpProofError("Use the full fingerprint, not a key ID: gpg --fingerprint shows it.");
|
|
1284
1303
|
throw new PgpProofError("Enter your key's fingerprint: 40 hex characters (gpg --fingerprint).");
|
|
1285
1304
|
}
|
|
1286
|
-
function steps(statement, exportKey) {
|
|
1305
|
+
function steps(statement, exportKey, say) {
|
|
1287
1306
|
assertSignableStatement(statement.text);
|
|
1288
1307
|
if (statement.text.includes("'")) throw new PgpProofError("Statement is not signable as plain text");
|
|
1289
1308
|
const fpr = normalizeFingerprint(statement.binding.subject);
|
|
@@ -1291,23 +1310,23 @@ function steps(statement, exportKey) {
|
|
|
1291
1310
|
return {
|
|
1292
1311
|
steps: [
|
|
1293
1312
|
{
|
|
1294
|
-
text: "Save the statement to a file (it is one line, with no newline at the end):",
|
|
1313
|
+
text: say("steps.save", "Save the statement to a file (it is one line, with no newline at the end):"),
|
|
1295
1314
|
copy: `printf '%s' '${statement.text}' > ghostly-identity.txt`
|
|
1296
1315
|
},
|
|
1297
1316
|
exportKey ? {
|
|
1298
|
-
text: "Sign it and export your public key, then copy everything this prints:",
|
|
1317
|
+
text: say("steps.signExport", "Sign it and export your public key, then copy everything this prints:"),
|
|
1299
1318
|
copy: `${sign} && gpg --armor --export --export-options export-minimal ${fpr}`
|
|
1300
1319
|
} : {
|
|
1301
|
-
text: "Sign it, then copy everything this prints:",
|
|
1320
|
+
text: say("steps.sign", "Sign it, then copy everything this prints:"),
|
|
1302
1321
|
copy: sign
|
|
1303
1322
|
},
|
|
1304
1323
|
{
|
|
1305
|
-
text: "On a YubiKey or another OpenPGP card, gpg asks for the card's PIN, and for a touch if the card requires one. Without a shell, save the statement below in a text file and sign that file.",
|
|
1324
|
+
text: say("steps.card", "On a YubiKey or another OpenPGP card, gpg asks for the card's PIN, and for a touch if the card requires one. Without a shell, save the statement below in a text file and sign that file."),
|
|
1306
1325
|
copy: statement.text
|
|
1307
1326
|
}
|
|
1308
1327
|
],
|
|
1309
1328
|
paste: {
|
|
1310
|
-
label: exportKey ? "Signed statement and public key" : "Signed statement",
|
|
1329
|
+
label: exportKey ? say("paste.signedAndKey", "Signed statement and public key") : say("paste.signed", "Signed statement"),
|
|
1311
1330
|
placeholder: "-----BEGIN PGP SIGNED MESSAGE-----",
|
|
1312
1331
|
multiline: true
|
|
1313
1332
|
}
|
|
@@ -1354,7 +1373,7 @@ var openpgp = {
|
|
|
1354
1373
|
kind: "external-tool",
|
|
1355
1374
|
label: "gpg",
|
|
1356
1375
|
description: "Sign with gpg and paste what it prints, public key included. Nothing is looked up.",
|
|
1357
|
-
instructions: (statement) => steps(statement, true),
|
|
1376
|
+
instructions: (statement, say = englishSay) => steps(statement, true, say),
|
|
1358
1377
|
async parse(pasted, statement) {
|
|
1359
1378
|
const { signature, publicKey } = splitPgpPaste(pasted);
|
|
1360
1379
|
if (!publicKey) throw new PgpProofError("Paste your public key too: the second command prints it (-----BEGIN PGP PUBLIC KEY BLOCK-----).");
|
|
@@ -1365,7 +1384,7 @@ var openpgp = {
|
|
|
1365
1384
|
kind: "external-tool",
|
|
1366
1385
|
label: "gpg, key from keys.openpgp.org",
|
|
1367
1386
|
description: "Sign with gpg and paste the signature; Ghostly then fetches your public key from keys.openpgp.org, which learns which key was looked up.",
|
|
1368
|
-
instructions: (statement) => steps(statement, false),
|
|
1387
|
+
instructions: (statement, say = englishSay) => steps(statement, false, say),
|
|
1369
1388
|
async parse(pasted, statement) {
|
|
1370
1389
|
const { signature, publicKey } = splitPgpPaste(pasted);
|
|
1371
1390
|
return evidenceFrom(statement, signature, publicKey ?? (await fetchKeyFromKeyserver(statement.binding.subject)).armored);
|
|
@@ -1453,27 +1472,28 @@ function sshKeygenSigner(forAccount) {
|
|
|
1453
1472
|
kind: "external-tool",
|
|
1454
1473
|
label: "ssh-keygen",
|
|
1455
1474
|
description: forAccount ? `Sign with an SSH key that your ${SSH_FORGE_LABEL[forAccount]} account lists (Settings → SSH keys).` : "Sign with OpenSSH's ssh-keygen (8.1 or later): a key file, ssh-agent, or a FIDO security key.",
|
|
1456
|
-
instructions: (statement) => {
|
|
1475
|
+
instructions: (statement, say = englishSay) => {
|
|
1457
1476
|
let command;
|
|
1458
1477
|
try {
|
|
1459
1478
|
command = sshSignCommand(statement.text);
|
|
1460
1479
|
} catch {
|
|
1461
1480
|
command = void 0;
|
|
1462
1481
|
}
|
|
1482
|
+
const sign = { namespace: SSHSIG_NAMESPACE };
|
|
1463
1483
|
return {
|
|
1464
1484
|
steps: [
|
|
1465
1485
|
...command ? [{
|
|
1466
|
-
text: "Run this in a terminal (macOS, Linux, or Git Bash/WSL on Windows). If your key is not ~/.ssh/id_ed25519, change the path after -f; a .pub path works when the private key is in ssh-agent or on a security key.",
|
|
1486
|
+
text: say("steps.run", "Run this in a terminal (macOS, Linux, or Git Bash/WSL on Windows). If your key is not ~/.ssh/id_ed25519, change the path after -f; a .pub path works when the private key is in ssh-agent or on a security key."),
|
|
1467
1487
|
copy: command
|
|
1468
1488
|
}] : [],
|
|
1469
1489
|
{
|
|
1470
|
-
text:
|
|
1490
|
+
text: command ? say("steps.orSave", "Or save this statement to a file, run ssh-keygen -Y sign -n {{namespace}} -f <your key> <file>, and paste the <file>.sig it writes.", sign) : say("steps.save", "Save this statement to a file, run ssh-keygen -Y sign -n {{namespace}} -f <your key> <file>, and paste the <file>.sig it writes.", sign),
|
|
1471
1491
|
copy: statement.text
|
|
1472
1492
|
},
|
|
1473
|
-
{ text: "Paste the whole signature it prints, from -----BEGIN SSH SIGNATURE----- to -----END SSH SIGNATURE-----. Your private key never leaves your computer." }
|
|
1493
|
+
{ text: say("steps.paste", "Paste the whole signature it prints, from -----BEGIN SSH SIGNATURE----- to -----END SSH SIGNATURE-----. Your private key never leaves your computer.") }
|
|
1474
1494
|
],
|
|
1475
1495
|
paste: {
|
|
1476
|
-
label: "SSH signature",
|
|
1496
|
+
label: say("paste.label", "SSH signature"),
|
|
1477
1497
|
placeholder: "-----BEGIN SSH SIGNATURE-----",
|
|
1478
1498
|
multiline: true
|
|
1479
1499
|
}
|
|
@@ -1997,7 +2017,7 @@ function createOidcIdentityProvider(options = {}) {
|
|
|
1997
2017
|
opening.then((w) => w.close(), () => {});
|
|
1998
2018
|
throw new Error("This provider is not set up in this Ghostly build.");
|
|
1999
2019
|
}
|
|
2000
|
-
ctx.onProgress(
|
|
2020
|
+
ctx.onProgress((ctx.say ?? englishSay)("signIn", "Sign in with {{provider}} in the window that opened.", { provider: provider.name }));
|
|
2001
2021
|
return { token: await signInForProof({
|
|
2002
2022
|
provider,
|
|
2003
2023
|
platform: h.platform,
|
|
@@ -2285,7 +2305,7 @@ var signer = {
|
|
|
2285
2305
|
kind: "external-tool",
|
|
2286
2306
|
label: "Sign with a key of the DID",
|
|
2287
2307
|
description: "Sign the statement with a key your DID document lists for authentication or assertionMethod, and paste a JWS or the raw signature. The private key never enters Ghostly.",
|
|
2288
|
-
instructions(statement) {
|
|
2308
|
+
instructions(statement, say = englishSay) {
|
|
2289
2309
|
const did = statement.binding.subject;
|
|
2290
2310
|
if (statement.text.includes("'")) throw new DidError("Statement is not signable as plain text");
|
|
2291
2311
|
const keys = knownKeys(did);
|
|
@@ -2294,26 +2314,26 @@ var signer = {
|
|
|
2294
2314
|
return {
|
|
2295
2315
|
steps: [
|
|
2296
2316
|
{
|
|
2297
|
-
text:
|
|
2317
|
+
text: say("steps.sign", "Sign this statement with the private key of {{key}}. It is one line, with no newline at the end:", { key: keys.length ? keys.map((k) => `${fragment(k.id)} (${k.curve})`).join(", ") : say("steps.anyKey", "a key listed under authentication or assertionMethod") }),
|
|
2298
2318
|
copy: statement.text
|
|
2299
2319
|
},
|
|
2300
2320
|
...curve === "secp256k1" ? [] : [{
|
|
2301
|
-
text:
|
|
2321
|
+
text: say("steps.jose", "With jose (Node.js 20 or later), a JWS: save this as sign.mjs and run it with your {{curve}} private key as a JWK file.", { curve }),
|
|
2302
2322
|
copy: joseScript(statement.text, key?.id)
|
|
2303
2323
|
}],
|
|
2304
2324
|
{
|
|
2305
|
-
text:
|
|
2325
|
+
text: say("steps.noble", "With @noble/curves (Node.js), a raw signature: save this as sign.mjs and run it with your {{curve}} private key in hex.", { curve }),
|
|
2306
2326
|
copy: nobleScript(statement.text, curve)
|
|
2307
2327
|
},
|
|
2308
2328
|
{
|
|
2309
|
-
text:
|
|
2329
|
+
text: say("steps.openssl", "Or with OpenSSL 3 and your {{curve}} key in PEM:", { curve }),
|
|
2310
2330
|
copy: opensslCommand(statement.text, curve)
|
|
2311
2331
|
},
|
|
2312
|
-
{ text:
|
|
2332
|
+
{ text: say("steps.paste", "Paste what it prints: a compact JWS ({{alg}}, attached or detached), or the signature in hex or base64. If your DID lists several keys, you may write the key id first: #key-1 <signature>.", { alg: didJwsAlg(curve) }) }
|
|
2313
2333
|
],
|
|
2314
2334
|
paste: {
|
|
2315
|
-
label: "JWS or signature",
|
|
2316
|
-
placeholder: "eyJhbGciOi… or the signature in hex",
|
|
2335
|
+
label: say("paste.label", "JWS or signature"),
|
|
2336
|
+
placeholder: say("paste.placeholder", "eyJhbGciOi… or the signature in hex"),
|
|
2317
2337
|
multiline: true
|
|
2318
2338
|
}
|
|
2319
2339
|
};
|
|
@@ -2346,22 +2366,22 @@ var fileSigner = {
|
|
|
2346
2366
|
kind: "publish",
|
|
2347
2367
|
label: "Publish a file beside did.json",
|
|
2348
2368
|
description: "did:web only: upload a small file next to your did.json. Contacts' apps download both from your server.",
|
|
2349
|
-
instructions(statement) {
|
|
2369
|
+
instructions(statement, say = englishSay) {
|
|
2350
2370
|
const did = webOnly(statement);
|
|
2351
2371
|
return { steps: [
|
|
2352
2372
|
{
|
|
2353
|
-
text: "Create this file on your web server, beside your did.json:",
|
|
2373
|
+
text: say("file.create", "Create this file on your web server, beside your did.json:"),
|
|
2354
2374
|
copy: didWebFileUrl(did, statement.id)
|
|
2355
2375
|
},
|
|
2356
2376
|
{
|
|
2357
|
-
text: "With exactly this content:",
|
|
2377
|
+
text: say("file.content", "With exactly this content:"),
|
|
2358
2378
|
copy: didWebFile(did, statement.text)
|
|
2359
2379
|
},
|
|
2360
2380
|
{
|
|
2361
|
-
text: "Serve it over HTTPS at exactly that address, without any redirect, and with this header so browsers may read it (your did.json needs it too):",
|
|
2381
|
+
text: say("file.serve", "Serve it over HTTPS at exactly that address, without any redirect, and with this header so browsers may read it (your did.json needs it too):"),
|
|
2362
2382
|
copy: "Access-Control-Allow-Origin: *"
|
|
2363
2383
|
},
|
|
2364
|
-
{ text: "Then press Check. The file stays public while the proof is in use; deleting it withdraws this proof from every contact at their next check." }
|
|
2384
|
+
{ text: say("file.check", "Then press Check. The file stays public while the proof is in use; deleting it withdraws this proof from every contact at their next check.") }
|
|
2365
2385
|
] };
|
|
2366
2386
|
},
|
|
2367
2387
|
evidence: () => ({ method: "file" })
|
|
@@ -2371,43 +2391,44 @@ var serviceSigner = {
|
|
|
2371
2391
|
kind: "publish",
|
|
2372
2392
|
label: "Add a service to did.json",
|
|
2373
2393
|
description: "did:web only: add one entry to the service list of your did.json. Contacts' apps read it there.",
|
|
2374
|
-
instructions(statement) {
|
|
2394
|
+
instructions(statement, say = englishSay) {
|
|
2375
2395
|
const did = webOnly(statement);
|
|
2376
2396
|
const seen = lastDidResolution(did);
|
|
2377
2397
|
return { steps: [{
|
|
2378
|
-
text:
|
|
2398
|
+
text: seen?.documentUrl ? say("service.addAt", "Add this entry to the \"service\" list of your did.json ({{url}}):", { url: seen.documentUrl }) : say("service.add", "Add this entry to the \"service\" list of your did.json:"),
|
|
2379
2399
|
copy: JSON.stringify(didGhostlyServiceEntry(did, statement.binding.key, statement.id), null, 2)
|
|
2380
|
-
}, { text: "Then press Check. Removing the entry withdraws this proof from every contact at their next check." }] };
|
|
2400
|
+
}, { text: say("service.check", "Then press Check. Removing the entry withdraws this proof from every contact at their next check.") }] };
|
|
2381
2401
|
},
|
|
2382
2402
|
evidence: () => ({ method: "service" })
|
|
2383
2403
|
};
|
|
2384
|
-
function previewOf(r) {
|
|
2404
|
+
function previewOf(r, say) {
|
|
2385
2405
|
const keys = signingKeys(r.document);
|
|
2386
2406
|
const unusable = r.document.keys.length - keys.length + r.document.skipped;
|
|
2387
2407
|
if (!keys.length && r.method !== "web") throw new DidError("This DID lists no Ed25519, secp256k1 or P-256 key for authentication or assertionMethod, so it cannot sign");
|
|
2408
|
+
const method = `did:${r.method}`;
|
|
2388
2409
|
const facts = [{
|
|
2389
|
-
label: "Method",
|
|
2390
|
-
value:
|
|
2410
|
+
label: say("preview.method", "Method"),
|
|
2411
|
+
value: r.method === "key" || r.method === "jwk" ? say("preview.keyIsIdentifier", "{{method}}, the key is the identifier", { method }) : method
|
|
2391
2412
|
}];
|
|
2392
2413
|
if (r.host) facts.push({
|
|
2393
|
-
label: "Domain",
|
|
2414
|
+
label: say("preview.domain", "Domain"),
|
|
2394
2415
|
value: r.host
|
|
2395
2416
|
});
|
|
2396
2417
|
if (r.documentUrl) facts.push({
|
|
2397
|
-
label: "Document",
|
|
2418
|
+
label: say("preview.document", "Document"),
|
|
2398
2419
|
value: r.documentUrl
|
|
2399
2420
|
});
|
|
2400
2421
|
if (r.relay) facts.push({
|
|
2401
|
-
label: "Relay",
|
|
2422
|
+
label: say("preview.relay", "Relay"),
|
|
2402
2423
|
value: r.relay.replace(/^https:\/\//, "")
|
|
2403
2424
|
});
|
|
2404
2425
|
facts.push({
|
|
2405
|
-
label: keys.length === 1 ? "Key" : "Keys",
|
|
2406
|
-
value: keys.length ? keys.map((k) => `${fragment(k.id)} (${k.curve})`).join(", ") : "none that can sign: publish instead"
|
|
2426
|
+
label: keys.length === 1 ? say("preview.key", "Key") : say("preview.keys", "Keys"),
|
|
2427
|
+
value: keys.length ? keys.map((k) => `${fragment(k.id)} (${k.curve})`).join(", ") : say("preview.noKeys", "none that can sign: publish instead")
|
|
2407
2428
|
});
|
|
2408
2429
|
if (unusable > 0) facts.push({
|
|
2409
|
-
label: "Not usable",
|
|
2410
|
-
value:
|
|
2430
|
+
label: say("preview.notUsable", "Not usable"),
|
|
2431
|
+
value: unusable === 1 ? say("preview.unusableOne", "1 key: another curve, or not for authentication or assertionMethod") : say("preview.unusable", "{{count}} keys: another curve, or not for authentication or assertionMethod", { count: unusable })
|
|
2411
2432
|
});
|
|
2412
2433
|
return {
|
|
2413
2434
|
facts,
|
|
@@ -2442,10 +2463,10 @@ var did = {
|
|
|
2442
2463
|
return canonical;
|
|
2443
2464
|
},
|
|
2444
2465
|
short: shortDid,
|
|
2445
|
-
preview: async (subject, { signal }) => previewOf(await resolveDid(subject, {
|
|
2466
|
+
preview: async (subject, { signal, say = englishSay }) => previewOf(await resolveDid(subject, {
|
|
2446
2467
|
fetch: uiFetch,
|
|
2447
2468
|
signal
|
|
2448
|
-
}))
|
|
2469
|
+
}), say)
|
|
2449
2470
|
},
|
|
2450
2471
|
publicUri: (subject) => subject,
|
|
2451
2472
|
validity: {
|
|
@@ -2689,7 +2710,7 @@ async function withSession(options, work) {
|
|
|
2689
2710
|
throw new Error(`Your server (${pdsHost(account.pds)}) refused to start the sign-in.`);
|
|
2690
2711
|
}
|
|
2691
2712
|
if (!state) throw new Error("The sign-in could not start.");
|
|
2692
|
-
options.onProgress(
|
|
2713
|
+
options.onProgress((options.say ?? englishSay)("progress.approve", "Approve on {{server}} in the window that opened…", { server: pdsHost(account.pds) }));
|
|
2693
2714
|
const redirected = await w.authorize(url.href, state, signal);
|
|
2694
2715
|
signal.throwIfAborted();
|
|
2695
2716
|
const params = callbackParams(redirected, w.redirectUri);
|
|
@@ -2735,7 +2756,7 @@ async function xrpcError(response) {
|
|
|
2735
2756
|
/** Writes the proof record (rkey = the proof key) and returns once the server has it. */
|
|
2736
2757
|
async function publishAtprotoProof(statement, options) {
|
|
2737
2758
|
await withSession(options, async (session) => {
|
|
2738
|
-
options.onProgress(
|
|
2759
|
+
options.onProgress((options.say ?? englishSay)("progress.publishing", "Publishing the proof on {{server}}…", { server: pdsHost(options.account.pds) }));
|
|
2739
2760
|
const response = await session.fetchHandler("/xrpc/com.atproto.repo.createRecord", {
|
|
2740
2761
|
method: "POST",
|
|
2741
2762
|
headers: { "content-type": "application/json" },
|
|
@@ -2753,7 +2774,7 @@ async function publishAtprotoProof(statement, options) {
|
|
|
2753
2774
|
/** Deletes the proof record. Deleting a record that is not there succeeds. */
|
|
2754
2775
|
async function unpublishAtprotoProof(proofKey, options) {
|
|
2755
2776
|
await withSession(options, async (session) => {
|
|
2756
|
-
options.onProgress(
|
|
2777
|
+
options.onProgress((options.say ?? englishSay)("progress.deleting", "Deleting the record on {{server}}…", { server: pdsHost(options.account.pds) }));
|
|
2757
2778
|
const response = await session.fetchHandler("/xrpc/com.atproto.repo.deleteRecord", {
|
|
2758
2779
|
method: "POST",
|
|
2759
2780
|
headers: { "content-type": "application/json" },
|
|
@@ -2803,7 +2824,7 @@ function createAtprotoIdentityProvider(options = {}) {
|
|
|
2803
2824
|
const w = await opening;
|
|
2804
2825
|
try {
|
|
2805
2826
|
const resolve = resolveOptions(uiFetch(), ctx.signal);
|
|
2806
|
-
ctx.onProgress(
|
|
2827
|
+
ctx.onProgress((ctx.say ?? englishSay)("progress.lookingUp", "Looking up {{account}}…", { account: input.trim() }));
|
|
2807
2828
|
const account = await lookupAtprotoAccount(input, {
|
|
2808
2829
|
...resolve,
|
|
2809
2830
|
normalize: normalizeAtprotoHandle
|
|
@@ -2817,6 +2838,7 @@ function createAtprotoIdentityProvider(options = {}) {
|
|
|
2817
2838
|
signal: ctx.signal,
|
|
2818
2839
|
resolve,
|
|
2819
2840
|
onProgress: ctx.onProgress,
|
|
2841
|
+
say: ctx.say,
|
|
2820
2842
|
fetch: options.oauthFetch
|
|
2821
2843
|
});
|
|
2822
2844
|
} finally {
|
|
@@ -3255,21 +3277,22 @@ async function withPubkyApproval(options, work) {
|
|
|
3255
3277
|
throw failure("Could not start a Pubky request", e);
|
|
3256
3278
|
}
|
|
3257
3279
|
const opened = {};
|
|
3280
|
+
const say = options.say ?? englishSay;
|
|
3258
3281
|
options.onApproval({
|
|
3259
3282
|
open: {
|
|
3260
|
-
label: "Approve in your browser (Pubky Passport)",
|
|
3261
|
-
description: "Opens Pubky Passport. No Passport identity yet? It offers “Continue with Google” and makes one.",
|
|
3283
|
+
label: say("approval.passport", "Approve in your browser (Pubky Passport)"),
|
|
3284
|
+
description: say("approval.passportAbout", "Opens Pubky Passport. No Passport identity yet? It offers “Continue with Google” and makes one."),
|
|
3262
3285
|
run: () => {
|
|
3263
3286
|
const window = (options.openPassport ?? openPassportWindow)(passportUrl(grant.authorizationUrl));
|
|
3264
3287
|
opened.window = window ?? null;
|
|
3265
|
-
if (window === null) options.onProgress("Your browser blocked the Passport window: allow pop-ups for Ghostly and press the button again, or scan the code with Pubky Ring.");
|
|
3288
|
+
if (window === null) options.onProgress(say("progress.popupBlocked", "Your browser blocked the Passport window: allow pop-ups for Ghostly and press the button again, or scan the code with Pubky Ring."));
|
|
3266
3289
|
}
|
|
3267
3290
|
},
|
|
3268
3291
|
qr: {
|
|
3269
3292
|
value: cookie.authorizationUrl,
|
|
3270
|
-
label: "Or scan with Pubky Ring"
|
|
3293
|
+
label: say("approval.ring", "Or scan with Pubky Ring")
|
|
3271
3294
|
},
|
|
3272
|
-
notes: ["An identity Passport makes with Google is recovered with Google plus Passport: both are needed, neither alone can.", "The code is your request: scan it yourself, and do not share it."]
|
|
3295
|
+
notes: [say("approval.googleNote", "An identity Passport makes with Google is recovered with Google plus Passport: both are needed, neither alone can."), say("approval.qrNote", "The code is your request: scan it yourself, and do not share it.")]
|
|
3273
3296
|
});
|
|
3274
3297
|
const transport = cookieSessionTransport();
|
|
3275
3298
|
const unroute = transport ? routeCookieSession(transport) : () => {};
|
|
@@ -3306,7 +3329,7 @@ async function approveAndWork(options, work, { grant, cookie, opened, settled, c
|
|
|
3306
3329
|
if (opened.window && !opened.window.closed) opened.window.close();
|
|
3307
3330
|
} catch {}
|
|
3308
3331
|
}
|
|
3309
|
-
options.onProgress("Approved. Checking what Pubky granted…");
|
|
3332
|
+
options.onProgress((options.say ?? englishSay)("progress.approved", "Approved. Checking what Pubky granted…"));
|
|
3310
3333
|
let key;
|
|
3311
3334
|
try {
|
|
3312
3335
|
const info = session.info;
|
|
@@ -3359,7 +3382,8 @@ function createPubkyIdentityProvider(options = {}) {
|
|
|
3359
3382
|
capability,
|
|
3360
3383
|
signal: ctx.signal,
|
|
3361
3384
|
onApproval: ctx.onApproval,
|
|
3362
|
-
onProgress: ctx.onProgress
|
|
3385
|
+
onProgress: ctx.onProgress,
|
|
3386
|
+
say: ctx.say
|
|
3363
3387
|
}, work);
|
|
3364
3388
|
};
|
|
3365
3389
|
return {
|
|
@@ -3402,7 +3426,7 @@ function createPubkyIdentityProvider(options = {}) {
|
|
|
3402
3426
|
subject: async () => session.key,
|
|
3403
3427
|
async sign(statement) {
|
|
3404
3428
|
if (statement.binding.subject !== session.key) throw new Error("That is another Pubky identity");
|
|
3405
|
-
ctx.onProgress("Writing the proof to your homeserver…");
|
|
3429
|
+
ctx.onProgress((ctx.say ?? englishSay)("progress.writing", "Writing the proof to your homeserver…"));
|
|
3406
3430
|
const path = pubkyProofPath(folder, statement.id);
|
|
3407
3431
|
await session.put(path, pubkyProofFile(statement));
|
|
3408
3432
|
written = path;
|
|
@@ -3436,7 +3460,7 @@ function createPubkyIdentityProvider(options = {}) {
|
|
|
3436
3460
|
const path = pubkyProofPath(folder, id);
|
|
3437
3461
|
return approve(pubkyProofCapability(folder), ctx, async (session) => {
|
|
3438
3462
|
if (session.key !== subject) throw new Error("That is another Pubky identity: approve with the one this proof is for");
|
|
3439
|
-
ctx.onProgress("Deleting the proof file from your homeserver…");
|
|
3463
|
+
ctx.onProgress((ctx.say ?? englishSay)("progress.deleting", "Deleting the proof file from your homeserver…"));
|
|
3440
3464
|
await session.delete(path);
|
|
3441
3465
|
});
|
|
3442
3466
|
}
|
|
@@ -3713,4 +3737,4 @@ function identityProvider(id, providers = identityProviders()) {
|
|
|
3713
3737
|
//#endregion
|
|
3714
3738
|
export { identityProvider as n, identityProviders as r, IDENTITY_PROVIDERS as t };
|
|
3715
3739
|
|
|
3716
|
-
//# sourceMappingURL=registry-
|
|
3740
|
+
//# sourceMappingURL=registry-CnFO2Pp5.js.map
|