@ghostlytools/cli 1.10.0 → 1.10.2
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 +19 -17
- package/SKILL.md +5 -4
- package/dist/assets/api-DcE4KylM.js +3 -0
- package/dist/assets/{api-BF_KwecF.js → api-EUGHGnRz.js} +108 -49
- package/dist/assets/api-EUGHGnRz.js.map +1 -0
- package/dist/assets/{apiKit-Du1u2l4x.js → apiKit-CJVp_crp.js} +85 -22
- package/dist/assets/apiKit-CJVp_crp.js.map +1 -0
- package/dist/assets/{apps-Bti9fDoW.js → apps-C-KbyLCa.js} +1 -1
- package/dist/assets/{apps-DwPfp54I.js → apps-C54T_MOT.js} +33 -12
- package/dist/assets/apps-C54T_MOT.js.map +1 -0
- package/dist/assets/{arkade-DOWpA2Kr.js → arkade-BmxJTa65.js} +2 -2
- package/dist/assets/{arkade-DOWpA2Kr.js.map → arkade-BmxJTa65.js.map} +1 -1
- package/dist/assets/{backup-DZ_Q1eSu.js → backup-BxSH5BZG.js} +7 -6
- package/dist/assets/{backup-DZ_Q1eSu.js.map → backup-BxSH5BZG.js.map} +1 -1
- package/dist/assets/{backup-CeRckyl2.js → backup-C0Plp-DF.js} +1 -1
- package/dist/assets/bark_ffi_wasm_bg-EY2uc0Bx.js.map +1 -1
- package/dist/assets/bitcoindevkit_bg-B-iLWrmX.js.map +1 -1
- package/dist/assets/{buttons-BxIThdg9.js → buttons-B-ZJYdo0.js} +6 -6
- package/dist/assets/{buttons-BxIThdg9.js.map → buttons-B-ZJYdo0.js.map} +1 -1
- package/dist/assets/buttons-DA3wZfG0.js +2 -0
- package/dist/assets/childEnv-BVOQK9EA.js +21 -0
- package/dist/assets/childEnv-BVOQK9EA.js.map +1 -0
- package/dist/assets/{client-D5E1RQYB.js → client-CDa87uYD.js} +3 -3
- package/dist/assets/{client-D5E1RQYB.js.map → client-CDa87uYD.js.map} +1 -1
- package/dist/assets/codec-D45W1L8n.js +13 -0
- package/dist/assets/codec-D45W1L8n.js.map +1 -0
- package/dist/assets/{envelope-CugS9qwQ.js → envelope-C3yFCQa-.js} +3 -12
- package/dist/assets/envelope-C3yFCQa-.js.map +1 -0
- package/dist/assets/{errors-R4S2SAEM.js → errors-Dt-ZnyOX.js} +3 -1
- package/dist/assets/errors-Dt-ZnyOX.js.map +1 -0
- package/dist/assets/{fixedHosts-B4E4VrYE.js → fixedHosts-C6nCHjOa.js} +4 -4
- package/dist/assets/{fixedHosts-B4E4VrYE.js.map → fixedHosts-C6nCHjOa.js.map} +1 -1
- package/dist/assets/{groupFiles-NonOYBKN.js → groupFiles-DYopNE57.js} +217 -178
- package/dist/assets/groupFiles-DYopNE57.js.map +1 -0
- package/dist/assets/{host-DvcVt5YI.js → host-G5seUwaI.js} +241 -87
- package/dist/assets/host-G5seUwaI.js.map +1 -0
- package/dist/assets/{hyperdhtRelay-Ce42sR8x.js → hyperdhtRelay-B_uHjg_r.js} +28 -20
- package/dist/assets/hyperdhtRelay-B_uHjg_r.js.map +1 -0
- package/dist/assets/{irohWeb-C9ChbD-c.js → irohWeb-C-2oslSU.js} +120 -38
- package/dist/assets/irohWeb-C-2oslSU.js.map +1 -0
- package/dist/assets/{main-4qE381KM.js → main-Dk--nD7X.js} +92 -48
- package/dist/assets/main-Dk--nD7X.js.map +1 -0
- package/dist/assets/{mainline-DOwZDHVy.js → mainline-HPlVrl8R.js} +5 -5
- package/dist/assets/mainline-HPlVrl8R.js.map +1 -0
- package/dist/assets/networkReason-CfpO9ayz.js +474 -0
- package/dist/assets/networkReason-CfpO9ayz.js.map +1 -0
- package/dist/assets/{nwc-CHLWFV1R.js → nwc-BY7BPttn.js} +3 -3
- package/dist/assets/{nwc-CHLWFV1R.js.map → nwc-BY7BPttn.js.map} +1 -1
- package/dist/assets/{nwcProvider-BlkPOJen.js → nwcProvider-CfpbNUf7.js} +2 -2
- package/dist/assets/{nwcProvider-BlkPOJen.js.map → nwcProvider-CfpbNUf7.js.map} +1 -1
- package/dist/assets/{ownDid-yXtY_1B5.js → ownDid-DJFZM2cV.js} +2 -2
- package/dist/assets/{ownDid-yXtY_1B5.js.map → ownDid-DJFZM2cV.js.map} +1 -1
- package/dist/assets/{profiles-vbXHs0Mq.js → profiles-DKmZGXp6.js} +22 -9
- package/dist/assets/profiles-DKmZGXp6.js.map +1 -0
- package/dist/assets/{registry-chCD0KWS.js → registry-BUm4cAzV.js} +60 -19
- package/dist/assets/registry-BUm4cAzV.js.map +1 -0
- package/dist/assets/{registry-BN9r2pR4.js → registry-CAzrtV0_.js} +1 -1
- package/dist/assets/{resolve-Dtzogt2W.js → resolve-CDD4X68j.js} +5 -3
- package/dist/assets/resolve-CDD4X68j.js.map +1 -0
- package/dist/assets/{restoredRows-CRYwIx3g.js → restoredRows-YhlbokEE.js} +4 -2
- package/dist/assets/restoredRows-YhlbokEE.js.map +1 -0
- package/dist/assets/{secretGuard-CSVNxXVW.js → secretGuard-B7Hj0Kvz.js} +2 -2
- package/dist/assets/{secretGuard-CSVNxXVW.js.map → secretGuard-B7Hj0Kvz.js.map} +1 -1
- package/dist/assets/secretGuard-DUr6bgKc.js +2 -0
- package/dist/assets/{server-BZnsm5X5.js → server-DcOsgYDU.js} +1046 -573
- package/dist/assets/server-DcOsgYDU.js.map +1 -0
- package/dist/assets/{src-DZagapGt.js → src-D31D1_oY.js} +2360 -1673
- package/dist/assets/src-D31D1_oY.js.map +1 -0
- package/dist/assets/{sshForges-BkTgy5rx.js → sshForges-DerRwMf3.js} +2 -2
- package/dist/assets/{sshForges-BkTgy5rx.js.map → sshForges-DerRwMf3.js.map} +1 -1
- package/dist/assets/{translate-B9SMd6uf.js → translate-C-sj0VJe.js} +12 -8
- package/dist/assets/{translate-B9SMd6uf.js.map → translate-C-sj0VJe.js.map} +1 -1
- package/dist/assets/{usdt-BU4ezonh.js → usdt-DwHqp625.js} +3 -3
- package/dist/assets/{usdt-BU4ezonh.js.map → usdt-DwHqp625.js.map} +1 -1
- package/dist/assets/{waitNotice-B8D8WhbE.js → waitNotice-D52RWbV4.js} +38 -4
- package/dist/assets/waitNotice-D52RWbV4.js.map +1 -0
- package/dist/assets/{words-jYy7lTcb.js → words-Db9WgatT.js} +3 -3
- package/dist/assets/words-Db9WgatT.js.map +1 -0
- package/dist/ghostly.mjs +1 -1
- package/package.json +1 -1
- package/dist/assets/api-BF_KwecF.js.map +0 -1
- package/dist/assets/api-DdrA86Ur.js +0 -3
- package/dist/assets/apiKit-Du1u2l4x.js.map +0 -1
- package/dist/assets/apps-DwPfp54I.js.map +0 -1
- package/dist/assets/buttons-D9QBHS9Y.js +0 -2
- package/dist/assets/envelope-CugS9qwQ.js.map +0 -1
- package/dist/assets/errors-R4S2SAEM.js.map +0 -1
- package/dist/assets/groupFiles-NonOYBKN.js.map +0 -1
- package/dist/assets/host-DvcVt5YI.js.map +0 -1
- package/dist/assets/hyperdhtRelay-Ce42sR8x.js.map +0 -1
- package/dist/assets/irohWeb-C9ChbD-c.js.map +0 -1
- package/dist/assets/main-4qE381KM.js.map +0 -1
- package/dist/assets/mainline-DOwZDHVy.js.map +0 -1
- package/dist/assets/networkReason-MInk1Y63.js +0 -154
- package/dist/assets/networkReason-MInk1Y63.js.map +0 -1
- package/dist/assets/profiles-vbXHs0Mq.js.map +0 -1
- package/dist/assets/registry-chCD0KWS.js.map +0 -1
- package/dist/assets/resolve-Dtzogt2W.js.map +0 -1
- package/dist/assets/restoredRows-CRYwIx3g.js.map +0 -1
- package/dist/assets/secretGuard-Q2BKq0q0.js +0 -2
- package/dist/assets/server-BZnsm5X5.js.map +0 -1
- package/dist/assets/src-DZagapGt.js.map +0 -1
- package/dist/assets/waitNotice-B8D8WhbE.js.map +0 -1
- package/dist/assets/words-jYy7lTcb.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as SSHSIG_NAMESPACE, At as didJwsAlg, Bt as parseDidSignaturePaste, Cn as
|
|
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, 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, At as didJwsAlg, Bt as parseDidSignaturePaste, Cn as pubkyProofFile, Ct as DID_DOCUMENT_MAX_BYTES, Dt as checkDidJws, En as pubkyHomeserverOf, Et as DidError, Ft as didWebFileUrl, Ht as staticDidDocument, It as didWebHost, Iu as RELAY_PAYLOAD_MAX_BYTES, Lt as normalizeDid, Mt as didWebDocumentUrl, Nt as didWebFile, Ot as checkDidSignature, Pt as didWebFileNames, Qu as fromBase64Url, Rt as parseDid, Sn as pubkyProofCapability, St as verifyAtprotoRecordProof, Tn as homeserverWebEndpoint, Ut as strictBase64Url, Vt as signingKeys, Wt as DidDhtError, Yt as resolveDidDht, _a as wellKnownUrl, _n as PUBKY_PROOF_MAX_BYTES, _t as isAtprotoDid, at as verifySshSignature, bn as newPubkyProofFolder, bt as shortAtprotoDid, ca as domainWellKnownFile, ct as decodeAnyBitcoinAddress, dt as ATPROTO_PROOF_COLLECTION, ed as randomBytes, et as SshSigError, fa as normalizeDomain, ft as ATPROTO_PROOF_SCOPE, gt as checkAtprotoProofRecord, ht as atprotoProofRkey, id as utf8Encode, it as sshSignCommand, ji as IdentityCheckUnavailable, jt as didSignedMessages, kt as didGhostlyServiceEntry, lt as ATPROTO_DECLARED_SCOPE, mt as atprotoProofRecord, nt as parseSshSignature, oa as dnsProofName, ot as verifyBitcoinMessage, rd as utf8Decode, sa as domainTxtRecord, st as BitcoinAddressError, td as toBase64Url, tt as parseSshPublicKey, ut as ATPROTO_FULL_SCOPE, vn as isPubkyKey, vt as normalizeAtprotoHandle, wn as pubkyProofPath, wt as DID_FILE_MAX_BYTES, xn as normalizePubkyKey, xt as AtprotoProofError, yn as isPubkyProofFolder, zt as parseDidDocument, zu as openRelayPayload } from "./src-D31D1_oY.js";
|
|
2
|
+
import { c as boundedIdentityFetch, i as registeredIdentityProviders, s as reserveAdapterIds, t as ownDid, u as testBuild } from "./ownDid-DJFZM2cV.js";
|
|
3
|
+
import { a as verifiedAtprotoHandle, c as assertDomainRecord, d as chosenResolver, f as resolverById, i as resolveAtprotoHandle, l as assertNip05, r as resolveAtprotoDid, s as DomainCheckError, t as assertPublicServer, u as assertPublicHost } from "./resolve-CDD4X68j.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-DerRwMf3.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";
|
|
@@ -761,11 +761,32 @@ function allowedAlgorithm(packet, signing) {
|
|
|
761
761
|
brainpoolP384r1: "brainpoolP384r1",
|
|
762
762
|
brainpoolP512r1: "brainpoolP512r1"
|
|
763
763
|
};
|
|
764
|
-
if ((algorithm === "rsaEncryptSign" || algorithm === "rsaSign" && signing) && bits && bits >= 2048) return `RSA ${bits}`;
|
|
764
|
+
if ((algorithm === "rsaEncryptSign" || algorithm === "rsaSign" && signing) && bits && bits >= 2048 && bits <= RSA_MAX_BITS) return `RSA ${bits}`;
|
|
765
765
|
if (algorithm === "ed25519" || algorithm === "eddsaLegacy" && curve === "ed25519Legacy") return "Ed25519";
|
|
766
766
|
if (algorithm === "ed448") return "Ed448";
|
|
767
767
|
if (algorithm === "ecdsa" && curve && names[curve]) return `ECDSA ${names[curve]}`;
|
|
768
|
-
throw new PgpProofError(`This key uses ${algorithm.startsWith("rsa") ? `RSA ${bits ?? "?"}` : curve ? `${algorithm} ${curve}` : algorithm}, which Ghostly does not accept. Use Ed25519, ECDSA (P-256, P-384, P-521, brainpool) or RSA with
|
|
768
|
+
throw new PgpProofError(`This key uses ${algorithm.startsWith("rsa") ? `RSA ${bits ?? "?"}` : curve ? `${algorithm} ${curve}` : algorithm}, which Ghostly does not accept. Use Ed25519, ECDSA (P-256, P-384, P-521, brainpool) or RSA with 2048 to ${RSA_MAX_BITS} bits.`);
|
|
769
|
+
}
|
|
770
|
+
var RSA_MAX_BITS = 8192;
|
|
771
|
+
/** GnuPG and OpenPGP.js make RSA keys with 65537 (17 bits). The same limit as SSH keys (core sshsig). */
|
|
772
|
+
var RSA_MAX_EXPONENT_BITS = 64;
|
|
773
|
+
var bitLength = (bytes) => {
|
|
774
|
+
const i = bytes.findIndex((b) => b !== 0);
|
|
775
|
+
return i < 0 ? 0 : (bytes.length - i - 1) * 8 + 32 - Math.clz32(bytes[i]);
|
|
776
|
+
};
|
|
777
|
+
/**
|
|
778
|
+
* Every RSA key in a key, primary and subkeys, sized before any signature on it is verified.
|
|
779
|
+
* Where WebCrypto refuses a key (Chromium: an exponent over 33 bits), OpenPGP.js verifies in
|
|
780
|
+
* JavaScript, one modular squaring per bit of the exponent, blocking the thread.
|
|
781
|
+
*/
|
|
782
|
+
function assertRsaSizes(key) {
|
|
783
|
+
for (const packet of [key.keyPacket, ...key.subkeys.map((s) => s.keyPacket)]) {
|
|
784
|
+
if (!packet.getAlgorithmInfo().algorithm.startsWith("rsa")) continue;
|
|
785
|
+
const { n, e } = packet.publicParams;
|
|
786
|
+
const bits = n ? bitLength(n) : 0, exponentBits = e ? bitLength(e) : 0;
|
|
787
|
+
if (bits > RSA_MAX_BITS) throw new PgpProofError(`This key uses RSA ${bits}, which Ghostly does not accept. Use Ed25519, ECDSA (P-256, P-384, P-521, brainpool) or RSA with 2048 to ${RSA_MAX_BITS} bits.`);
|
|
788
|
+
if (exponentBits > RSA_MAX_EXPONENT_BITS) throw new PgpProofError(`This key uses RSA with a ${exponentBits}-bit public exponent, which Ghostly does not accept. Use a key made by GnuPG (exponent 65537).`);
|
|
789
|
+
}
|
|
769
790
|
}
|
|
770
791
|
var ALLOWED_HASHES = /* @__PURE__ */ new Set([
|
|
771
792
|
8,
|
|
@@ -870,6 +891,7 @@ async function readOneKey(pgp, input) {
|
|
|
870
891
|
if (key.isPrivate()) throw new PgpProofError("This is a PRIVATE key. Ghostly only needs your public key (gpg --armor --export).");
|
|
871
892
|
const version = key.keyPacket.version;
|
|
872
893
|
if (version !== 4 && version !== 6) throw new PgpProofError(`OpenPGP v${version} keys are not accepted; use a v4 (RFC 4880) or v6 (RFC 9580) key.`);
|
|
894
|
+
assertRsaSizes(key);
|
|
873
895
|
return key;
|
|
874
896
|
}
|
|
875
897
|
/** Valid, unrevoked, self-certified user IDs at `at`. */
|
|
@@ -1132,6 +1154,20 @@ async function keyserverVerifiedEmails(keyserverArmored, fingerprint, options =
|
|
|
1132
1154
|
return [...new Set(emails.filter((e) => !!e).map((e) => e.toLowerCase()))];
|
|
1133
1155
|
}
|
|
1134
1156
|
//#endregion
|
|
1157
|
+
//#region ../browser/src/proofs/displaySource.ts
|
|
1158
|
+
/**
|
|
1159
|
+
* Where a proof's name came from (`display.source`), in the fixed words the providers write it in. The app says these
|
|
1160
|
+
* in its own language (`displaySourceOf` reads them back, from new proofs and stored ones alike); any other source is
|
|
1161
|
+
* shown as written.
|
|
1162
|
+
*/
|
|
1163
|
+
/** The user ID is its holder's own words: shown with that caveat, never as a checked name. */
|
|
1164
|
+
var OPENPGP_USER_ID_SOURCE = "User ID on the key, written by its holder: not proof that the name or email is theirs";
|
|
1165
|
+
var OPENPGP_KEYSERVER_SOURCE = "Email confirmed to keys.openpgp.org by its owner: the keyserver's check, not Ghostly's";
|
|
1166
|
+
/** A sign-in provider's ID token: who signed it, and whether it says the email is checked. */
|
|
1167
|
+
function oidcDisplaySource(provider, email) {
|
|
1168
|
+
return `Signed by ${provider}${email === "verified" ? `; email verified by ${provider}` : email === "unverified" ? `; email not verified by ${provider}` : ""}`;
|
|
1169
|
+
}
|
|
1170
|
+
//#endregion
|
|
1135
1171
|
//#region ../browser/src/proofs/providers/openpgp.ts
|
|
1136
1172
|
/**
|
|
1137
1173
|
* OpenPGP keys, signed with the person's own gpg — a YubiKey or another OpenPGP card works unchanged,
|
|
@@ -1144,9 +1180,6 @@ function normalizeFingerprint(input) {
|
|
|
1144
1180
|
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.");
|
|
1145
1181
|
throw new PgpProofError("Enter your key's fingerprint: 40 hex characters (gpg --fingerprint).");
|
|
1146
1182
|
}
|
|
1147
|
-
/** The user ID is its holder's own words: shown with that caveat, never as a checked name. */
|
|
1148
|
-
var USER_ID_SOURCE = "User ID on the key, written by its holder: not proof that the name or email is theirs";
|
|
1149
|
-
var KEYSERVER_SOURCE = "Email confirmed to keys.openpgp.org by its owner: the keyserver's check, not Ghostly's";
|
|
1150
1183
|
function steps(statement, exportKey) {
|
|
1151
1184
|
assertSignableStatement(statement.text);
|
|
1152
1185
|
if (statement.text.includes("'")) throw new PgpProofError("Statement is not signable as plain text");
|
|
@@ -1253,7 +1286,7 @@ var openpgp = {
|
|
|
1253
1286
|
...verified.expiresAt !== null && verified.expiresAt < binding.expiresAt ? { expiresAt: verified.expiresAt } : {},
|
|
1254
1287
|
...userId ? { display: {
|
|
1255
1288
|
name: userId,
|
|
1256
|
-
source:
|
|
1289
|
+
source: OPENPGP_USER_ID_SOURCE,
|
|
1257
1290
|
fetchedAt: ctx.now
|
|
1258
1291
|
} } : {}
|
|
1259
1292
|
};
|
|
@@ -1267,7 +1300,7 @@ var openpgp = {
|
|
|
1267
1300
|
return {
|
|
1268
1301
|
name: emails[0],
|
|
1269
1302
|
url: `${KEYSERVER}/search?q=${fpr}`,
|
|
1270
|
-
source:
|
|
1303
|
+
source: OPENPGP_KEYSERVER_SOURCE,
|
|
1271
1304
|
fetchedAt: found.fetchedAt
|
|
1272
1305
|
};
|
|
1273
1306
|
}
|
|
@@ -1509,7 +1542,8 @@ var JwksCache = class {
|
|
|
1509
1542
|
let entry = this.entries.get(url);
|
|
1510
1543
|
if (!entry || entry.expires <= this.now()) entry = await this.load(url, fetcher);
|
|
1511
1544
|
let found = entry.keys.find((k) => k.kid === kid);
|
|
1512
|
-
if (!found && this.now() - entry.fetched >= 6e4) {
|
|
1545
|
+
if (!found && this.now() - Math.max(entry.fetched, entry.tried ?? 0) >= 6e4) {
|
|
1546
|
+
entry.tried = this.now();
|
|
1513
1547
|
entry = await this.load(url, fetcher);
|
|
1514
1548
|
found = entry.keys.find((k) => k.kid === kid);
|
|
1515
1549
|
}
|
|
@@ -1936,17 +1970,18 @@ function createOidcIdentityProvider(options = {}) {
|
|
|
1936
1970
|
if (!SUB.test(id.subject)) throw new Error("The provider’s account identifier cannot be shown");
|
|
1937
1971
|
const attester = hostOf$1(provider.issuer);
|
|
1938
1972
|
const person = id.name ?? id.username;
|
|
1939
|
-
const
|
|
1973
|
+
const email = id.emailVerified ? id.email : void 0;
|
|
1974
|
+
const name = email ? person && `${person} · ${email}`.length <= 64 ? `${person} · ${email}` : email : person;
|
|
1940
1975
|
const url = id.username && /^[A-Za-z0-9_.-]{1,64}$/.test(id.username) ? provider.id === "gitlab" ? `https://gitlab.com/${id.username}` : provider.id === "twitch" ? `https://www.twitch.tv/${id.username}` : void 0 : void 0;
|
|
1941
1976
|
return {
|
|
1942
1977
|
subject: `${provider.id === "microsoft" ? id.issuer : provider.issuer}#${id.subject}`,
|
|
1943
1978
|
attester,
|
|
1944
1979
|
source: `ID token signed by ${attester}`,
|
|
1945
|
-
...name || url ? { display: {
|
|
1980
|
+
...name || url || id.email ? { display: {
|
|
1946
1981
|
...name ? { name } : {},
|
|
1947
1982
|
...url ? { url } : {},
|
|
1948
1983
|
fetchedAt: id.issuedAt,
|
|
1949
|
-
source:
|
|
1984
|
+
source: oidcDisplaySource(provider.name, id.email ? id.emailVerified ? "verified" : "unverified" : void 0)
|
|
1950
1985
|
} } : {}
|
|
1951
1986
|
};
|
|
1952
1987
|
}
|
|
@@ -2021,6 +2056,8 @@ async function resolve(did, method, options) {
|
|
|
2021
2056
|
const found = await (options.dht ?? resolveDidDht)(did, {
|
|
2022
2057
|
fetch: options.fetch,
|
|
2023
2058
|
signal: options.signal
|
|
2059
|
+
}).catch((e) => {
|
|
2060
|
+
throw e instanceof DidDhtError && e.code === "unreachable" ? new IdentityCheckUnavailable(e.message) : e;
|
|
2024
2061
|
});
|
|
2025
2062
|
if (found.metadata.deactivated) throw new DidError("This DID is deactivated: its owner retired it");
|
|
2026
2063
|
return {
|
|
@@ -2734,7 +2771,7 @@ function createAtprotoIdentityProvider(options = {}) {
|
|
|
2734
2771
|
},
|
|
2735
2772
|
recheck: { afterSeconds: 3600 },
|
|
2736
2773
|
privacy: "Your contact's app asks the PLC directory (or your did:web host) for your account's document, your server for the record, and its DNS-over-HTTPS resolver or your handle's website for your handle, so they learn this account was checked.",
|
|
2737
|
-
signers: [signer("atproto-oauth", "proof-records", "Your server (Bluesky or another PDS)", "Opens your server's login page. Ghostly asks only to create and delete its own proof records: never to post, read your messages or edit your profile."), signer("atproto-oauth-full", "full", "Your server, full access (older servers)", "
|
|
2774
|
+
signers: [signer("atproto-oauth", "proof-records", "Your server (Bluesky or another PDS)", "Opens your server's login page. Ghostly asks only to create and delete its own proof records: never to post, read your messages or edit your profile."), signer("atproto-oauth-full", "full", "Your server, full access (older servers)", "Asks for access to your whole account, for servers that cannot limit Ghostly's permission. Ghostly suggests it when your server refuses the narrower sign-in or the record's write. Ghostly still only writes this one record, and gives the access back right away.")],
|
|
2738
2775
|
parseEvidence(raw) {
|
|
2739
2776
|
if (!raw || typeof raw !== "object" || Array.isArray(raw) || Object.keys(raw).length) throw new Error("Invalid AT Protocol evidence");
|
|
2740
2777
|
return {};
|
|
@@ -2829,10 +2866,12 @@ var atproto = createAtprotoIdentityProvider();
|
|
|
2829
2866
|
*/
|
|
2830
2867
|
/**
|
|
2831
2868
|
* The newest DNS packet the relays hold for `key`, its signature checked against `key`. Every relay is asked; one
|
|
2832
|
-
* that is down, answers garbage or holds an older packet does not count. Throws when none has a valid one
|
|
2869
|
+
* that is down, answers garbage or holds an older packet does not count. Throws when none has a valid one: as
|
|
2870
|
+
* IdentityCheckUnavailable when none answered (not reached, or an error status), since that says nothing of the key.
|
|
2833
2871
|
*/
|
|
2834
2872
|
async function pubkyRecords(key, fetch, signal, relays = PUBKY_RELAYS) {
|
|
2835
2873
|
const failed = [];
|
|
2874
|
+
let answered = false;
|
|
2836
2875
|
const newest = (await Promise.all(relays.map(async (relay) => {
|
|
2837
2876
|
let r;
|
|
2838
2877
|
try {
|
|
@@ -2844,13 +2883,15 @@ async function pubkyRecords(key, fetch, signal, relays = PUBKY_RELAYS) {
|
|
|
2844
2883
|
failed.push(e);
|
|
2845
2884
|
return;
|
|
2846
2885
|
}
|
|
2886
|
+
if (r.status === 200 || r.status === 404) answered = true;
|
|
2847
2887
|
try {
|
|
2848
2888
|
return r.status === 200 ? openRelayPayload(key, r.bytes) : void 0;
|
|
2849
2889
|
} catch {
|
|
2850
2890
|
return;
|
|
2851
2891
|
}
|
|
2852
2892
|
}))).filter((a) => !!a).sort((a, b) => b.seq > a.seq ? 1 : b.seq < a.seq ? -1 : 0)[0];
|
|
2853
|
-
if (!newest && failed.length === relays.length && failed[0] instanceof
|
|
2893
|
+
if (!newest && failed.length === relays.length && (failed[0] instanceof IdentityCheckUnavailable || /too large/i.test(String(failed[0])))) throw failed[0];
|
|
2894
|
+
if (!newest && !answered) throw new IdentityCheckUnavailable("No relay answered");
|
|
2854
2895
|
if (!newest) throw new NoPkarrRecords("This Pubky key has no records on the Pkarr relays");
|
|
2855
2896
|
return newest.dnsPacket;
|
|
2856
2897
|
}
|
|
@@ -3565,4 +3606,4 @@ function identityProvider(id, providers = identityProviders()) {
|
|
|
3565
3606
|
//#endregion
|
|
3566
3607
|
export { identityProvider as n, identityProviders as r, IDENTITY_PROVIDERS as t };
|
|
3567
3608
|
|
|
3568
|
-
//# sourceMappingURL=registry-
|
|
3609
|
+
//# sourceMappingURL=registry-BUm4cAzV.js.map
|