Repository navigation
Conversation
added 2 commits
November 17, 2026 22:58
The signature end (HNSHA) is masked in both debug modes: segmentToString replaces the custom signature, and the raw dump replaces the whole segment. A failed HTTP request no longer puts the response body into the error message, which tends to end up in application logs; with debug on, the body is still printed.
A CAMT or MT940 parse failure was logged with console.warn and turned into an empty statement list, which callers cannot tell apart from an account without transactions. The error now propagates from getAccountStatements.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two fixes that came up while using lib-fints for a daily, unattended statement fetch.
PIN and TAN stay out of debug output and request errors
debugEnabled,HttpClientprinted every request. The signature end segment (HNSHA) carries the PIN and, after approval, the TAN, so both landed in the log in both modes.segmentToStringnow masks the custom signature, and the raw dump (debugRaw) replaces the HNSHA segment. The newredactSignaturefollows FinTS escaping (?',?+), so a PIN with special characters is masked completely.Request failed with status code …: <body>. Errors tend to end up in application logs, and a gateway's error page may echo parts of the request. The message is now just the status code; with debug on, the body is still printed.A statement that cannot be parsed is an error
StatementInteractionCAMTandStatementInteractionMT940caught parse failures, logged them withconsole.warnand returnedstatements: []. A caller cannot tell that apart from an account without transactions, so for bookkeeping a parse failure silently becomes "nothing happened". The error now propagates fromgetAccountStatements(). This changes behaviour for callers who relied on the empty list, so it may deserve a note in the changelog.Related open PRs, not duplicated here: #44 / #48 (raw statement documents), #45 (request timeout), #46 (no account data in decode-error logs).
Tests:
src/tests/credentialRedaction.test.ts,src/tests/statementParseFailure.test.ts(all five fail without the change).vitest run(182 tests),tsc --noEmitandbiome ci srcpass.