gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated (a602e671 -> bc01a04d)


From: gnunet
Subject: [taler-wallet-core] branch master updated (a602e671 -> bc01a04d)
Date: Wed, 09 Sep 2020 17:50:24 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a change to branch master
in repository wallet-core.

    from a602e671 zip file generation with extension name adjustment
     new f32062cc check bank's protocol version first, fix typo
     new bc01a04d version bump

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 packages/taler-wallet-android/package.json         |  2 +-
 packages/taler-wallet-cli/package.json             |  2 +-
 packages/taler-wallet-core/package.json            |  2 +-
 packages/taler-wallet-core/src/TalerErrorCode.ts   |  7 +++++
 .../taler-wallet-core/src/operations/versions.ts   |  7 +++++
 .../taler-wallet-core/src/operations/withdraw.ts   | 31 ++++++++++++++++++++--
 packages/taler-wallet-core/src/types/talerTypes.ts | 13 +++++++++
 packages/taler-wallet-webextension/manifest.json   |  4 +--
 packages/taler-wallet-webextension/package.json    |  2 +-
 9 files changed, 62 insertions(+), 8 deletions(-)

diff --git a/packages/taler-wallet-android/package.json 
b/packages/taler-wallet-android/package.json
index bf074939..54ebf519 100644
--- a/packages/taler-wallet-android/package.json
+++ b/packages/taler-wallet-android/package.json
@@ -1,6 +1,6 @@
 {
   "name": "taler-wallet-android",
-  "version": "0.8.0-rc.1",
+  "version": "0.8.0-rc.2",
   "description": "",
   "engines": {
     "node": ">=0.12.0"
diff --git a/packages/taler-wallet-cli/package.json 
b/packages/taler-wallet-cli/package.json
index a05e55c4..9284cabc 100644
--- a/packages/taler-wallet-cli/package.json
+++ b/packages/taler-wallet-cli/package.json
@@ -1,6 +1,6 @@
 {
   "name": "taler-wallet-cli",
-  "version": "0.8.0-rc.1",
+  "version": "0.8.0-rc.2",
   "description": "",
   "engines": {
     "node": ">=0.12.0"
diff --git a/packages/taler-wallet-core/package.json 
b/packages/taler-wallet-core/package.json
index ecebc9aa..047d8eb7 100644
--- a/packages/taler-wallet-core/package.json
+++ b/packages/taler-wallet-core/package.json
@@ -1,6 +1,6 @@
 {
   "name": "taler-wallet-core",
-  "version": "0.8.0-rc.1",
+  "version": "0.8.0-rc.2",
   "description": "",
   "engines": {
     "node": ">=0.12.0"
diff --git a/packages/taler-wallet-core/src/TalerErrorCode.ts 
b/packages/taler-wallet-core/src/TalerErrorCode.ts
index e1f777f2..e2f6324c 100644
--- a/packages/taler-wallet-core/src/TalerErrorCode.ts
+++ b/packages/taler-wallet-core/src/TalerErrorCode.ts
@@ -3279,6 +3279,13 @@ export enum TalerErrorCode {
    */
   WALLET_TIPPING_COIN_SIGNATURE_INVALID = 7016,
 
+  /**
+   * The wallet does not implement a version of the bank integration API that 
is compatible with the version offered by the bank.
+   * Returned with an HTTP status code of #MHD_HTTP_UNINITIALIZED (0).
+   * (A value of 0 indicates that the error is generated client-side).
+   */
+  WALLET_BANK_INTEGRATION_PROTOCOL_VERSION_INCOMPATIBLE = 7017,
+
   /**
    * End of error code range.
    * Returned with an HTTP status code of #MHD_HTTP_UNINITIALIZED (0).
diff --git a/packages/taler-wallet-core/src/operations/versions.ts 
b/packages/taler-wallet-core/src/operations/versions.ts
index 31c4921c..11ff8f52 100644
--- a/packages/taler-wallet-core/src/operations/versions.ts
+++ b/packages/taler-wallet-core/src/operations/versions.ts
@@ -28,6 +28,13 @@ export const WALLET_EXCHANGE_PROTOCOL_VERSION = "8:0:0";
  */
 export const WALLET_MERCHANT_PROTOCOL_VERSION = "1:0:0";
 
+/**
+ * Protocol version spoken with the merchant.
+ *
+ * Uses libtool's current:revision:age versioning.
+ */
+export const WALLET_BANK_INTEGRATION_PROTOCOL_VERSION = "0:0:0";
+
 /**
  * Cache breaker that is appended to queries such as /keys and /wire
  * to break through caching, if it has been accidentally/badly configured
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts 
b/packages/taler-wallet-core/src/operations/withdraw.ts
index e44ac7cf..b5670a82 100644
--- a/packages/taler-wallet-core/src/operations/withdraw.ts
+++ b/packages/taler-wallet-core/src/operations/withdraw.ts
@@ -37,12 +37,13 @@ import {
   codecForWithdrawResponse,
   WithdrawUriInfoResponse,
   WithdrawResponse,
+  codecForTalerConfigResponse,
 } from "../types/talerTypes";
 import { InternalWalletState } from "./state";
 import { parseWithdrawUri } from "../util/taleruri";
 import { Logger } from "../util/logging";
 import { updateExchangeFromUrl, getExchangeTrust } from "./exchanges";
-import { WALLET_EXCHANGE_PROTOCOL_VERSION } from "./versions";
+import { WALLET_EXCHANGE_PROTOCOL_VERSION, 
WALLET_BANK_INTEGRATION_PROTOCOL_VERSION } from "./versions";
 
 import * as LibtoolVersion from "../util/libtoolVersion";
 import {
@@ -62,6 +63,7 @@ import { URL } from "../util/url";
 import { TalerErrorCode } from "../TalerErrorCode";
 import { encodeCrock } from "../crypto/talerCrypto";
 import { updateRetryInfoTimeout, initRetryInfo } from "../util/retries";
+import { compare } from "../util/libtoolVersion";
 
 const logger = new Logger("withdraw.ts");
 
@@ -152,8 +154,33 @@ export async function getBankWithdrawalInfo(
   if (!uriResult) {
     throw Error(`can't parse URL ${talerWithdrawUri}`);
   }
+
+  const configReqUrl = new URL(
+    "config",
+    uriResult.bankIntegrationApiBaseUrl,
+  )
+
+  const configResp = await ws.http.get(configReqUrl.href);
+  const config = await readSuccessResponseJsonOrThrow(
+    configResp,
+    codecForTalerConfigResponse(),
+  );
+
+  const versionRes = compare(WALLET_BANK_INTEGRATION_PROTOCOL_VERSION, 
config.version);
+  if (versionRes?.compatible != true) {
+    const opErr = makeErrorDetails(
+      TalerErrorCode.WALLET_BANK_INTEGRATION_PROTOCOL_VERSION_INCOMPATIBLE,
+      "bank integration protocol version not compatible with wallet",
+      {
+        exchangeProtocolVersion: config.version,
+        walletProtocolVersion: WALLET_BANK_INTEGRATION_PROTOCOL_VERSION,
+      },
+    );
+    throw new OperationFailedError(opErr);
+  }
+
   const reqUrl = new URL(
-    `api/withdraw-operation/${uriResult.withdrawalOperationId}`,
+    `withdrawal-operation/${uriResult.withdrawalOperationId}`,
     uriResult.bankIntegrationApiBaseUrl,
   );
   const resp = await ws.http.get(reqUrl.href);
diff --git a/packages/taler-wallet-core/src/types/talerTypes.ts 
b/packages/taler-wallet-core/src/types/talerTypes.ts
index ce83080c..fe30fa8b 100644
--- a/packages/taler-wallet-core/src/types/talerTypes.ts
+++ b/packages/taler-wallet-core/src/types/talerTypes.ts
@@ -1455,3 +1455,16 @@ export const codecForMerchantAbortPayRefundStatus = (): 
Codec<
     .alternative("success", codecForMerchantAbortPayRefundSuccessStatus())
     .alternative("failure", codecForMerchantAbortPayRefundFailureStatus())
     .build("MerchantAbortPayRefundStatus");
+
+export interface TalerConfigResponse {
+  name: string;
+  version: string;
+  currency?: string;
+}
+
+export const codecForTalerConfigResponse = (): Codec<TalerConfigResponse> =>
+  buildCodecForObject<TalerConfigResponse>()
+    .property("name", codecForString())
+    .property("version", codecForString())
+    .property("currency", codecOptional(codecForString()))
+    .build("TalerConfigResponse");
diff --git a/packages/taler-wallet-webextension/manifest.json 
b/packages/taler-wallet-webextension/manifest.json
index caefb4c1..32412636 100644
--- a/packages/taler-wallet-webextension/manifest.json
+++ b/packages/taler-wallet-webextension/manifest.json
@@ -4,8 +4,8 @@
   "name": "GNU Taler Wallet (git)",
   "description": "Privacy preserving and transparent payments",
   "author": "GNU Taler Developers",
-  "version": "0.8.0.1",
-  "version_name": "0.8.0-rc.1",
+  "version": "0.8.0.2",
+  "version_name": "0.8.0-rc.2",
 
   "minimum_chrome_version": "51",
   "minimum_opera_version": "36",
diff --git a/packages/taler-wallet-webextension/package.json 
b/packages/taler-wallet-webextension/package.json
index c363d04c..af63a3dd 100644
--- a/packages/taler-wallet-webextension/package.json
+++ b/packages/taler-wallet-webextension/package.json
@@ -1,6 +1,6 @@
 {
   "name": "taler-wallet-webextension",
-  "version": "0.8.0-rc.1",
+  "version": "0.8.0-rc.2",
   "description": "GNU Taler Wallet browser extension",
   "main": "./build/index.js",
   "types": "./build/index.d.ts",

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]