commit 12ab9751f74d65012a49407f291e5581a09007ed
parent 8ad2cb033664fd9e828aba2e71c671bb10b24195
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date: Wed, 17 Dec 2025 11:20:05 +0900
mailbox: no camelcasein API change
Diffstat:
2 files changed, 13 insertions(+), 22 deletions(-)
diff --git a/packages/taler-util/src/types-taler-mailbox.ts b/packages/taler-util/src/types-taler-mailbox.ts
@@ -149,10 +149,10 @@ export interface MailboxRegisterRequest {
export const codecForTalerMailboxMetadata =
(): Codec<MailboxMetadata> =>
buildCodecForObject<MailboxMetadata>()
- .property("signingKey", codecForEddsaPublicKey())
- .property("signingKeyType", codecForConstString("EdDSA"))
- .property("encryptionKey", codecForString())
- .property("encryptionKeyType", codecForConstString("X25519"))
+ .property("signing_key", codecForEddsaPublicKey())
+ .property("signing_key_type", codecForConstString("EdDSA"))
+ .property("encryption_key", codecForString())
+ .property("encryption_key_type", codecForConstString("X25519"))
.property("expiration", codecForTimestamp)
.build("TalerMailboxApi.MailboxMessageKeys");
@@ -163,24 +163,24 @@ export interface MailboxMetadata {
// Note that $H_MAILBOX == H(singingKey).
// Note also how this key cannot be updated
// as it identifies the mailbox.
- signingKey: EddsaPublicKeyString;
+ signing_key: EddsaPublicKeyString;
// Type of key.
// Optional, as currently only
// EdDSA keys are supported.
- signingKeyType?: string;
+ signing_key_type?: string;
// The mailbox encryption key.
// This is an HPKE public key
// in the X25519 format for use
// in a X25519-DHKEM (RFC 9180).
// Base32 crockford-encoded.
- encryptionKey: string;
+ encryption_key: string;
// Type of key.
// Optional, as currently only
// X25519 keys are supported.
- encryptionKeyType?: string;
+ encryption_key_type?: string;
// Expiration of this mapping.
expiration: Timestamp;
diff --git a/packages/taler-wallet-core/src/mailbox.ts b/packages/taler-wallet-core/src/mailbox.ts
@@ -51,16 +51,7 @@ import {
AbsoluteTime,
TalerSignaturePurpose,
HttpStatusCode,
- Codec,
- buildCodecForUnion,
- buildCodecForObject,
- codecForConstString,
- codecOptional,
- codecForString,
- opKnownFailure,
TalerUris,
- parseTalerUri,
- Paytos,
succeedOrValue,
} from "@gnu-taler/taler-util";
import {
@@ -168,10 +159,10 @@ export async function registerMailbox(
const msgToSign = new Uint8Array([...(new Uint8Array(messageHeader)), ...digest]);
const signature = eddsaSign(msgToSign, privateSigningKey);
const info: MailboxMetadata = {
- signingKey: encodeCrock(signingKey),
- signingKeyType: "EdDSA", // FIXME only supported key type ATM,
- encryptionKey: encodeCrock(encryptionKey),
- encryptionKeyType: "X25519", // FIXME only supported encryption key type ATM
+ signing_key: encodeCrock(signingKey),
+ signing_key_type: "EdDSA", // FIXME only supported key type ATM,
+ encryption_key: encodeCrock(encryptionKey),
+ encryption_key_type: "X25519", // FIXME only supported encryption key type ATM
expiration: mailboxConf.expiration,
};
const req: MailboxRegisterRequest = {
@@ -396,7 +387,7 @@ export async function sendTalerUriMessage(
default:
throw Error("unable to get mailbox keys");
}
- const encryptedMessage = encryptTalerUriMessage(decodeCrock(keys.encryptionKey),
+ const encryptedMessage = encryptTalerUriMessage(decodeCrock(keys.encryption_key),
req.talerUri,
paddedMessageSize);
const resSend = await mailboxClient.sendMessage({