@1shotapi/ows-signer 0.3.3 → 0.3.4
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 +1 -0
- package/package.json +1 -1
- package/src/handlers.js +20 -3
package/README.md
CHANGED
|
@@ -58,6 +58,7 @@ Ceremony UI params (optional on WebAuthn-triggering methods): `explanationHeader
|
|
|
58
58
|
- `rpName` — relying party display name in passkey UI (default `"OWS"`); does not affect `rpId`
|
|
59
59
|
- `userDisplayName` — friendly account label (defaults to `name`)
|
|
60
60
|
- `userId` — stable user handle bytes (base64); random if omitted
|
|
61
|
+
- `deferKeyDerivation` — when true, skip the PRF follow-up get; `CredentialCreated` includes `credentialId` + `cosePublicKey` only (no `KeyDerived` / no `secp256k1PublicKey`)
|
|
61
62
|
|
|
62
63
|
## Signing schemes
|
|
63
64
|
|
package/package.json
CHANGED
package/src/handlers.js
CHANGED
|
@@ -249,16 +249,33 @@ async function handleCreateCredential(params, correlationId, targetOrigin) {
|
|
|
249
249
|
}
|
|
250
250
|
const options =
|
|
251
251
|
params.options && typeof params.options === "object"
|
|
252
|
-
? /** @type {{ rpName?: string, userDisplayName?: string, userId?: string, explanationHeader?: string, explanationText?: string, confirmButtonText?: string, denyButtonText?: string }} */ (
|
|
252
|
+
? /** @type {{ rpName?: string, userDisplayName?: string, userId?: string, deferKeyDerivation?: boolean, explanationHeader?: string, explanationText?: string, confirmButtonText?: string, denyButtonText?: string }} */ (
|
|
253
253
|
params.options
|
|
254
254
|
)
|
|
255
255
|
: {};
|
|
256
|
+
const deferKeyDerivation = options.deferKeyDerivation === true;
|
|
256
257
|
|
|
257
258
|
await withCeremony(async () => {
|
|
258
|
-
// Create + optional PRF follow-up get stay under one Confirm panel so the
|
|
259
|
-
// explanation remains visible for every WebAuthn prompt in this RPC.
|
|
260
259
|
/** @type {PublicKeyCredential | undefined} */
|
|
261
260
|
let registrationCredential;
|
|
261
|
+
|
|
262
|
+
if (deferKeyDerivation) {
|
|
263
|
+
// Registration only — opener (or another signer session) will unlock later.
|
|
264
|
+
await promptCeremonyConfirm(options, async () => {
|
|
265
|
+
registrationCredential = await createPasskeyCredential(name, options);
|
|
266
|
+
});
|
|
267
|
+
if (!registrationCredential) {
|
|
268
|
+
throw new Error("createCredential: registration credential missing");
|
|
269
|
+
}
|
|
270
|
+
emitEvent(window.parent, targetOrigin, "CredentialCreated", correlationId, {
|
|
271
|
+
credentialId: getCredentialId(registrationCredential),
|
|
272
|
+
cosePublicKey: getCosePublicKeyBase64Url(registrationCredential),
|
|
273
|
+
});
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// Create + optional PRF follow-up get stay under one Confirm panel so the
|
|
278
|
+
// explanation remains visible for every WebAuthn prompt in this RPC.
|
|
262
279
|
const prfCredential = await promptCeremonyConfirm(options, async () => {
|
|
263
280
|
registrationCredential = await createPasskeyCredential(name, options);
|
|
264
281
|
const credentialId = getCredentialId(registrationCredential);
|