Skip to content

refactor: move crypto out of DaprClientImpl - #1914

Merged
javier-aliaga merged 1 commit into
dapr:masterfrom
javier-aliaga:refactor/split-daprclientimpl-crypto
Nov 21, 2026
Merged

javier-aliaga merged 1 commit into
dapr:masterfrom
javier-aliaga:refactor/split-daprclientimpl-crypto

Conversation

@javier-aliaga

Copy link
Copy Markdown
Contributor

Description

Seventh step of splitting DaprClientImpl into package-private classes, one per building block. This PR moves the cryptography API (alpha).

  • New package-private class DaprCryptoClient holds the streaming encrypt and decrypt methods. The bodies are unchanged.
  • The public methods on DaprClientImpl keep their signatures and Javadoc, and delegate in one line.
  • No public API change. DaprClientImpl goes from 1,516 to 1,339 lines.

Issue reference

Part of #1875

Checklist

  • Code compiles correctly
  • Created/updated tests. DaprPreviewClientGrpcTest covers encrypt and decrypt through the public methods. The 670 sdk unit tests pass unchanged.
  • Extended the documentation. Not needed, internal change.

Signed-off-by: Javier Aliaga <javier@diagrid.io>
Copilot AI lite review requested due to automatic review settings November 20, 2026 09:21

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.

🟢 Approval recommended

No active review issues were identified, and the change preserves the existing public API while extracting the streaming cryptography implementation into a dedicated client.

No open issues 🎉

What changed in this PR

This pull request extracts the alpha cryptography streaming implementation from DaprClientImpl into a package-private DaprCryptoClient while preserving the existing public API and behavior.

Changes:

  • Added DaprCryptoClient for streaming encryption and decryption.
  • Initialized the crypto client in DaprClientImpl.
  • Updated the public cryptography methods to delegate to the extracted client.
File Description
sdk/​src/​main/​java/​io/​dapr/​client/​DaprCryptoClient.java Contains the extracted streaming encryption and decryption implementations.
sdk/​src/​main/​java/​io/​dapr/​client/​DaprClientImpl.java Initializes the crypto client and delegates the public cryptography methods to it.

Review effort: Lite

@javier-aliaga
javier-aliaga marked this pull request as ready for review November 20, 2026 09:23
@javier-aliaga
javier-aliaga requested review from a team as code owners November 20, 2026 09:23
@cicoyle cicoyle self-assigned this Nov 20, 2026

@artur-ciocanu artur-ciocanu 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.

❤️

@artur-ciocanu

Copy link
Copy Markdown
Contributor

@javier-aliaga it seems that coverage might need some ❤️ 😄

@codecov

codecov Bot commented Nov 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.35294% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.63%. Comparing base (0b14377) to head (a3b17d5).

Files with missing lines Patch % Lines
...src/main/java/io/dapr/client/DaprCryptoClient.java 81.89% 14 Missing and 7 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1914      +/-   ##
============================================
- Coverage     82.66%   82.63%   -0.04%     
- Complexity     3952     3954       +2     
============================================
  Files           354      355       +1     
  Lines         11935    11941       +6     
  Branches       1339     1339              
============================================
+ Hits           9866     9867       +1     
- Misses         1561     1567       +6     
+ Partials        508      507       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cicoyle cicoyle removed their assignment Nov 21, 2026
@javier-aliaga
javier-aliaga merged commit 546cf28 into dapr:master Nov 21, 2026
16 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants