diff options
author | Sebastian <sebasjm@gmail.com> | 2024-05-06 13:06:05 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-05-06 13:06:05 -0300 |
commit | f062d9f774944063784907b6788a17e543a36d54 (patch) | |
tree | d1f1a71ef13cd63b55ce63df6df6f19e1872a1d2 /packages/taler-harness | |
parent | bf03157b6570af6804032e206a3c60a3c7e030f3 (diff) | |
download | wallet-core-f062d9f774944063784907b6788a17e543a36d54.tar.xz |
fix #8783
Diffstat (limited to 'packages/taler-harness')
-rw-r--r-- | packages/taler-harness/src/index.ts | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/packages/taler-harness/src/index.ts b/packages/taler-harness/src/index.ts index 2b1fd9a0d..315173b7f 100644 --- a/packages/taler-harness/src/index.ts +++ b/packages/taler-harness/src/index.ts @@ -33,7 +33,8 @@ import { TalerMerchantInstanceHttpClient, TalerMerchantManagementHttpClient, TransactionsResponse, - createAccessToken, + createRFC8959AccessTokenEncoded, + createRFC8959AccessTokenPlain, decodeCrock, encodeCrock, generateIban, @@ -690,12 +691,12 @@ deploymentCli help: "if everything worked ok, change the password of the accounts at the end", }) .action(async (args) => { - const managementToken = createAccessToken( + const managementToken = createRFC8959AccessTokenPlain( args.provisionBankMerchant.merchantToken, ); const bankAdminPassword = args.provisionBankMerchant.bankPassword; const bankAdminTokenArg = args.provisionBankMerchant.bankToken - ? createAccessToken(args.provisionBankMerchant.bankToken) + ? createRFC8959AccessTokenPlain(args.provisionBankMerchant.bankToken) : undefined; const id = args.provisionBankMerchant.id; const name = args.provisionBankMerchant.name; @@ -812,7 +813,7 @@ deploymentCli address: {}, auth: { method: "token", - token: createAccessToken(password), + token: createRFC8959AccessTokenPlain(password), }, default_pay_delay: Duration.toTalerProtocolDuration( Duration.fromSpec({ hours: 1 }), @@ -844,7 +845,7 @@ deploymentCli */ { const resp = await merchantInstance.addBankAccount( - createAccessToken(password), + createRFC8959AccessTokenEncoded(password), { payto_uri: accountPayto, credit_facade_url: bank.getRevenueAPI(id).href, @@ -887,7 +888,7 @@ deploymentCli { const resp = await merchantInstance.addTemplate( - createAccessToken(password), + createRFC8959AccessTokenEncoded(password), { template_id: "default", template_description: "First template", @@ -967,10 +968,10 @@ deploymentCli { const resp = await merchantInstance.updateCurrentInstanceAuthentication( - createAccessToken(prevPassword), + createRFC8959AccessTokenEncoded(prevPassword), { method: "token", - token: createAccessToken(randomPassword), + token: createRFC8959AccessTokenPlain(randomPassword), }, ); if (resp.type === "fail") { @@ -984,7 +985,7 @@ deploymentCli { const resp = await merchantInstance.updateBankAccount( - createAccessToken(randomPassword), + createRFC8959AccessTokenEncoded(randomPassword), wireAccount, { credit_facade_url: bank.getRevenueAPI(id).href, @@ -1042,10 +1043,13 @@ deploymentCli const httpLib = createPlatformHttpLib({}); const baseUrl = args.provisionMerchantInstance.merchantApiBaseUrl; const api = new TalerMerchantManagementHttpClient(baseUrl, httpLib); - const managementToken = createAccessToken( + const managementToken = createRFC8959AccessTokenEncoded( args.provisionMerchantInstance.managementToken, ); - const instanceToken = createAccessToken( + const instanceTokenEnc = createRFC8959AccessTokenPlain( + args.provisionMerchantInstance.instanceToken, + ); + const instanceTokenPlain = createRFC8959AccessTokenPlain( args.provisionMerchantInstance.instanceToken, ); const instanceId = args.provisionMerchantInstance.id; @@ -1059,7 +1063,7 @@ deploymentCli address: {}, auth: { method: "token", - token: instanceToken, + token: instanceTokenPlain, }, default_pay_delay: Duration.toTalerProtocolDuration( Duration.fromSpec({ hours: 1 }), @@ -1082,7 +1086,7 @@ deploymentCli process.exit(2); } - const createAccountResp = await api.addBankAccount(instanceToken, { + const createAccountResp = await api.addBankAccount(instanceTokenEnc, { payto_uri: accountPayto, credit_facade_url: bankURL, credit_facade_credentials: |