Skip to content

fix: remove private key from wallet logs#544

Merged
maycon-mello merged 3 commits into
masterfrom
dcka-5512-remove-private-key-from-logs
Jun 22, 2026
Merged

fix: remove private key from wallet logs#544
maycon-mello merged 3 commits into
masterfrom
dcka-5512-remove-private-key-from-logs

Conversation

@maycon-mello

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces the risk of leaking sensitive wallet material by removing verbose logging that could include private keys (via full document dumps) and replacing it with safe, high-level diagnostics.

Changes:

  • Replace RPC wallet storage “existing storage found” log from full JSON dump to a document count.
  • Remove logging of the full RPC storage payload on error.
  • Update keyDocToKeypair error message to avoid embedding the full keyDoc (which may contain private key material).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/wasm/src/wallet/rpc-storage-interface.js Stops logging full storage contents; logs only document counts in load/find paths.
packages/wasm/src/services/credential/utils.js Sanitizes the “missing private key” error message to avoid dumping key documents.
Comments suppressed due to low confidence (1)

packages/wasm/src/wallet/rpc-storage-interface.js:93

  • find now calls Object.keys(this.documents || {}) twice (once for logging and once to build the result), which needlessly iterates all document IDs twice. You can compute the keys once and reuse them for both logging and mapping.
  async find({has = undefined, equals = undefined} = {}) {
    Logger.debug('Execute find', {
      equals,
      documentCount: Object.keys(this.documents || {}).length,
    });

    const documents = Object.keys(this.documents || {})
      .map(docId => {
        const content = this.documents[docId];

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/wasm/src/services/credential/utils.js
@maycon-mello
maycon-mello merged commit 84691c3 into master Jun 22, 2026
7 checks passed
@maycon-mello
maycon-mello deleted the dcka-5512-remove-private-key-from-logs branch June 22, 2026 19:16
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.

3 participants