gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated (84ca0b1c -> f2492cac)


From: gnunet
Subject: [taler-wallet-core] branch master updated (84ca0b1c -> f2492cac)
Date: Fri, 15 Oct 2021 07:50:28 +0200

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

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

    from 84ca0b1c show summary on the history page
     new c25b2698 Pass Sandbox credentials to the CLI's env.
     new 883ed972 Not tolerating != 200 responses during (libEufin) tests.
     new f2492cac Fix key-rotation test case.

The 3 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:
 .../src/integrationtests/libeufin.ts               | 57 ++++++++++------------
 .../src/integrationtests/test-libeufin-c5x.ts      |  1 +
 .../integrationtests/test-libeufin-keyrotation.ts  | 24 ++++++---
 3 files changed, 46 insertions(+), 36 deletions(-)

diff --git a/packages/taler-wallet-cli/src/integrationtests/libeufin.ts 
b/packages/taler-wallet-cli/src/integrationtests/libeufin.ts
index a5f37a6b..2ee98952 100644
--- a/packages/taler-wallet-cli/src/integrationtests/libeufin.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/libeufin.ts
@@ -218,17 +218,6 @@ export class LibeufinSandboxService implements 
LibeufinSandboxServiceInterface {
         LIBEUFIN_SANDBOX_DB_CONNECTION: this.sandboxConfig.databaseJdbcUri,
       },
     );
-    await runCommand(
-      this.globalTestState,
-      "libeufin-sandbox-superuser",
-      "libeufin-sandbox",
-      ["superuser", "admin", "--password", "test"],
-      {
-        ...process.env,
-        LIBEUFIN_SANDBOX_DB_CONNECTION: this.sandboxConfig.databaseJdbcUri,
-      },
-    );
-
     this.sandboxProc = this.globalTestState.spawnService(
       "libeufin-sandbox",
       ["serve", "--port", `${this.sandboxConfig.httpPort}`],
@@ -236,6 +225,7 @@ export class LibeufinSandboxService implements 
LibeufinSandboxServiceInterface {
       {
         ...process.env,
         LIBEUFIN_SANDBOX_DB_CONNECTION: this.sandboxConfig.databaseJdbcUri,
+        LIBEUFIN_SANDBOX_ADMIN_PASSWORD: "secret",
       },
     );
   }
@@ -271,7 +261,7 @@ export class LibeufinSandboxService implements 
LibeufinSandboxServiceInterface {
   }
 
   async pingUntilAvailable(): Promise<void> {
-    const url = `${this.baseUrl}config`;
+    const url = this.baseUrl;
     await pingProc(this.sandboxProc, url, "libeufin-sandbox");
   }
 }
@@ -485,14 +475,22 @@ export class LibeufinCli {
     this.cliDetails = cd;
   }
 
+  env(): any {
+    return {
+      ...process.env,
+      LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl,
+      LIBEUFIN_SANDBOX_USERNAME: "admin",
+      LIBEUFIN_SANDBOX_PASSWORD: "secret",
+    }
+  }
+
   async checkSandbox(): Promise<void> {
     const stdout = await sh(
       this.globalTestState,
       "libeufin-cli-checksandbox",
       "libeufin-cli sandbox check",
-      { ...process.env, LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl },
+      this.env()
     );
-    console.log(stdout);
   }
 
   async createEbicsHost(hostId: string): Promise<void> {
@@ -500,7 +498,7 @@ export class LibeufinCli {
       this.globalTestState,
       "libeufin-cli-createebicshost",
       `libeufin-cli sandbox ebicshost create --host-id=${hostId}`,
-      { ...process.env, LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl },
+      this.env()
     );
     console.log(stdout);
   }
@@ -515,7 +513,7 @@ export class LibeufinCli {
         ` --host-id=${details.hostId}` +
         ` --partner-id=${details.partnerId}` +
         ` --user-id=${details.userId}`,
-      { ...process.env, LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl },
+      this.env()
     );
     console.log(stdout);
   }
@@ -536,7 +534,7 @@ export class LibeufinCli {
         ` --ebics-host-id=${sd.hostId}` +
         ` --ebics-partner-id=${sd.partnerId}` +
         ` --ebics-user-id=${sd.userId}`,
-      { ...process.env, LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl },
+      this.env()
     );
     console.log(stdout);
   }
@@ -546,7 +544,7 @@ export class LibeufinCli {
       this.globalTestState,
       "libeufin-cli-generatetransactions",
       `libeufin-cli sandbox bankaccount generate-transactions ${accountName}`,
-      { ...process.env, LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl },
+      this.env()
     );
     console.log(stdout);
   }
