Skip to content

fix(client): redact credentials from SDK object diagnostics - #375

Merged
ffumero2003 merged 1 commit into
release/v0.5.0from
fix-redact-sdk-object-diagnostics-release
Nov 10, 2026
Merged

ffumero2003 merged 1 commit into
release/v0.5.0from
fix-redact-sdk-object-diagnostics-release

Conversation

@ffumero2003

Copy link
Copy Markdown
Contributor

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.0 is not yet released — there is no v0.5.0 tag, 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

  • Ports fix(client): redact credentials from SDK object diagnostics #351 (fix(client): redact credentials from SDK object diagnostics) onto the release branch: the application key and authorization tokens move into # private fields on B2Client, Bucket, B2Object, InMemoryAccountInfo, FileAccountInfo, and the upload URL pools, with safe toJSON() / util.inspect summaries, so console.log / util.inspect / JSON.stringify / object spread no longer expose stored credentials.
  • B2Client.accountInfo becomes a prototype accessor (no own property, no setter) so object spread and Object.keys cannot surface the store. This is a breaking change, marked BREAKING: in the CHANGELOG, with the no-setter / subclass (TS2610) restriction documented in the public accountInfo TSDoc.
  • Moving credentials into private (#) fields means any method that reads them — most methods on B2Client, Bucket, B2Object, InMemoryAccountInfo, FileAccountInfo, and the upload URL pools — now throws when the instance is called through a Proxy wrapper (e.g. Vue reactive(client)); a method touching only ordinary state (e.g. FileAccountInfo.flushed()) is unaffected. This is a separate breaking change — it has its own BREAKING: CHANGELOG entry under ### Changed and a MIGRATION.md section with before/after code and the workaround.

Review

sdk-panel-review was run on this branch. The redaction fix and its tests verified clean; the full release verify passes. Outstanding documentation-precision items for reviewer polish (non-blocking; no behavior impact):

  • Add the Proxy/TypeError restriction note to each affected class's TSDoc (currently on B2Client.accountInfo only; also applies to Bucket, B2Object, InMemoryAccountInfo, FileAccountInfo, UploadUrlPool).
  • List the new public toJSON() methods and exported *Json types (B2ClientJson, InMemoryAccountInfoJson, FileAccountInfoJson) in the changelog.
  • Brings fix(client): redact credentials from SDK object diagnostics #351's redaction test suites (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 verify passed (full test suite incl. the redaction suites, typecheck, lint, build, and the release verify scripts; exports OK at v0.5.0).
  • tsc --noEmit clean after the TSDoc/changelog edits.

Delivers the credential-redaction fix tracked privately; no public issue (handled as a neutral security change, per #351).

* 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 ffumero2003 self-assigned this Nov 10, 2026
@ffumero2003
ffumero2003 merged commit 759fee5 into release/v0.5.0 Nov 10, 2026
@ffumero2003
ffumero2003 deleted the fix-redact-sdk-object-diagnostics-release branch November 10, 2026 16:57
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant