libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 466aef4be5a216b58b95ab251912f53b7d54a7d5
parent ebb2b8787936d98590baaef37865e6b720b75bb7
Author: MS <ms@taler.net>
Date:   Mon, 25 Sep 2023 21:24:34 +0200

Stop limiting token duration.

Diffstat:
Mbank/src/main/kotlin/tech/libeufin/bank/CorebankApiHandlers.kt | 5-----
Mbank/src/main/kotlin/tech/libeufin/bank/Main.kt | 5-----
Mbank/src/test/kotlin/Common.kt | 1-
3 files changed, 0 insertions(+), 11 deletions(-)

diff --git a/bank/src/main/kotlin/tech/libeufin/bank/CorebankApiHandlers.kt b/bank/src/main/kotlin/tech/libeufin/bank/CorebankApiHandlers.kt @@ -50,11 +50,6 @@ fun Routing.accountsMgmtHandlers(db: Database, ctx: BankApplicationContext) { val tokenBytes = ByteArray(32).apply { Random().nextBytes(this) } - val maxDurationTime: Long = ctx.maxAuthTokenDurationUs - if (req.duration != null && req.duration.d_us > maxDurationTime) throw forbidden( - "Token duration bigger than bank's limit", // FIXME: define new EC for this case. - TalerErrorCode.TALER_EC_END - ) val tokenDurationUs = req.duration?.d_us ?: TOKEN_DEFAULT_DURATION_US val customerDbRow = customer.dbRowId ?: throw internalServerError( "Could not get customer '${customer.login}' database row ID" diff --git a/bank/src/main/kotlin/tech/libeufin/bank/Main.kt b/bank/src/main/kotlin/tech/libeufin/bank/Main.kt @@ -102,10 +102,6 @@ data class BankApplicationContext( */ val suggestedWithdrawalExchange: String?, /** - * Max token duration in microseconds. - */ - val maxAuthTokenDurationUs: Long, - /** * URL where the user should be redirected to complete the captcha. * It can contain the substring "{woid}" that is going to be replaced * with the withdrawal operation id and should point where the bank @@ -379,7 +375,6 @@ fun readBankApplicationContextFromConfig(cfg: TalerConfig): BankApplicationConte registrationBonus = cfg.requireValueAmount("libeufin-bank", "registration_bonus", currency), suggestedWithdrawalExchange = cfg.lookupValueString("libeufin-bank", "suggested_withdrawal_exchange"), defaultAdminDebtLimit = cfg.requireValueAmount("libeufin-bank", "default_admin_debt_limit", currency), - maxAuthTokenDurationUs = cfg.requireValueDuration("libeufin-bank", "max_auth_token_duration"), spaCaptchaURL = cfg.lookupValueString("libeufin-bank", "spa_captcha_url"), ) } diff --git a/bank/src/test/kotlin/Common.kt b/bank/src/test/kotlin/Common.kt @@ -45,7 +45,6 @@ fun getTestContext( registrationBonusEnabled = false, registrationBonus = null, suggestedWithdrawalExchange = suggestedExchange, - maxAuthTokenDurationUs = 200 * 1000000, spaCaptchaURL = null, ) } \ No newline at end of file