@@ -556,7 +554,7 @@ export class LibeufinCli {
       this.globalTestState,
       "libeufin-cli-showsandboxtransactions",
       `libeufin-cli sandbox bankaccount transactions ${accountName}`,
-      { ...process.env, LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl },
+      this.env()
     );
     console.log(stdout);
   }
@@ -831,7 +829,7 @@ export namespace LibeufinSandboxApi {
     await axios.post(url.href, {}, {
       auth: {
         username: "admin",
-        password: "test",
+        password: "secret",
       },
     });
   }
@@ -848,7 +846,7 @@ export namespace LibeufinSandboxApi {
     {
       auth: {
         username: "admin",
-        password: "test",
+        password: "secret",
       },
     });
   }
@@ -862,7 +860,7 @@ export namespace LibeufinSandboxApi {
     await axios.post(url.href, req, {
       auth: {
         username: "admin",
-        password: "test",
+        password: "secret",
       },
     });
   }
@@ -876,7 +874,7 @@ export namespace LibeufinSandboxApi {
     await axios.post(url.href, req, {
       auth: {
         username: "admin",
-        password: "test",
+        password: "secret",
       },
     });
   }
@@ -890,7 +888,7 @@ export namespace LibeufinSandboxApi {
     await axios.post(url.href, req, {
       auth: {
         username: "admin",
-        password: "test",
+        password: "secret",
       },
     });
   }
@@ -904,7 +902,7 @@ export namespace LibeufinSandboxApi {
     await axios.post(url.href, req, {
       auth: {
         username: "admin",
-        password: "test",
+        password: "secret",
       },
     });
   }
@@ -946,7 +944,7 @@ export namespace LibeufinSandboxApi {
     await axios.post(url.href, req, {
       auth: {
         username: "admin",
-        password: "test",
+        password: "secret",
       },
     });
   }
@@ -963,7 +961,7 @@ export namespace LibeufinSandboxApi {
     const res = await axios.get(url.href, {
       auth: {
         username: "admin",
-        password: "test",
+        password: "secret",
       },
     });
     return res.data as SandboxAccountTransactions;
@@ -982,7 +980,7 @@ export namespace LibeufinSandboxApi {
     {
       auth: {
         username: "admin",
-        password: "test",
+        password: "secret",
       },
     });
   }
@@ -999,7 +997,7 @@ export namespace LibeufinSandboxApi {
     return await axios.get(url.href, {
       auth: {
         username: "admin",
-        password: "test",
+        password: "secret",
       },
     });
   }
@@ -1345,7 +1343,6 @@ export namespace LibeufinNexusApi {
           username: username,
           password: password,
         },
-        validateStatus: () => true,
       },
     );
   }
diff --git 
a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-c5x.ts 
b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-c5x.ts
index ebde5206..e45f0a23 100644
--- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-c5x.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-c5x.ts
@@ -100,6 +100,7 @@ export async function runLibeufinC5xTest(t: 
GlobalTestState) {
   );
   t.assertTrue(expectOne.data.newTransactions == 1);
   t.assertTrue(expectOne.data.downloadedTransactions == 1);
+
   let expectZero = await LibeufinNexusApi.fetchTransactions(
     libeufinServices.libeufinNexus,
     user01nexus.localAccountName,
diff --git 
a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-keyrotation.ts 
b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-keyrotation.ts
index 6a5e5c20..8e527804 100644
--- 
a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-keyrotation.ts
+++ 
b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-keyrotation.ts
@@ -57,11 +57,23 @@ export async function runLibeufinKeyrotationTest(t: 
GlobalTestState) {
     user01sandbox.ebicsBankAccount.subscriber.hostID,
   );
 
-  const resp = await LibeufinNexusApi.fetchTransactions(
-    libeufinServices.libeufinNexus,
-    user01nexus.localAccountName,
-  );
-  console.log("Attempted fetch after key rotation", resp.data);
-  t.assertTrue(resp.status == 500);
+  try {
+    await LibeufinNexusApi.fetchTransactions(
+      libeufinServices.libeufinNexus,
+      user01nexus.localAccountName,
+    );
+  } catch (e: any) {
+    /**
+     * Asserting that Nexus responded with a 500 Internal server
+     * error, because the bank signed the last response with a new
+     * key pair that was never downloaded by Nexus.
+     *
+     * NOTE: the bank accepted the request addressed to the old
+     * public key.  Should it in this case reject the request even
+     * before trying to verify it?
+     */
+    t.assertTrue(e.response.status == 500);
+    t.assertTrue(e.response.data.code == 9000);
+  }
 }
 runLibeufinKeyrotationTest.suites = ["libeufin"];

-- 
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]