Commit Graph

30 Commits

Author SHA1 Message Date
Whit Waldo faeeb8eaca
Fix for large file cryptography support (#1528)
* Porting the changes from Dapr.Cryptography 1.16 back to 1.15

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
2025-05-02 16:51:41 -05:00
Whit Waldo 55895fa19d
Updated Dapr runtime/CLI version used in integration tests (#1485)
* Updated itests.yml to use latest 1.15 runtime and CLI versions over 1.14 versions
* Updated CLI argument name as `dapr-http-max-request-size` was changed in a recent update included in the CLI

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
2025-03-16 20:14:32 -05:00
Whit Waldo ef54d75f70
Simplfying Crypto example (#1442)
* Fixed bad console output showing encrypted bytes

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Simplified example so it doesn't require an Azure Key Vault instance and just uses a local set of keys

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated README to include instructions for generating the private key

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Added private RSA key to project for users that lack OpenSSL on their system - updated README to include warning calling out that this key shouldn't be used for anything but demonstration and testing purposes.

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

---------

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
2025-01-14 17:38:28 -06:00
Divya Perumal 3a930c26d2
#906 -Added methods in status API supports for saving and reading binary data (#1116)
* Added methods in status API supports for direct storage and reading of byte arrays #906

Signed-off-by: Divya Perumal <divzi.perumal@gmail.com>
Signed-off-by: Divya Perumal <diperuma@microsoft.com>
2024-12-11 14:41:14 -06:00
Whit Waldo 91ee78aff4
Add .NET client for pub/sub support - streaming subscriptions (#1381)
* Building out Dapr.Messaging and test project for streaming pubsub subscriptions

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Added copyright notices

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Minor stylistic updates

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Added generic client builder to support publish/subscribe client builder

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Tweaked XML comment

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Added several unit tests for the generic client builder

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated to include latest review changes:
- Added lock so that while we guarantee the method is called only once, it should be thread-safe now
- Marked PublishSubscribeReceiver as internal so its members aren't part of the public API
- Updated TopicMessage to use IReadOnlyDictionary

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Switched to interlock exchange instead of lock to slightly simplify code

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Added sample project

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Minor changes to unit test

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Deleted protos folder

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Using lowercase protos dir name

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Added registration extension methods

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated example to use DI registration

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Added default cancellation token

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Passing stream into method instead of creating it twice

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

---------

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
2024-11-05 11:57:21 -06:00
Rafael Câmara c61b15d5b1
Remove unused using statements. (#1313)
Signed-off-by: Rafael Camara <rafaelcamarac@gmail.com>
2024-10-24 17:00:09 -05:00
Whit Waldo 236567786e
Removes floating classes and introduces Dapr.Common project (#1365)
Extracting classes out to common project

---------

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
2024-10-16 00:21:52 -05:00
Whit Waldo 0a978458bb
Fixed security advisory updates across dependencies (transitive and direct) (#1366)
Migrating whole solution to Central Package Management - several package version upgrades to address security advisories and otherwise.

---------

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
2024-10-15 18:09:53 -05:00
Whit Waldo 98be2a3717
Merge branch 'master' into remove-workflow-methods 2024-09-03 08:30:20 -05:00
Whit Waldo 0709a586f9 Removed deprecated methods from DaprClient and tests as well as unused types
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
2024-09-03 06:30:41 -05:00
Phillip Hoff 74f6b0127f
Merge 1.14 release branch back into `master`. (#1337) 2024-08-21 23:47:39 -07:00
Whit Waldo ca2fab2567
Implementing Cryptography building block in .NET (#1217)
* Added method to DaprClient and GRPC implementation to call cryptography proto endpoints

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* First pass at implementing all exposed Cryptography methods on Go interface

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Added examples for Cryptography block

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Added missing copyright statements

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated to properly support Crypto API this time

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Added copyright statements

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Removed deprecated examples as the subtle APIs are presently disabled

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated example to reflect new API shape

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated example and readme

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Added overloads for encrypting/decrypting streams instead of just fixed byte arrays. Added example demonstrating the same encrypting a file via a FileStream and decrypting from a MemoryStream.

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Added some unit tests to pair with the implementation

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Added null check for the stream argument

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Changed case of the arguments as they should read "plaintext" and not "plainText"

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Reduced number of encryption implementations by just wrapping byte array into memory stream

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Constrainted returned member types per review suggestion

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated methods to use ReadOnlyMemory<byte> instead of byte[] - updated implementations to use low-allocation spans where possible (though ToArray is necessary to wrap with MemoryStream).

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated to use encryption/decryption options instead of lots of method overload variations. Simplified gRPC implementation to use fewer methods. Applied argument name updates applied previously (plainText -> plaintext).

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated tests

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Removed unused reference

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated examples to reflect new method shapes. Downgraded package to .net 6 instead of .net 8 per review suggestion.

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated to reflect non-aliased values per review suggestion

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Update to ensure that both send/receive streams run at the same time instead of sequentially.

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated to support streamed results in addition to fixed byte arrays. Refactored implementation to minimize duplicative code.

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated example to fix compile issue

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Removed encrypt/decrypt methods that accepted streams and returned ReadOnlyMemory<byte>. Marked implementations that use this on the gRPC class as private instead.

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Added missing Obsolete attributes on Encrypt/Decrypt methods. Added overloads on decrypt methods that do not require a DecryptionOptions to be passed in.

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated encrypt/decrypt options so the streaming block size no longer uses a uint. Added validation in its place to ensure the value provided is never less than or equal to 0.

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated how validation works in the options to accommodate lack of the shorter variation in .NET 6

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated names of encrypt/decrypt streaming methods so everything uses just EncryptAsync or DecryptAsync

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Fixed regression that would have prevented data from being sent entirely to the sidecar. Also simplified operation per suggestion in review.

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated examples to reflect changed API

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated so IAsyncEnumerable methods (encrypt and decrypt) return IAsyncEnumerable<ReadOnlyMemory<byte>> instead of IAsyncEnumerable<byte[]>.

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated example to reflect change from IAsyncEnumerable<byte> to IAsyncEnumerable<ReadOnlyMemory<byte>>

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Avoiding allocation by using MemoryMarshal instead of .ToArray() to create MemoryStream from ReadOnlyMemory<byte>.

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Performance updates to minimize unnecessary byte array copies and eliminate unnecessary allocations.

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Removed unnecessary return from SendPlaintextStreamAsync and SendCiphertextStreamAsync methods

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated exception text to be more specific as to what's wrong with the input value.

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Minor tweak to prefer using using a Memory

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Deduplicated some of the Decrypt methods, simplifying the implementation

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Eliminated duplicate encryption method, simplifying implementation

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated to eliminate an unnecessary `await` and `async foreach`.

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated stream example to reflect the changes to the API shape

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Added notes about operations with stream-based data

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

---------

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
2024-02-14 11:29:08 -08:00
Yash Nisar 17f849b175
Remove .NET Core 3.1 support and standardize on .NET 6 (#1045)
* Remove .NET Core 3.1 support and standardize on .NET 6

Signed-off-by: Yash Nisar <yashnisar@microsoft.com>

* Remove support for .NET 5 as well

Signed-off-by: Yash Nisar <yashnisar@microsoft.com>

---------

Signed-off-by: Yash Nisar <yashnisar@microsoft.com>
2023-08-24 11:04:02 -07:00
Shivam Kumar e7a71c423a
removing Obsolete attribute from config API classes (#1098)
Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Co-authored-by: halspang <70976921+halspang@users.noreply.github.com>
2023-05-24 14:05:33 -07:00
Yash Nisar f42b690f4c
Merging changes from 1.10 to master (#1047)
* Update DurableTask SDK dependency to get ARM64 compatibility (#1024) (#1025)

* Update DurableTask SDK dependency to get ARM64 compatibility

* Fix issue with gRPC address override behavior

Signed-off-by: Chris Gillum <cgillum@microsoft.com>

* Initial Bulk Subscribe functionality (#1009)

Signed-off-by: Yash Nisar <yashnisar@microsoft.com>

* Workflow unit testing changes for 1.10 release (#1038)

Signed-off-by: Chris Gillum <cgillum@microsoft.com>

* Fix issue with gRPC address override behavior

Signed-off-by: Chris Gillum <cgillum@microsoft.com>

* Workflow SDK changes to enable unit testing

Signed-off-by: Chris Gillum <cgillum@microsoft.com>
2023-02-27 14:42:32 -08:00
Yash Nisar 1605ecd90e
Implement Bulk Publish functionality (#1001)
Closes https://github.com/dapr/dotnet-sdk/issues/958

Signed-off-by: Yash Nisar <yashnisar@microsoft.com>

Signed-off-by: Yash Nisar <yashnisar@microsoft.com>
Co-authored-by: halspang <70976921+halspang@users.noreply.github.com>
2023-01-26 11:34:09 -08:00
halspang 5a7e59fce3
Remove debug statement from configuration example (#949)
Signed-off-by: Hal Spang <halspang@microsoft.com>
2023-01-23 12:04:22 -08:00
halspang b8766b9df5
Add method to publish without client serialization (#1010)
This commit adds the ability to publish raw bytes instead of using
the serialization that is built into the client.

https://github.com/dapr/dotnet-sdk/issues/718

Signed-off-by: halspang <halspang@microsoft.com>
2023-01-23 11:41:37 -08:00
Yash Nisar 1efe1fa30b
Add support for Bulk State, i.e. SaveBulkStateAsync(...) method (#962)
* Add support for Bulk State, i.e. SaveBulkStateAsync

Closes https://github.com/dapr/dotnet-sdk/issues/785

Signed-off-by: Yash Nisar <yashnisar@microsoft.com>

* Update examples to include support for Bulk State

Closes https://github.com/dapr/dotnet-sdk/issues/963

Signed-off-by: Yash Nisar <yashnisar@microsoft.com>

Signed-off-by: Yash Nisar <yashnisar@microsoft.com>
2022-10-31 11:06:27 -07:00
amulyavarote 56017dd94a
Changed distributedLock example to consider a new default port number (#966)
* Changed distributedLock example to consider a new default port number

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Changes based on the review comments

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>
Co-authored-by: halspang <70976921+halspang@users.noreply.github.com>
2022-10-24 13:10:46 -07:00
amulyavarote 5043b9f8c3
Configuration API changes to support dictionary type response (#943)
* Added config class changes

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Changed examples, extension files and tests to support dictionary

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Changes based on the review comments

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>
Co-authored-by: halspang <70976921+halspang@users.noreply.github.com>
2022-09-13 15:10:46 -07:00
amulyavarote 2ab1b7cee0
Added new links to client folder in example (#938)
Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>
2022-08-25 15:48:41 -07:00
Marcos Candeia a57375f343
Upgrade grpc.tools version to 2.47.0 for supporting arm64 architecture (#920)
* Upgrade grpc.tools version to 2.47.0 for supporting arm64 architecture

Signed-off-by: Marcos Candeia <marrcooos@gmail.com>

* Upgrade Grpc.* packages to version 2.47.0

Signed-off-by: Marcos Candeia <marrcooos@gmail.com>

Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
2022-08-10 12:43:50 -07:00
amulyavarote 016545ac0d
Added dotnet methods for Distributed Lock API (#886)
* Added dotnet methods for Distributed Lock API

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Changes based on the review comments

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Changes in examples to make them real world - based on the PR review

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Fixed application log statements

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Changes to implement IDisposable

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Changes based on the review comments

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Added a sample test case for TryLockResponse

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Changes based on the review comments - 2

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Reworking the DistributedLock example

Signed-off-by: Hal Spang <halspang@microsoft.com>

Co-authored-by: Hal Spang <halspang@microsoft.com>
2022-06-29 10:23:37 -07:00
halspang cda60cb382
Add Subscribe/Unsubscribe API support (#848)
Add Subscribe/Unsubscribe API support

This commit adds support for both the subscribe and unsubscribe
APIs for Darp's Configuration building block. The configuration can
now be exposed through the AspNet builder pattern or by making the
request directly with the DaprClient.

https://github.com/dapr/dotnet-sdk/issues/822

Signed-off-by: Hal Spang <halspang@microsoft.com>
2022-05-26 14:43:34 -07:00
halspang 3553899235
Update Google.Protobuf to 3.15 (#850)
Signed-off-by: Hal Spang <halspang@microsoft.com>
2022-03-23 10:51:41 -07:00
halspang f5169cbe5f
Add support for the GetConfiguration API (#812)
This commit adds support for the GetConfiguration API. This is an
alpha API and may be subject to change. This commit also does not
cover the Subscribe API for Configurations.

Included is a simple example showing the usage of the Configuration
API.

https://github.com/dapr/dotnet-sdk/issues/787

Signed-off-by: Hal Spang <halspang@microsoft.com>
2022-01-12 17:07:48 -08:00
Dmitry Shmulevich 0c9d6a45c8
replaced license headers (#802)
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com>
2021-12-10 13:39:06 -08:00
Charlie Stanley ff25eb0bb1
Update Grpc to 2.38.1 which has arm64 support (#730)
Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2021-08-17 13:51:38 -07:00
Aaron Crawfis eb568116e5
SDK Docs (#572)
* Setup dapr docs content

* Update SDK docs for new format

* Update daprdocs/content/en/dotnet-sdk-contributing/dotnet-contributing.md

Co-authored-by: Ryan Nowak <nowakra@gmail.com>

* Update daprdocs/content/en/dotnet-sdk-contributing/dotnet-contributing.md

Co-authored-by: Ryan Nowak <nowakra@gmail.com>

* Update python reference

* Update samples to examples

* Update layout

* Update prereqs

* Apply correct branding for .NET Core vs .NET

* Update examples/Client/StateManagement/README.md

* fix solution file

Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2021-02-16 22:15:33 -08:00