Commit Graph

45 Commits

Author SHA1 Message Date
Whit Waldo 9e0672525e
Removed unused reference to FluentAssertions in light of licensing change (#1449)
* Removed unused reference to FluidAssertions in light of licensing change

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

* Removed from Dapr.AI.Test

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

* Migrated Dapr.Extensions.Configuration.Test to use Shouldly

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

* Migrated Dapr.Common.Test

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

* Migrated Dapr.Actors.AspNetCore.Test from FluentAssertions

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

* Added missing copyright header

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

* Migrated Dapr.Actors.Test

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

* Migrated Dapr.Client.Test

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

* Removed unused using reference

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

* Migrated Dapr.E2E.Test

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

* Migrated Dapr.AspNetCore.Test

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

* Migrated Dapr.AspNetCore.IntegrationTest

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

* Removed reference to FluentAssertions

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

* Fixed several unit tests

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

* Fixed another unit test

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

* Fixed more tests

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

* Fixed additional unit tests

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

* Updating more unit tests

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

* Fixed more unit tests

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

* Fixed more unit tests

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

* Fixed more unit tests

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

---------

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
2025-01-30 12:41:06 -06:00
Whit Waldo da01dcd644
Support .NET 9 (#1404)
* Updated build and integration test scripts to include .NET 9

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

* Removed unused matrix values

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

* Reverted some .NET 8 requirement

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

* Updated setup-dotnet to use latest action version + updated script to prefer a GA release, but use RC if available.

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

* Removed unnecessary secondary build step

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

* Updating TFM moniker

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

* Added test to install VStest

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

* Rolling back use of tool as it doesn't independently exist outside of the SDK

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

* Added .NET 9 to build targets

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

* Added .NET 9 to target frameworks across solution

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

* I understand the reason for the required install step now - adding it back with a .NET 9 install step

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

* Placing install steps before build

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

* Updating global.json

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

* Disabled analyzer errors in unit tests

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

* Added .NET 9 to test

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

* Changed from #pragma error to #pragma warning

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

* Fixed unit tests to resolve analyzer warning

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

* Updated integration test to always include .NET 8 and .NET 9 installs

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

* Falling back to add separate .NET 9 support
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>

* Updated referenced projects to target appropriate frameworks

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

* Added all target frameworks back to Dapr.Commono

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

* Added warnings to fix nullability analyzer warnings when targeting .NET 6

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

* Updated build step to use .NET 9 instead

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

* Fixed cloud event middleware tests - the ApplicationBuilder requires a non-null ServiceProvider per https://learn.microsoft.com/en-us/dotnet/core/compatibility/extensions/8.0/activatorutilities-createinstance-null-provider

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

* Including target for .NET 6, 7, 8 and 9

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

* Trialing fix to E2E integration test - excluding use of AppWebApplicationFactory in favor of direct use of HttpClient

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

* Reverting as it breaks the other .NET versions

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

* Potentially fixed unit tests in .NET 9

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

* Removed extra line from build definition

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

* Updated documentation to reflect .NET 9 and a note highlighting that .NET 6 and .NET 7 will be deprecated in v1.16

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

* Removed unintentionally added file to commit

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

* Added .NET 9 to E2E test setup

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

* Fixed typo

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

* Removed RC version from .NET 9 build

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

* Apparently the solution file got a minor change

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

* Removed unnecessary null checks

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

* Whoops - didn't mean to commit that project to the solution

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

---------

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
2024-12-03 23:50:42 -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
Rafael Câmara 94b97e224f
Remove unused variables (#1314)
* Remove unused variables

Signed-off-by: Rafael Camara <rafaelcamarac@gmail.com>
Signed-off-by: Rafael Câmara <52082556+RafaelJCamara@users.noreply.github.com>
Co-authored-by: Whit Waldo <whit.waldo@innovian.net>
2024-10-24 15:27:39 -05:00
Whit Waldo aa8b0fd351
Extracted Protos out to common project (#1367)
Protos pulled out to separate shared project
2024-10-16 00:36:20 -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
Manuel Menegazzo 76d2c3eada Consolidated version of coverlet.msbuild, coverlet.collector, xunit, xunit.runner.visualstudio, Microsoft.AspNetCore.Mvc.Testing, Moq to the same version in all projects.
Signed-off-by: Manuel Menegazzo <manuel.menegazzo@outlook.com>
2024-06-26 19:10:32 +02:00
Phillip Hoff 09008bb43b
.NET 8 Support (#1188)
* Update test projects to use .NET 8.

Signed-off-by: Phillip Hoff <phillip@orst.edu>

* Update SDK projects to target .NET 8.

Signed-off-by: Phillip Hoff <phillip@orst.edu>

* Update workflows to target .NET 8.

Signed-off-by: Phillip Hoff <phillip@orst.edu>

---------

Signed-off-by: Phillip Hoff <phillip@orst.edu>
Co-authored-by: halspang <70976921+halspang@users.noreply.github.com>
2023-11-15 10:48:02 -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
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
halspang 76d4b682ec
Add net7 to testing matrix (#1005)
Signed-off-by: halspang <halspang@microsoft.com>

Signed-off-by: halspang <halspang@microsoft.com>
2023-01-26 11:00:43 -08:00
saber-wang 0998b0dd4d
topicmetadata should allow adding empty strings (#940)
* topicmetadata should allow adding empty strings
Signed-off-by: saberwang <saberwang@hotmail.com>

* fix test errors
Signed-off-by: saberwang <saberwang@hotmail.com>
2022-08-29 11:42:17 -07:00
Yash Nisar e6ded69ca4
Add dead letter topic support (#929)
Closes https://github.com/dapr/dotnet-sdk/issues/897

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

Signed-off-by: Yash Nisar <yashnisar@microsoft.com>
2022-08-22 13:39:31 -07:00
saber-wang e58b1de56a
Fix the problem of determining whether there is a MetadataSeparator error (#900)
* add  original topic metadata support
Signed-off-by: saberwang <saberwang@hotmail.com>

* Add topicmetadata sample
Signed-off-by: saberwang <saberwang@hotmail.com>

* fix: v2 route metadata acquisition error
Signed-off-by: saberwang <saberwang@hotmail.com>

* feat:  Support setting metadata separator
Signed-off-by: saberwang <saberwang@hotmail.com>

* chore: Note modification
Signed-off-by: saberwang <saberwang@hotmail.com>

* style:
Signed-off-by: saberwang <saberwang@hotmail.com>

* commit
Signed-off-by: saberwang <saberwang@hotmail.com>

* fix: Whether there is a problem of MetadataSeparator judgment error
Signed-off-by: saberwang <saberwang@hotmail.com>

* TopicAttribute.Metadataseparator default should be null
Signed-off-by: saberwang <saberwang@hotmail.com>

* formatting code
Signed-off-by: saberwang <saberwang@hotmail.com>

Co-authored-by: halspang <70976921+halspang@users.noreply.github.com>
2022-07-20 08:32:33 -07:00
saber-wang 927daa48eb
add original topic metadata support (#876)
* add  original topic metadata support
Signed-off-by: saberwang <saberwang@hotmail.com>

* Add topicmetadata sample
Signed-off-by: saberwang <saberwang@hotmail.com>
2022-06-21 09:49:15 -07:00
halspang 7690e98663
Add .NET 6 build targets for tests (#823)
https://github.com/dapr/dotnet-sdk/issues/794

Signed-off-by: Hal Spang <halspang@microsoft.com>
2022-01-26 08:59:20 -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
halspang cc1b097991
Allow multiple topics to call the same endpoint (#763)
* Allow multiple topics to call the same endpoint

Using the WithTopic builder pattern allows you to specify multiple
topics that route to a single endpoint. Given the topics are unique,
this should be a valid case.

This change allows for a single endpoint to bind to multiple topics.
Note that this can only be done via the EndpointBuilder and not the
TopicAttribute.

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

* Let TopicAttribute to be specified multiple times

The endpoint builder allowed for multiple WithTopic calls so the
attribute should match that behavior.
2021-10-26 13:42:28 -07:00
Phil Kedy aba49d1446
Adding match and priority to TopicAttribute for PubSub routing. (#746)
* Adding match and priority to TopicAttribute for PubSub routing.

* Restructuring call to dapr/subscribe

* Tweak
2021-09-01 14:50:42 -07:00
Sapinder Pal Singh de84c7642d
Added support for processing raw messages. (#717)
* Added support for processing raw messages.

* Refactored code and updated subscribeendpoint tests.

* Updated file name to match class name.

* Marked subscription and metadata classes as internal.
2021-08-18 09:26:53 -07:00
Martin Björkström 9fe5485cf0
Adds Dapr authentication handler (#688)
* Adds Dapr authentication handler

- This includes functionality which simplifies securing endpoints using Dapr API Token authentication
- Fixes #682

* Remove Dapr authentication handler from examples.

* Don't resolve Dapr API token on every request, set it using delegate when configuring Dapr authentication instead.

* Adds integration tests for Dapr API token

Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
2021-08-11 17:55:59 -07:00
Martin Björkström 638bf4c6dc Adds support for providing pubsub and topic names during runtime.
- Fixes #680
2021-06-06 14:49:21 -07:00
Ryan Nowak cda2900997
Support non-JSON text in cloud events middleware (#621)
Fixes: #592

This change teaches the cloud events middleware to JSON-decode non-JSON
content when it appears in the `data` attribute in a cloud event.

There are three cases for cloud events that matter:

- data is used, content is a JSON object, datacontentype is JSON
- data is used, content is a JSON string, dataconenttype != JSON
- data_base64 is used, content is base64 bytes

We weren't handling the second of this. If you submitted the content:

`"data": "hello, "\world!\""` with datacontenttype = text/plain

You would end up with `"hello, \"world!\""` in the request body instead
of `hello, "world!"`.

This is a very subtle case, and I'm trying to fix it before users couple
their code to the wrong behavior. Since this is technically a breaking
change, I've added a opt-out so you can restore the buggy behavior.
2021-03-06 16:48:53 -08:00
Ryan Nowak 0aab615202
Add better test reporting (#591)
Our experience right now is pretty bad when tests fail, you get a
generic `failed with exit code 1`.

This change adds more full-featured integration with GitHub Actions as
well as fixes a few minor issues:

- We were missing the codecov package on one project
- Updates to test SDK
- Annotations on failing tests
- Each test project as its own status check
- Separating a parallelizing steps of the build

Co-authored-by: vinayada1 <28875764+vinayada1@users.noreply.github.com>
2021-02-19 17:02:49 -08:00
Ryan Nowak 94fc926170
Fix pattern for tests that use HttpClient (#589)
This change introduces a better API for us to test the DaprClient or
other HttpClient based APIs.

This will resolve the flakiness problems that we're seeing with some of
the actors tests.

Fixes: #573
Fixes: #588

Additionally fixed an issue where DaprHttpInteractor was misuing
HttpClientHandler. This would result in a new handler being created when
it isn't needed.
2021-02-16 10:09:34 -08:00
vinayada1 a4f6f041bc
Merge into release (#565)
*Merge master into release branch

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

Co-authored-by: Ryan Nowak <nowakra@gmail.com>
Co-authored-by: Carlos Mendible <cmendible@gmail.com>
Co-authored-by: Arghya Sadhu <arghya88@gmail.com>
Co-authored-by: Per Ökvist <perokvist@users.noreply.github.com>
Co-authored-by: Sander Molenkamp <a.molenkamp@gmail.com>
Co-authored-by: LukePammant <Luke.pammant@gmail.com>
2021-01-27 14:46:35 -08:00
Yongguang Zhu 1253cbdf71
Includes a gRPC sample (#382)
* add GrpcSample, GrpcClient; update DaprClient

* disable TLS for grpc server

* implement deposit and withdraw method for grpcsample

* implement event handler for deposit and withdraw

* edit readme for grpcsample

* improve readme

* fix @amanbha requested changes

* fix or improve readme @vinayada1 reviewed

* use parameter in DaprClient to switch invocation of routing or grpcsample service

* add separate editorconfig file into samples directory

* add license header into grpcsample

* fix TypeConverters  to use internal access modifier; remove useless code; fix Console to logger; fix typo; fix using statement location

* throw a exception when account is not found for BankingService Withdraw invocation

* remove TypeConverters dependence

* use config for rpc-exception argument

* fix comment of @vinayada1

* updated documentation for parameters usage

* fix additional comments from @vinayada1

* Update Readme.md

* fix DaprClient's compile error

Co-authored-by: Yongguang Zhu <Yongguang.Zhu@microsoft.com>
Co-authored-by: vinayada1 <28875764+vinayada1@users.noreply.github.com>
Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2020-12-02 17:52:43 -08:00
vinayada1 4c926c9469
Rich error model (#432)
* add InvokeMethodRawAsync and InvokeMethodWithResponseAsync
Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2020-10-30 13:59:33 -07:00
Charlie Stanley ab3f45e7e1 Added codecov integration (#436) 2020-10-19 19:06:21 -07:00
Leon Mai bf0354bd39
Add metadata for get/delete state apis (#383)
Co-authored-by: LM <lemai>
2020-09-01 18:27:17 -07:00
Yaron Schneider 6671ab020c
Add bulk get to client (#372)
* Add bulk get to client

* change params, return type, class to struct

* change IList to IReadOnlyList, make parallelism nullable

* change GetBulkItem to BulkStateItem
2020-08-17 09:24:35 -07:00
Gokhan Altinoren aa52a5d6a2
Fixing an issue of a null reference exception where the model binder is checked against a null BindingSource (#371) 2020-08-17 08:57:48 -07:00
Aman Bhardwaj e773243487
Returning routes for pubsub from aspnetcore integration. (#309)
* Returning routes for pubsub from aspnetcore integration.

* adding ref to System.IO.Pipelines

* updating tests

* not using RawText, using segments in route.

* fixing tests

* Logging a warning for routes with parameters

* Using ILoggerFactory
2020-05-14 15:16:55 -07:00
Aman Bhardwaj 51fc48fb74
Adding & enhancing client apis over gRPC (#244)
* adding IDAprClient interface

* Adding DaprClientBuilder and adding methods for Publish

* updating the method name for publish

* Adding unit tests for publishevent api

* Removing individual clients for publish

* Renaming base class to DaprClient and implementation calss to DparClientGrpc

* Moving State api to grpc and adding helpers to unittest grpc calls.

* More DaprClient logic

* metadata, etag, options, etc are optional

* Revert "metadata, etag, options, etc are optional"

This reverts commit ea5dc12c5d.

* Default params, 2 new Try- methods, overload refactor for InvokeMethodAsync

* Move some classes/enums to different files.  Documentation

* Code refactor and changing tests to use grpc

* Adding tests with state options

* Adding test for getting etag and state

* More refactoring and adding INvokeBinding test

* Fixing tests and tidying up things.

* Updating solutions for renamed project

* Updating projects for rename.

* Oneclient secret (#245)

* ADding Secret Apis

* Using Task for secret

* Format (#242)

* Updating samples.slm

* awaint the call to grpc in common method so that common error handling can be done there.

* Addressing review comments

* fixing test.sln

* updating prod.sln

* Addressing review comments from James.

* Add doc and example for method invocation on http app

* Updating arg validation.

* Updating example.

Co-authored-by: LM <lemai>
Co-authored-by: Carlos Mendible <cmendible@gmail.com>
2020-03-09 20:52:12 -07:00
Aman Bhardwaj ea51561f49
git gui, ading editor config and removing depenency on StyleCop.Analyzers (#228) 2020-02-18 13:21:12 -08:00
Shalabh Mohan Shrivastava 5b8a426e7d
Add support in dotnet client sdk to support multi state store support (#207)
* Including state Store name in the APIs to support multi state store scenario in SDK

* correcting the typo in the comment.

* Respective Changes to the tests

* Changes in StateAttribute and Binder classes to support state store name

* Changes in StateEntryModelBinderTests

* StoreName changes in the Integration test app

* fixing build issues

* Fixing integration tests

* Addressing review comments.

* Addressing review comments

* Updating samples to use correct state store name as generated by dapr cli.

Co-authored-by: Aman Bhardwaj <amanbha@users.noreply.github.com>
2020-02-06 09:06:21 -08:00
Ryan Nowak b02aa3f02b Add support for delete operations (#198)
* Add support for delete operations

* Removing extra spaces to fix build break.

Co-authored-by: Aman Bhardwaj <amanbha@users.noreply.github.com>
2020-01-09 09:53:13 -08:00
Ryan Nowak 793c0a4a36 Get the integration tests to calm down (#195)
Removes console spew when running the integration tests at the command
line

Fixes: #193
2020-01-08 11:36:55 -08:00
Aman Bhardwaj 34835a0224
Build for net core 3.1 (#189) 2019-12-16 09:31:25 -08:00
Aman Bhardwaj 9a499176bf Revert "Build for net core 3.1"
This reverts commit bead12b1d8.
2019-12-15 09:59:08 -08:00
Aman Bhardwaj bead12b1d8 Build for net core 3.1 2019-12-13 20:31:08 -08:00
Greg Ingram 07fa2c615d Moved to xunit for testing (#127)
* Updated Dapr.AspNetCore.IntegrationTest

* Updated Dapr.AspNetCore.Test

* Updated Dapr.Client.Test

* Updated to latest packages
2019-10-22 16:29:31 -07:00
Ryan Nowak a6ef7e451d Add middleware for unwrapping cloud events
Fixes: #74

note: This relies on the fix for dapr/dapr#574 which has been merged.

This change introduces a middleware that can upwrap a *structured* cloud
event. This is the format used by dapr by default now for pub/sub
messaging. Adding the middleware makes it transparent to the developer
whether the data can from a cloud event or was a basic RPC call.

We're adding the middleware for this first since it's the most general
approach. It has a drawback compared with other approaches, performance.

Users could alternatively use the SDK from CloudEvents to read their
data without the middleware.

We might also want to add an MVC formatter in the future, which could do
the unwrapping and deserialization to a user-type in a single operation.
2019-10-12 20:25:38 -07:00
Aman Bhardwaj 4fb29e44e3
Changing to Dapr.* (#89)
* Changing to Dapr.*

* Update readme.md

* keeping things signed
2019-10-11 13:42:30 -07:00