Repository navigation
fix(client): redact credentials from SDK object diagnostics - #375
Merged
ffumero2003 merged 1 commit intoNov 10, 2026
Merged
Conversation
* test: cover credential redaction in SDK object diagnostics Assert that util.inspect, console.log, JSON.stringify and object spread of clients, bucket and file handles, auth stores and upload URL pools never contain the application key or authorization tokens, and that getAuth(), authorize() and file auth caches still carry the real token. * fix(client): redact credentials from SDK object diagnostics Hold the application key, stored authorization and upload URL pools in private fields, give B2Client and the account-info stores a redacted toJSON/inspect summary, and expose accountInfo through a getter, mirroring the Partner client. * docs: note credential redaction and the accountInfo accessor change
ffumero2003
added a commit
that referenced
this pull request
Nov 10, 2026
* fix(upload): record large-file SHA-1 and support resume (#354) * fix(upload): retry upload POST connection failures by default (#344) * fix(upload): preserve SHA-1 integrity during large-file resume (#365) * chore: update vulnerable transitive dependencies (#340) * chore: update development tooling for dependency audit (#361) * chore: allowlist minimatch audit advisory (#363) * chore(release): prepare isolated v0.5.0 * test(upload): verify connection-failure phases and SHA-1 * docs: make the upload retry migration example self-contained * fix(client): redact credentials from SDK object diagnostics (#351) (#375) * test: cover credential redaction in SDK object diagnostics Assert that util.inspect, console.log, JSON.stringify and object spread of clients, bucket and file handles, auth stores and upload URL pools never contain the application key or authorization tokens, and that getAuth(), authorize() and file auth caches still carry the real token. * fix(client): redact credentials from SDK object diagnostics Hold the application key, stored authorization and upload URL pools in private fields, give B2Client and the account-info stores a redacted toJSON/inspect summary, and expose accountInfo through a getter, mirroring the Partner client. * docs: note credential redaction and the accountInfo accessor change * feat(upload): add single-file connection-fault retry opt-out (#376) * feat(upload): add single-file connection-fault retry opt-out * refactor(upload): resolve connection-fault retry options --------- Co-authored-by: Sophie <49928680+sophiecarreras@users.noreply.github.com>
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.
Context
Adds the credential-redaction change from #351 to the pending 0.5.0 release line so the 0.5.0 release ships it alongside the upload fixes already on the branch.
v0.5.0is not yet released — there is nov0.5.0tag, and #366 ("Release 0.5.0") is still the open release PR that assembles this version. The## [0.5.0]CHANGELOG section is that in-progress release, so its entries (upload retry, whole-file SHA-1, and now this redaction change) are intentionally recorded under## [0.5.0], matching how #366 already structured the section;## [Unreleased]stays empty until after this release ships.Changes
fix(client): redact credentials from SDK object diagnostics) onto the release branch: the application key and authorization tokens move into#private fields onB2Client,Bucket,B2Object,InMemoryAccountInfo,FileAccountInfo, and the upload URL pools, with safetoJSON()/util.inspectsummaries, soconsole.log/util.inspect/JSON.stringify/ object spread no longer expose stored credentials.B2Client.accountInfobecomes a prototype accessor (no own property, no setter) so object spread andObject.keyscannot surface the store. This is a breaking change, markedBREAKING:in the CHANGELOG, with the no-setter / subclass (TS2610) restriction documented in the publicaccountInfoTSDoc.#) fields means any method that reads them — most methods onB2Client,Bucket,B2Object,InMemoryAccountInfo,FileAccountInfo, and the upload URL pools — now throws when the instance is called through aProxywrapper (e.g. Vuereactive(client)); a method touching only ordinary state (e.g.FileAccountInfo.flushed()) is unaffected. This is a separate breaking change — it has its ownBREAKING:CHANGELOG entry under### Changedand aMIGRATION.mdsection with before/after code and the workaround.Review
sdk-panel-reviewwas run on this branch. The redaction fix and its tests verified clean; the full releaseverifypasses. Outstanding documentation-precision items for reviewer polish (non-blocking; no behavior impact):Proxy/TypeErrorrestriction note to each affected class's TSDoc (currently onB2Client.accountInfoonly; also applies toBucket,B2Object,InMemoryAccountInfo,FileAccountInfo,UploadUrlPool).toJSON()methods and exported*Jsontypes (B2ClientJson,InMemoryAccountInfoJson,FileAccountInfoJson) in the changelog.src/redaction.test.ts,src/redaction.node.test.ts,src/test-utils/redaction-export-review.ts).Scope is exactly #351: no UrlGuard HTTPS change (#358), no dependency/manifest changes.
Verification
pnpm install --frozen-lockfile && pnpm run verifypassed (full test suite incl. the redaction suites, typecheck, lint, build, and the release verify scripts; exports OK at v0.5.0).tsc --noEmitclean after the TSDoc/changelog edits.Delivers the credential-redaction fix tracked privately; no public issue (handled as a neutral security change, per #351).