Fix key-rotation test case.
This commit is contained in:
parent
883ed972a4
commit
f2492cac6d
@ -57,11 +57,23 @@ export async function runLibeufinKeyrotationTest(t: GlobalTestState) {
|
|||||||
user01sandbox.ebicsBankAccount.subscriber.hostID,
|
user01sandbox.ebicsBankAccount.subscriber.hostID,
|
||||||
);
|
);
|
||||||
|
|
||||||
const resp = await LibeufinNexusApi.fetchTransactions(
|
try {
|
||||||
libeufinServices.libeufinNexus,
|
await LibeufinNexusApi.fetchTransactions(
|
||||||
user01nexus.localAccountName,
|
libeufinServices.libeufinNexus,
|
||||||
);
|
user01nexus.localAccountName,
|
||||||
console.log("Attempted fetch after key rotation", resp.data);
|
);
|
||||||
t.assertTrue(resp.status == 500);
|
} 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"];
|
runLibeufinKeyrotationTest.suites = ["libeufin"];
|
||||||
|
Loading…
Reference in New Issue
Block a user