@multiplatform.one/gpg 7.23.2 → 7.24.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 +5 -2
- package/dist/cjs/GpgProvider.cjs +11 -11
- package/dist/cjs/GpgProvider.native.js +11 -13
- package/dist/cjs/GpgProvider.native.js.map +1 -1
- package/dist/esm/GpgContext.mjs.map +1 -1
- package/dist/esm/GpgContext.native.js.map +1 -1
- package/dist/esm/GpgProvider.mjs +12 -12
- package/dist/esm/GpgProvider.mjs.map +1 -1
- package/dist/esm/GpgProvider.native.js +12 -14
- package/dist/esm/GpgProvider.native.js.map +1 -1
- package/package.json +3 -3
- package/src/GpgContext.tsx +9 -4
- package/src/GpgProvider.tsx +11 -15
- package/types/GpgContext.d.ts +4 -3
- package/types/GpgContext.d.ts.map +1 -1
- package/types/GpgProvider.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ import { GpgBridge, GpgProvider, SignInWithGpgButton } from "@multiplatform.one/
|
|
|
38
38
|
|
|
39
39
|
export function App() {
|
|
40
40
|
return (
|
|
41
|
-
<GpgProvider>
|
|
41
|
+
<GpgProvider getNonce={getNonce} onSign={onSign} buildMessage={buildMessage}>
|
|
42
42
|
<ConnectKitProvider bridge={GpgBridge}>
|
|
43
43
|
<SignInWithGpgButton />
|
|
44
44
|
</ConnectKitProvider>
|
|
@@ -47,7 +47,10 @@ export function App() {
|
|
|
47
47
|
}
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
`
|
|
50
|
+
`buildMessage` is the challenge the user signs; this package has no builder of
|
|
51
|
+
its own. Pass `buildWalletMessage("gpg", { nonce })` from
|
|
52
|
+
`@multiplatform.one/web3/message`, or use web3's `GpgProvider`, which defaults
|
|
53
|
+
to it. `GpgProvider` must wrap **outside** `ConnectKitProvider`. In an app that also
|
|
51
54
|
ships wallets, `@multiplatform.one/web3` mounts `GpgScreenRegistrar` alongside
|
|
52
55
|
its own screens instead of `GpgBridge`.
|
|
53
56
|
|
package/dist/cjs/GpgProvider.cjs
CHANGED
|
@@ -34,16 +34,6 @@ var import_signer = require("./signer.cjs");
|
|
|
34
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
35
|
const GPG_NONCE_QUERY_KEY = "ckGpgNonce";
|
|
36
36
|
const b64 = s => window.btoa(unescape(encodeURIComponent(s)));
|
|
37
|
-
function defaultBuildMessage({
|
|
38
|
-
nonce
|
|
39
|
-
}) {
|
|
40
|
-
return `${window.location.host} wants you to sign in with your GPG key.
|
|
41
|
-
|
|
42
|
-
URI: ${window.location.origin}
|
|
43
|
-
Version: 1
|
|
44
|
-
Nonce: ${nonce}
|
|
45
|
-
Issued At: ${(/* @__PURE__ */new Date()).toISOString()}`;
|
|
46
|
-
}
|
|
47
37
|
const GpgProvider = ({
|
|
48
38
|
children,
|
|
49
39
|
enabled = true,
|
|
@@ -71,9 +61,19 @@ const GpgProvider = ({
|
|
|
71
61
|
refetchOnReconnect: false,
|
|
72
62
|
staleTime: Infinity
|
|
73
63
|
});
|
|
64
|
+
const {
|
|
65
|
+
subscribeNonceReset
|
|
66
|
+
} = gpgConfig;
|
|
67
|
+
const refetchNonce = nonce.refetch;
|
|
68
|
+
(0, import_react.useEffect)(() => {
|
|
69
|
+
if (!subscribeNonceReset) return;
|
|
70
|
+
return subscribeNonceReset(() => {
|
|
71
|
+
void refetchNonce();
|
|
72
|
+
});
|
|
73
|
+
}, [subscribeNonceReset, refetchNonce]);
|
|
74
74
|
const buildMessageRef = (0, import_react.useRef)(buildMessage);
|
|
75
75
|
buildMessageRef.current = buildMessage;
|
|
76
|
-
const message = (0, import_react.useMemo)(() => nonce.data ?
|
|
76
|
+
const message = (0, import_react.useMemo)(() => nonce.data ? buildMessageRef.current({
|
|
77
77
|
nonce: nonce.data
|
|
78
78
|
}) : null, [nonce.data]);
|
|
79
79
|
const command = (0, import_react.useMemo)(() => message ? (0, import_signer.gpgSignCommand)(message) : null, [message]);
|
|
@@ -38,17 +38,6 @@ var GPG_NONCE_QUERY_KEY = "ckGpgNonce";
|
|
|
38
38
|
var b64 = function b642(s) {
|
|
39
39
|
return window.btoa(unescape(encodeURIComponent(s)));
|
|
40
40
|
};
|
|
41
|
-
function defaultBuildMessage(param) {
|
|
42
|
-
var {
|
|
43
|
-
nonce
|
|
44
|
-
} = param;
|
|
45
|
-
return `${window.location.host} wants you to sign in with your GPG key.
|
|
46
|
-
|
|
47
|
-
URI: ${window.location.origin}
|
|
48
|
-
Version: 1
|
|
49
|
-
Nonce: ${nonce}
|
|
50
|
-
Issued At: ${(/* @__PURE__ */new Date()).toISOString()}`;
|
|
51
|
-
}
|
|
52
41
|
var GpgProvider = function GpgProvider2(param) {
|
|
53
42
|
var {
|
|
54
43
|
children,
|
|
@@ -81,11 +70,20 @@ var GpgProvider = function GpgProvider2(param) {
|
|
|
81
70
|
refetchOnReconnect: false,
|
|
82
71
|
staleTime: Infinity
|
|
83
72
|
});
|
|
73
|
+
var {
|
|
74
|
+
subscribeNonceReset
|
|
75
|
+
} = gpgConfig;
|
|
76
|
+
var refetchNonce = nonce.refetch;
|
|
77
|
+
(0, import_react.useEffect)(function () {
|
|
78
|
+
if (!subscribeNonceReset) return;
|
|
79
|
+
return subscribeNonceReset(function () {
|
|
80
|
+
void refetchNonce();
|
|
81
|
+
});
|
|
82
|
+
}, [subscribeNonceReset, refetchNonce]);
|
|
84
83
|
var buildMessageRef = (0, import_react.useRef)(buildMessage);
|
|
85
84
|
buildMessageRef.current = buildMessage;
|
|
86
85
|
var message = (0, import_react.useMemo)(function () {
|
|
87
|
-
|
|
88
|
-
return nonce.data ? ((_buildMessageRef_current = buildMessageRef.current) !== null && _buildMessageRef_current !== void 0 ? _buildMessageRef_current : defaultBuildMessage)({
|
|
86
|
+
return nonce.data ? buildMessageRef.current({
|
|
89
87
|
nonce: nonce.data
|
|
90
88
|
}) : null;
|
|
91
89
|
}, [nonce.data]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","GpgProvider_exports","GPG_NONCE_QUERY_KEY","GpgProvider","module","exports","import_jsx_runtime","require","import_react","import_react_query","import_connectkit","import_GpgContext","import_signer","b64","b642","s","window","btoa","unescape","encodeURIComponent","defaultBuildMessage","param","nonce","location","host","origin","Date","toISOString","GpgProvider2","children","enabled","nonceRefetchInterval","buildMessage","onSignIn","gpgConfig","status","setStatus","useState","GpgStatusState","READY","resetStatus","resetStatus2","useContext","GpgContext","Error","Context","useQuery","queryKey","queryFn","getNonce","refetchInterval","refetchOnWindowFocus","refetchOnReconnect","staleTime","Infinity","buildMessageRef","useRef","current","message","useMemo","_buildMessageRef_current","data","command","gpgSignCommand","signIn","signIn2","pastedBlob","blob","assertGpgSignature","error","ERROR","LOADING","result","onSign","username","password","SUCCESS","jsx","Provider"],"sources":["GpgProvider.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar GpgProvider_exports = {};\n__export(GpgProvider_exports, {\n GPG_NONCE_QUERY_KEY: () => GPG_NONCE_QUERY_KEY,\n GpgProvider: () => GpgProvider\n});\nmodule.exports = __toCommonJS(GpgProvider_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = require(\"react\");\nvar import_react_query = require(\"@tanstack/react-query\");\nvar import_connectkit = require(\"@multiplatform.one/connectkit\");\nvar import_GpgContext = require(\"./GpgContext\");\nvar import_signer = require(\"./signer\");\nvar GPG_NONCE_QUERY_KEY = \"ckGpgNonce\";\nvar b64 = function b642(s) {\n return window.btoa(unescape(encodeURIComponent(s)));\n};\nfunction defaultBuildMessage(param) {\n var { nonce } = param;\n return `${window.location.host} wants you to sign in with your GPG key.\n\nURI: ${window.location.origin}\nVersion: 1\nNonce: ${nonce}\nIssued At: ${(/* @__PURE__ */ new Date()).toISOString()}`;\n}\nvar GpgProvider = function GpgProvider2(param) {\n var { children, enabled = true, nonceRefetchInterval = false, buildMessage, onSignIn, ...gpgConfig } = param;\n var [status, setStatus] = (0, import_react.useState)(import_GpgContext.GpgStatusState.READY);\n var resetStatus = function resetStatus2() {\n return setStatus(import_GpgContext.GpgStatusState.READY);\n };\n if ((0, import_react.useContext)(import_GpgContext.GpgContext)) {\n throw new Error(\"Multiple, nested usages of GpgProvider detected. Please use only one.\");\n }\n if ((0, import_react.useContext)(import_connectkit.Context)) {\n throw new Error(\"ConnectKitProvider must be mounted inside GpgProvider.\");\n }\n var nonce = (0, import_react_query.useQuery)({\n queryKey: [\n GPG_NONCE_QUERY_KEY\n ],\n queryFn: function queryFn() {\n return gpgConfig.getNonce();\n },\n refetchInterval: nonceRefetchInterval,\n // The challenge the user signs MUST equal the one we submit. Never refetch the nonce\n // out from under an in-flight signature — especially on window-focus, which fires every\n // time the user tabs to their terminal to run gpg and back.\n refetchOnWindowFocus: false,\n refetchOnReconnect: false,\n staleTime: Infinity\n });\n var buildMessageRef = (0, import_react.useRef)(buildMessage);\n buildMessageRef.current = buildMessage;\n var message = (0, import_react.useMemo)(function() {\n var _buildMessageRef_current;\n return nonce.data ? ((_buildMessageRef_current = buildMessageRef.current) !== null && _buildMessageRef_current !== void 0 ? _buildMessageRef_current : defaultBuildMessage)({\n nonce: nonce.data\n }) : null;\n }, [\n nonce.data\n ]);\n var command = (0, import_react.useMemo)(function() {\n return message ? (0, import_signer.gpgSignCommand)(message) : null;\n }, [\n message\n ]);\n var signIn = async function signIn2(pastedBlob) {\n var blob;\n try {\n blob = (0, import_signer.assertGpgSignature)(pastedBlob);\n } catch (error) {\n setStatus(import_GpgContext.GpgStatusState.ERROR);\n throw error;\n }\n if (!message) {\n setStatus(import_GpgContext.GpgStatusState.ERROR);\n throw new Error(\"Could not fetch nonce\");\n }\n try {\n setStatus(import_GpgContext.GpgStatusState.LOADING);\n var result = await gpgConfig.onSign({\n username: b64(blob),\n password: b64(message),\n message\n });\n if (result === false) throw new Error(\"GPG sign-in was rejected\");\n setStatus(import_GpgContext.GpgStatusState.SUCCESS);\n onSignIn === null || onSignIn === void 0 ? void 0 : onSignIn();\n return true;\n } catch (error) {\n setStatus(import_GpgContext.GpgStatusState.ERROR);\n throw error;\n }\n };\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_GpgContext.GpgContext.Provider, {\n value: {\n enabled,\n nonceRefetchInterval,\n buildMessage,\n ...gpgConfig,\n nonce,\n message,\n command,\n status,\n signIn,\n resetStatus\n },\n children\n });\n};\n//# sourceMappingURL=GpgProvider.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;EAC9B,KAAK,IAAIC,IAAI,IAAID,GAAG,EAClBZ,SAAS,CAACW,MAAM,EAAEE,IAAI,EAAE;IAAEC,GAAG,EAAEF,GAAG,CAAC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B,OAAO;MACPC,oBAAoB;MACpBC,YAAY;MACZ,GAAGE,SAAS;MACZZ,KAAK;MACLoC,OAAO;MACPI,OAAO;MACP3B,MAAM;MACN6B,MAAM;MACNxB;IACF,CAAC;IACDX;EACF,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","GpgProvider_exports","GPG_NONCE_QUERY_KEY","GpgProvider","module","exports","import_jsx_runtime","require","import_react","import_react_query","import_connectkit","import_GpgContext","import_signer","b64","b642","s","window","btoa","unescape","encodeURIComponent","GpgProvider2","param","children","enabled","nonceRefetchInterval","buildMessage","onSignIn","gpgConfig","status","setStatus","useState","GpgStatusState","READY","resetStatus","resetStatus2","useContext","GpgContext","Error","Context","nonce","useQuery","queryKey","queryFn","getNonce","refetchInterval","refetchOnWindowFocus","refetchOnReconnect","staleTime","Infinity","subscribeNonceReset","refetchNonce","refetch","useEffect","buildMessageRef","useRef","current","message","useMemo","data","command","gpgSignCommand","signIn","signIn2","pastedBlob","blob","assertGpgSignature","error","ERROR","LOADING","result","onSign","username","password","SUCCESS","jsx","Provider"],"sources":["GpgProvider.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar GpgProvider_exports = {};\n__export(GpgProvider_exports, {\n GPG_NONCE_QUERY_KEY: () => GPG_NONCE_QUERY_KEY,\n GpgProvider: () => GpgProvider\n});\nmodule.exports = __toCommonJS(GpgProvider_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = require(\"react\");\nvar import_react_query = require(\"@tanstack/react-query\");\nvar import_connectkit = require(\"@multiplatform.one/connectkit\");\nvar import_GpgContext = require(\"./GpgContext\");\nvar import_signer = require(\"./signer\");\nvar GPG_NONCE_QUERY_KEY = \"ckGpgNonce\";\nvar b64 = function b642(s) {\n return window.btoa(unescape(encodeURIComponent(s)));\n};\nvar GpgProvider = function GpgProvider2(param) {\n var { children, enabled = true, nonceRefetchInterval = false, buildMessage, onSignIn, ...gpgConfig } = param;\n var [status, setStatus] = (0, import_react.useState)(import_GpgContext.GpgStatusState.READY);\n var resetStatus = function resetStatus2() {\n return setStatus(import_GpgContext.GpgStatusState.READY);\n };\n if ((0, import_react.useContext)(import_GpgContext.GpgContext)) {\n throw new Error(\"Multiple, nested usages of GpgProvider detected. Please use only one.\");\n }\n if ((0, import_react.useContext)(import_connectkit.Context)) {\n throw new Error(\"ConnectKitProvider must be mounted inside GpgProvider.\");\n }\n var nonce = (0, import_react_query.useQuery)({\n queryKey: [\n GPG_NONCE_QUERY_KEY\n ],\n queryFn: function queryFn() {\n return gpgConfig.getNonce();\n },\n refetchInterval: nonceRefetchInterval,\n // The challenge the user signs MUST equal the one we submit. Never refetch the nonce\n // out from under an in-flight signature — especially on window-focus, which fires every\n // time the user tabs to their terminal to run gpg and back.\n refetchOnWindowFocus: false,\n refetchOnReconnect: false,\n staleTime: Infinity\n });\n var { subscribeNonceReset } = gpgConfig;\n var refetchNonce = nonce.refetch;\n (0, import_react.useEffect)(function() {\n if (!subscribeNonceReset) return;\n return subscribeNonceReset(function() {\n void refetchNonce();\n });\n }, [\n subscribeNonceReset,\n refetchNonce\n ]);\n var buildMessageRef = (0, import_react.useRef)(buildMessage);\n buildMessageRef.current = buildMessage;\n var message = (0, import_react.useMemo)(function() {\n return nonce.data ? buildMessageRef.current({\n nonce: nonce.data\n }) : null;\n }, [\n nonce.data\n ]);\n var command = (0, import_react.useMemo)(function() {\n return message ? (0, import_signer.gpgSignCommand)(message) : null;\n }, [\n message\n ]);\n var signIn = async function signIn2(pastedBlob) {\n var blob;\n try {\n blob = (0, import_signer.assertGpgSignature)(pastedBlob);\n } catch (error) {\n setStatus(import_GpgContext.GpgStatusState.ERROR);\n throw error;\n }\n if (!message) {\n setStatus(import_GpgContext.GpgStatusState.ERROR);\n throw new Error(\"Could not fetch nonce\");\n }\n try {\n setStatus(import_GpgContext.GpgStatusState.LOADING);\n var result = await gpgConfig.onSign({\n username: b64(blob),\n password: b64(message),\n message\n });\n if (result === false) throw new Error(\"GPG sign-in was rejected\");\n setStatus(import_GpgContext.GpgStatusState.SUCCESS);\n onSignIn === null || onSignIn === void 0 ? void 0 : onSignIn();\n return true;\n } catch (error) {\n setStatus(import_GpgContext.GpgStatusState.ERROR);\n throw error;\n }\n };\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_GpgContext.GpgContext.Provider, {\n value: {\n enabled,\n nonceRefetchInterval,\n buildMessage,\n ...gpgConfig,\n nonce,\n message,\n command,\n status,\n signIn,\n resetStatus\n },\n children\n });\n};\n//# sourceMappingURL=GpgProvider.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;EAC9B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AAK,EAAE;MACLuB,OAAO;MACPC,oBAAoB;MACpBC,YAAY;MACZ,GAAGE,SAAS;MACZY,KAAK;MACLiB,OAAO;MACPG,OAAO;MACP/B,MAAM;MACNiC,MAAM;MACN5B;IACF,CAAC;IACDX;EACF,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","GpgStatusState","GpgStatusState2","GpgContext"],"sources":["../../src/GpgContext.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,aAAA,QAAqB;AAQvB,IAAKC,cAAA,GAAL,gBAAKC,eAAA,IAAL;EACLD,eAAA,YAAQ;EACRA,eAAA,cAAU;EACVA,eAAA,cAAU;EACVA,eAAA,YAAQ;EAJE,OAAAC,eAAA;AAAA,GAAAD,cAAA;
|
|
1
|
+
{"version":3,"names":["createContext","GpgStatusState","GpgStatusState2","GpgContext"],"sources":["../../src/GpgContext.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,aAAA,QAAqB;AAQvB,IAAKC,cAAA,GAAL,gBAAKC,eAAA,IAAL;EACLD,eAAA,YAAQ;EACRA,eAAA,cAAU;EACVA,eAAA,cAAU;EACVA,eAAA,YAAQ;EAJE,OAAAC,eAAA;AAAA,GAAAD,cAAA;AA+CL,MAAME,UAAA,GAAaH,aAAA,CAAsC,IAAI","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","GpgStatusState","GpgStatusState2","GpgContext"],"sources":["../../src/GpgContext.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,aAAA,QAAqB;AAQvB,IAAKC,cAAA,GAAL,yBAAKC,eAAL;EACLD,eAAA,YAAQ;EACRA,eAAA,cAAU;EACVA,eAAA,cAAU;EACVA,eAAA,YAAQ;EAJE,OAAAC,eAAA;AAAA;
|
|
1
|
+
{"version":3,"names":["createContext","GpgStatusState","GpgStatusState2","GpgContext"],"sources":["../../src/GpgContext.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,aAAA,QAAqB;AAQvB,IAAKC,cAAA,GAAL,yBAAKC,eAAL;EACLD,eAAA,YAAQ;EACRA,eAAA,cAAU;EACVA,eAAA,cAAU;EACVA,eAAA,YAAQ;EAJE,OAAAC,eAAA;AAAA;AA+CL,IAAAC,UAAM,kBAAmDH,aAAI","ignoreList":[]}
|
package/dist/esm/GpgProvider.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useContext, useMemo, useRef, useState } from "react";
|
|
1
|
+
import { useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { useQuery } from "@tanstack/react-query";
|
|
3
3
|
import { Context as ConnectKitContext } from "@multiplatform.one/connectkit";
|
|
4
4
|
import { GpgContext, GpgStatusState } from "./GpgContext.mjs";
|
|
@@ -6,16 +6,6 @@ import { assertGpgSignature, gpgSignCommand } from "./signer.mjs";
|
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
const GPG_NONCE_QUERY_KEY = "ckGpgNonce";
|
|
8
8
|
const b64 = s => window.btoa(unescape(encodeURIComponent(s)));
|
|
9
|
-
function defaultBuildMessage({
|
|
10
|
-
nonce
|
|
11
|
-
}) {
|
|
12
|
-
return `${window.location.host} wants you to sign in with your GPG key.
|
|
13
|
-
|
|
14
|
-
URI: ${window.location.origin}
|
|
15
|
-
Version: 1
|
|
16
|
-
Nonce: ${nonce}
|
|
17
|
-
Issued At: ${(/* @__PURE__ */new Date()).toISOString()}`;
|
|
18
|
-
}
|
|
19
9
|
const GpgProvider = ({
|
|
20
10
|
children,
|
|
21
11
|
enabled = true,
|
|
@@ -43,9 +33,19 @@ const GpgProvider = ({
|
|
|
43
33
|
refetchOnReconnect: false,
|
|
44
34
|
staleTime: Infinity
|
|
45
35
|
});
|
|
36
|
+
const {
|
|
37
|
+
subscribeNonceReset
|
|
38
|
+
} = gpgConfig;
|
|
39
|
+
const refetchNonce = nonce.refetch;
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (!subscribeNonceReset) return;
|
|
42
|
+
return subscribeNonceReset(() => {
|
|
43
|
+
void refetchNonce();
|
|
44
|
+
});
|
|
45
|
+
}, [subscribeNonceReset, refetchNonce]);
|
|
46
46
|
const buildMessageRef = useRef(buildMessage);
|
|
47
47
|
buildMessageRef.current = buildMessage;
|
|
48
|
-
const message = useMemo(() => nonce.data ?
|
|
48
|
+
const message = useMemo(() => nonce.data ? buildMessageRef.current({
|
|
49
49
|
nonce: nonce.data
|
|
50
50
|
}) : null, [nonce.data]);
|
|
51
51
|
const command = useMemo(() => message ? gpgSignCommand(message) : null, [message]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useContext","useMemo","useRef","useState","useQuery","Context","ConnectKitContext","GpgContext","GpgStatusState","assertGpgSignature","gpgSignCommand","jsx","GPG_NONCE_QUERY_KEY","b64","s","window","btoa","unescape","encodeURIComponent","
|
|
1
|
+
{"version":3,"names":["useContext","useEffect","useMemo","useRef","useState","useQuery","Context","ConnectKitContext","GpgContext","GpgStatusState","assertGpgSignature","gpgSignCommand","jsx","GPG_NONCE_QUERY_KEY","b64","s","window","btoa","unescape","encodeURIComponent","GpgProvider","children","enabled","nonceRefetchInterval","buildMessage","onSignIn","gpgConfig","status","setStatus","READY","resetStatus","Error","nonce","queryKey","queryFn","getNonce","refetchInterval","refetchOnWindowFocus","refetchOnReconnect","staleTime","Infinity","subscribeNonceReset","refetchNonce","refetch","buildMessageRef","current","message","data","command","signIn","pastedBlob","blob","error","ERROR","LOADING","result","onSign","username","password","SUCCESS","Provider","value"],"sources":["../../src/GpgProvider.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAAoBA,UAAA,EAAYC,SAAA,EAAWC,OAAA,EAASC,MAAA,EAAQC,QAAA,QAAgB;AAC5E,SAASC,QAAA,QAAgB;AAEzB,SAASC,OAAA,IAAWC,iBAAA,QAAyB;AAC7C,SAASC,UAAA,EAAuBC,cAAA,QAAsB;AACtD,SAAS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AA;MACAC,YAAA;MACA,GAAGE,SAAA;MACHM,KAAA;MACAc,OAAA;MACAE,OAAA;MACArB,MAAA;MACAsB,MAAA;MACAnB;IACF;IAECT;EAAA,CACH;AAEJ","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useContext, useMemo, useRef, useState } from "react";
|
|
2
|
+
import { useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { useQuery } from "@tanstack/react-query";
|
|
4
4
|
import { Context as ConnectKitContext } from "@multiplatform.one/connectkit";
|
|
5
5
|
import { GpgContext, GpgStatusState } from "./GpgContext.native.js";
|
|
@@ -8,17 +8,6 @@ var GPG_NONCE_QUERY_KEY = "ckGpgNonce";
|
|
|
8
8
|
var b64 = function b642(s) {
|
|
9
9
|
return window.btoa(unescape(encodeURIComponent(s)));
|
|
10
10
|
};
|
|
11
|
-
function defaultBuildMessage(param) {
|
|
12
|
-
var {
|
|
13
|
-
nonce
|
|
14
|
-
} = param;
|
|
15
|
-
return `${window.location.host} wants you to sign in with your GPG key.
|
|
16
|
-
|
|
17
|
-
URI: ${window.location.origin}
|
|
18
|
-
Version: 1
|
|
19
|
-
Nonce: ${nonce}
|
|
20
|
-
Issued At: ${(/* @__PURE__ */new Date()).toISOString()}`;
|
|
21
|
-
}
|
|
22
11
|
var GpgProvider = function GpgProvider2(param) {
|
|
23
12
|
var {
|
|
24
13
|
children,
|
|
@@ -51,11 +40,20 @@ var GpgProvider = function GpgProvider2(param) {
|
|
|
51
40
|
refetchOnReconnect: false,
|
|
52
41
|
staleTime: Infinity
|
|
53
42
|
});
|
|
43
|
+
var {
|
|
44
|
+
subscribeNonceReset
|
|
45
|
+
} = gpgConfig;
|
|
46
|
+
var refetchNonce = nonce.refetch;
|
|
47
|
+
useEffect(function () {
|
|
48
|
+
if (!subscribeNonceReset) return;
|
|
49
|
+
return subscribeNonceReset(function () {
|
|
50
|
+
void refetchNonce();
|
|
51
|
+
});
|
|
52
|
+
}, [subscribeNonceReset, refetchNonce]);
|
|
54
53
|
var buildMessageRef = useRef(buildMessage);
|
|
55
54
|
buildMessageRef.current = buildMessage;
|
|
56
55
|
var message = useMemo(function () {
|
|
57
|
-
|
|
58
|
-
return nonce.data ? ((_buildMessageRef_current = buildMessageRef.current) !== null && _buildMessageRef_current !== void 0 ? _buildMessageRef_current : defaultBuildMessage)({
|
|
56
|
+
return nonce.data ? buildMessageRef.current({
|
|
59
57
|
nonce: nonce.data
|
|
60
58
|
}) : null;
|
|
61
59
|
}, [nonce.data]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["jsx","_jsx","useContext","useMemo","useRef","useState","useQuery","Context","ConnectKitContext","GpgContext","GpgStatusState","assertGpgSignature","gpgSignCommand","GPG_NONCE_QUERY_KEY","b64","b642","s","window","btoa","unescape","encodeURIComponent","
|
|
1
|
+
{"version":3,"names":["jsx","_jsx","useContext","useEffect","useMemo","useRef","useState","useQuery","Context","ConnectKitContext","GpgContext","GpgStatusState","assertGpgSignature","gpgSignCommand","GPG_NONCE_QUERY_KEY","b64","b642","s","window","btoa","unescape","encodeURIComponent","GpgProvider","GpgProvider2","param","children","enabled","nonceRefetchInterval","buildMessage","onSignIn","gpgConfig","status","setStatus","READY","resetStatus","resetStatus2","Error","nonce","queryKey","queryFn","getNonce","refetchInterval","refetchOnWindowFocus","refetchOnReconnect","staleTime","Infinity","subscribeNonceReset","refetchNonce","refetch","buildMessageRef","current","message","data","command","signIn","signIn2","pastedBlob","blob","error","ERROR","LOADING","result","onSign","username","password","SUCCESS","Provider","value"],"sources":["../../src/GpgProvider.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAAoBA,GAAA,IAAAC,IAAA,QAAY,mBAAoB;AACpD,SAASC,UAAA,EAAAC,SAAgB,EAAAC,OAAA,EAAAC,MAAA,EAAAC,QAAA;AAEzB,SAASC,QAAA,QAAW,uBAAyB;AAC7C,SAASC,OAAA,IA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
"version": "7.
|
|
3
|
+
"version": "7.24.0",
|
|
4
4
|
"description": "Sign-In With GPG (SIWG) screen + GpgProvider for the connectkit modal — no viem",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"connectkit",
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"access": "public"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@multiplatform.one/connectkit": "7.
|
|
70
|
+
"@multiplatform.one/connectkit": "7.24.0",
|
|
71
71
|
"@noble/hashes": "^1.8.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@multiplatform.one/config": "7.
|
|
74
|
+
"@multiplatform.one/config": "7.24.0",
|
|
75
75
|
"@tamagui/build": "2.7.6",
|
|
76
76
|
"react": "19.2.5",
|
|
77
77
|
"typescript": "~5.9.3"
|
package/src/GpgContext.tsx
CHANGED
|
@@ -27,18 +27,23 @@ export type GpgConfig = {
|
|
|
27
27
|
message: string;
|
|
28
28
|
}) => Promise<boolean | void> | boolean | void;
|
|
29
29
|
|
|
30
|
-
//
|
|
31
|
-
|
|
30
|
+
// Required: the challenge the user signs. Build it with mpo web3's
|
|
31
|
+
// buildWalletMessage("gpg", ...); web3's GpgProvider passes that by default.
|
|
32
|
+
buildMessage: (args: { nonce: string }) => string;
|
|
32
33
|
enabled?: boolean;
|
|
33
34
|
// Background nonce refetch. Default `false`: the challenge MUST stay byte-stable from
|
|
34
35
|
// sign to submit (a refetch recomputes `message` and desyncs it from the signature).
|
|
35
36
|
nonceRefetchInterval?: number | false;
|
|
37
|
+
// Called with a listener on mount; the provider refetches its nonce whenever the
|
|
38
|
+
// listener fires (e.g. keycloakWallet's resetNonce once a sign-in consumed it).
|
|
39
|
+
// Returns the unsubscribe.
|
|
40
|
+
subscribeNonceReset?: (listener: () => void) => () => void;
|
|
36
41
|
};
|
|
37
42
|
|
|
38
43
|
export type GpgContextValue = Required<
|
|
39
|
-
Pick<GpgConfig, "getNonce" | "onSign" | "enabled" | "nonceRefetchInterval">
|
|
44
|
+
Pick<GpgConfig, "getNonce" | "onSign" | "enabled" | "nonceRefetchInterval" | "buildMessage">
|
|
40
45
|
> & {
|
|
41
|
-
|
|
46
|
+
subscribeNonceReset?: GpgConfig["subscribeNonceReset"];
|
|
42
47
|
nonce: ReturnType<typeof useQuery<string | null>>;
|
|
43
48
|
// Derived from the nonce — what the user copies/signs, and the ready-to-run command.
|
|
44
49
|
message: string | null;
|
package/src/GpgProvider.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode, useContext, useMemo, useRef, useState } from "react";
|
|
1
|
+
import { ReactNode, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { useQuery } from "@tanstack/react-query";
|
|
3
3
|
|
|
4
4
|
import { Context as ConnectKitContext } from "@multiplatform.one/connectkit";
|
|
@@ -16,18 +16,6 @@ export const GPG_NONCE_QUERY_KEY = "ckGpgNonce";
|
|
|
16
16
|
// so plain btoa would corrupt non-ASCII. Must keep the unescape(encodeURIComponent()).
|
|
17
17
|
const b64 = (s: string) => window.btoa(unescape(encodeURIComponent(s)));
|
|
18
18
|
|
|
19
|
-
// The default SIWG challenge. Only the header line (domain) and the Nonce line are
|
|
20
|
-
// load-bearing per the server's GpgMessage grammar; the rest is a cosmetic envelope.
|
|
21
|
-
function defaultBuildMessage({ nonce }: { nonce: string }): string {
|
|
22
|
-
return (
|
|
23
|
-
`${window.location.host} wants you to sign in with your GPG key.\n\n` +
|
|
24
|
-
`URI: ${window.location.origin}\n` +
|
|
25
|
-
`Version: 1\n` +
|
|
26
|
-
`Nonce: ${nonce}\n` +
|
|
27
|
-
`Issued At: ${new Date().toISOString()}`
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
19
|
export const GpgProvider = ({
|
|
32
20
|
children,
|
|
33
21
|
enabled = true,
|
|
@@ -60,6 +48,15 @@ export const GpgProvider = ({
|
|
|
60
48
|
staleTime: Infinity,
|
|
61
49
|
});
|
|
62
50
|
|
|
51
|
+
const { subscribeNonceReset } = gpgConfig;
|
|
52
|
+
const refetchNonce = nonce.refetch;
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (!subscribeNonceReset) return;
|
|
55
|
+
return subscribeNonceReset(() => {
|
|
56
|
+
void refetchNonce();
|
|
57
|
+
});
|
|
58
|
+
}, [subscribeNonceReset, refetchNonce]);
|
|
59
|
+
|
|
63
60
|
// Compute the challenge ONCE per nonce (it embeds an Issued At timestamp); recomputing
|
|
64
61
|
// on every render would desync the displayed/copied message from the one base64'd into
|
|
65
62
|
// `password`, breaking the signature (which is verified over the exact message bytes).
|
|
@@ -68,8 +65,7 @@ export const GpgProvider = ({
|
|
|
68
65
|
const buildMessageRef = useRef(buildMessage);
|
|
69
66
|
buildMessageRef.current = buildMessage;
|
|
70
67
|
const message = useMemo(
|
|
71
|
-
() =>
|
|
72
|
-
nonce.data ? (buildMessageRef.current ?? defaultBuildMessage)({ nonce: nonce.data }) : null,
|
|
68
|
+
() => (nonce.data ? buildMessageRef.current({ nonce: nonce.data }) : null),
|
|
73
69
|
[nonce.data],
|
|
74
70
|
);
|
|
75
71
|
const command = useMemo(() => (message ? gpgSignCommand(message) : null), [message]);
|
package/types/GpgContext.d.ts
CHANGED
|
@@ -12,14 +12,15 @@ export type GpgConfig = {
|
|
|
12
12
|
password: string;
|
|
13
13
|
message: string;
|
|
14
14
|
}) => Promise<boolean | void> | boolean | void;
|
|
15
|
-
buildMessage
|
|
15
|
+
buildMessage: (args: {
|
|
16
16
|
nonce: string;
|
|
17
17
|
}) => string;
|
|
18
18
|
enabled?: boolean;
|
|
19
19
|
nonceRefetchInterval?: number | false;
|
|
20
|
+
subscribeNonceReset?: (listener: () => void) => () => void;
|
|
20
21
|
};
|
|
21
|
-
export type GpgContextValue = Required<Pick<GpgConfig, "getNonce" | "onSign" | "enabled" | "nonceRefetchInterval">> & {
|
|
22
|
-
|
|
22
|
+
export type GpgContextValue = Required<Pick<GpgConfig, "getNonce" | "onSign" | "enabled" | "nonceRefetchInterval" | "buildMessage">> & {
|
|
23
|
+
subscribeNonceReset?: GpgConfig["subscribeNonceReset"];
|
|
23
24
|
nonce: ReturnType<typeof useQuery<string | null>>;
|
|
24
25
|
message: string | null;
|
|
25
26
|
command: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GpgContext.d.ts","sourceRoot":"","sources":["../src/GpgContext.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAOjD,oBAAY,cAAc;IACxB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,SAAS,GAAG;IAEtB,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAMhC,MAAM,EAAE,CAAC,IAAI,EAAE;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;KACjB,KAAK,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"GpgContext.d.ts","sourceRoot":"","sources":["../src/GpgContext.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAOjD,oBAAY,cAAc;IACxB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,SAAS,GAAG;IAEtB,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAMhC,MAAM,EAAE,CAAC,IAAI,EAAE;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;KACjB,KAAK,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC;IAI/C,YAAY,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;IAClD,OAAO,CAAC,EAAE,OAAO,CAAC;IAGlB,oBAAoB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAItC,mBAAmB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;CAC5D,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,QAAQ,CACpC,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,sBAAsB,GAAG,cAAc,CAAC,CAC7F,GAAG;IACF,mBAAmB,CAAC,EAAE,SAAS,CAAC,qBAAqB,CAAC,CAAC;IACvD,KAAK,EAAE,UAAU,CAAC,OAAO,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IAElD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACjD,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,UAAU,iDAA8C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GpgProvider.d.ts","sourceRoot":"","sources":["../src/GpgProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"GpgProvider.d.ts","sourceRoot":"","sources":["../src/GpgProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoD,MAAM,OAAO,CAAC;AAIpF,OAAO,EAAc,SAAS,EAAkB,MAAM,cAAc,CAAC;AAGrE,KAAK,KAAK,GAAG,SAAS,GAAG;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAMhD,eAAO,MAAM,WAAW,GAAI,mFAOzB,KAAK,4CAgGP,CAAC"}
|