diff options
author | Florian Dold <florian@dold.me> | 2023-11-13 16:30:28 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-11-13 18:36:37 +0100 |
commit | 58c16b2dd500a8999f3d3cd3f1236aabc8ddd2bf (patch) | |
tree | c25fe3957a1a8c2895cd312897c1835f881c9490 /packages/taler-harness | |
parent | 038e4210698fdeb634821fe9a68498d8d64aa319 (diff) |
harness: towards fixing the kyc integration test
Diffstat (limited to 'packages/taler-harness')
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-kyc.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-kyc.ts b/packages/taler-harness/src/integrationtests/test-kyc.ts index 319e8828f..be6e704ee 100644 --- a/packages/taler-harness/src/integrationtests/test-kyc.ts +++ b/packages/taler-harness/src/integrationtests/test-kyc.ts @@ -26,6 +26,7 @@ import { TransactionMajorState, TransactionMinorState, TransactionType, + encodeCrock, } from "@gnu-taler/taler-util"; import { createPlatformHttpLib } from "@gnu-taler/taler-util/http"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; @@ -129,6 +130,7 @@ export async function createKycTestkudosEnvironment( "kyc_oauth2_info_url", "http://localhost:6666/oauth/v2/info", ); + config.setString(myprov, "kyc_oauth2_converter_helper", "/bin/cat"); config.setString(myprov, "kyc_oauth2_client_id", "taler-exchange"); config.setString(myprov, "kyc_oauth2_client_secret", "exchange-secret"); config.setString(myprov, "kyc_oauth2_post_url", "https://taler.net"); @@ -239,8 +241,13 @@ async function runTestfakeKycService(): Promise<TestfakeKycService> { if (!redirUriUnparsed) { throw Error("missing redirect_url"); } + const state = qp.get("state"); + if (!state) { + throw Error("missing state"); + } const redirUri = new URL(redirUriUnparsed); redirUri.searchParams.set("code", "code_is_ok"); + redirUri.searchParams.set("state", state); res.writeHead(200, { "Content-Type": "application/json" }); res.end( JSON.stringify({ @@ -388,6 +395,11 @@ export async function runKycTest(t: GlobalTestState) { const proofHttpResp = await httpLib.fetch(kycProofUrl); logger.info(`proof resp status ${proofHttpResp.status}`); logger.info(`resp headers ${j2s(proofHttpResp.headers.toJSON())}`); + if (!(proofHttpResp.status >= 200 && proofHttpResp.status <= 299)) { + logger.error("kyc proof failed"); + logger.info(await proofHttpResp.text()); + t.assertTrue(false); + } // Now that KYC is done, withdrawal should finally succeed. |