Closed WhitWaldo closed 9 months ago
Attention: 122 lines
in your changes are missing coverage. Please review.
Comparison is base (
348d143
) 68.48% compared to head (48bd541
) 67.17%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
/assign
@philliphoff Would appreciate your thoughts on this: Because of the method signature conflict, I renamed the encrypt/decrypt methods that took a stream and returned an IAsyncEnumerable<byte[]>
to EncryptStreamAsync
and DecryptStreamAsync
.
Now that the Stream -> ReadOnlyMemory
Now that the Stream -> ReadOnlyMemory method is out of the picture, do you think it makes the API more accessible to keep these different names or instead expose just the EncryptAsync and DecryptAsync methods again with their various overloads?
I would try to use just a single method name (EncryptAsync()
and DecryptAsync()
), if possible, as that keeps the API completion lists shorter and groups related methods together better.
To support this code, best to also add a quickstart example at the same. I have raised the issue here https://github.com/dapr/quickstarts/issues/969
To support this code, best to also add a quickstart example at the same. I have raised the issue here dapr/quickstarts#969
There is a working sample provided in the .NET SDK that the documentation is synced with, but the only reason I didn't add a quickstart to pair with this is because it uses a NuGet reference to Dapr instead of a package reference and since these bits aren't a part of Dapr yet, I wouldn't be able to test it end-to-end. Rather, I figured that once this was included in the SDK, that'd be the very next piece to tackle as it could be merged into a the docs/repo in a patch release.
@philliphoff Apparently I somehow dismissed your review. Mind giving it another pass?
Apparently I somehow dismissed your review. Mind giving it another pass?
@WhitWaldo Re-approved. Not sure why the DCO check isn't passing; might try to re-sign the commits?
@philliphoff Looks like it's the fourth commit (2e1e6b335cc1421dc71556fea48de2c0e133011f) is missing the DCO. I know how to revert the last commit and amend it, but this is 41 commits in the past. Any chance you know the commands necessary to amend that commit?
@WhitWaldo What I've done in the past is rebase and squash the changes into a single commit, then amend that commit with the signoff. Or, rebase and amend each commit with the signoff (if needed). Then force push the change. I don't know which way you'd find easier.
If the terminal only supported multi-line commit messages, that would have been much easier to deal with. As it is, I believe I've properly merged this and the DCO check is validating as it should. @philliphoff
@WhitWaldo Would you be willing to look at the differences in code coverage and see if there are some tests that could be added to bring it back to parity with the baseline?
@philliphoff I can give it a look, but I don't know that there's a whole lot that can be added on the .NET side since it's largely just shuffling the bytes out and vice versa, as all the magic happens on the Dapr sidecar. Give me a few days and I'll see what I can add to it that I don't already have in there. What's the baseline we're aiming for?
What's the baseline we're aiming for?
@WhitWaldo Ideally we'd end up close to the same test coverage as the baseline (i.e. prior to the changes). The coverage maps show a good portion of the new logic that isn't covered. This may just be a false-negative, but something to look at to see if that's the case or, if not, how easy it is to get it covered.
Merging this to ensure it's in 1.13; more test coverage would be nice prior to the APIs being considered stable but can wait.
Description
This adds support for Cryptography building block (alpha) in .NET supporting both the encrypt and decrypt streaming APIs.
Examples work and I've updated the README to reflect use with Azure Key Vault (RBAC, environment variable install, etc.).
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
This closes #1072 - per recommendations in Discord, this streams the requests in configurable blocks (defaulting to 4 KB), sending only the request metadata payload in the first message and sending the plaintext/ciphertext blocks in subsequent messages. I manually updated the relevant sections of the dapr.proto pulling from the latest in dapr/dapr.
Submitted update for docs at https://github.com/dapr/docs/pull/3928. Also needs a Quickstart to show how this is used https://github.com/dapr/quickstarts/issues/969
I still need to figure out how to write any tests for this, but I confirmed that my example (properly configured) runs without issue locally.
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: