Commit Graph

339 Commits

Author SHA1 Message Date
Ryan Nowak 0632ea8e81 Fix broken test
For some reason this project isn't being run by the CI
2021-01-11 14:39:47 -08:00
Ryan Nowak 5e0b5750fb
Remove GetAllStateNamesAsync (#536)
Fixes: #53

This API was intended to query the state store for all existing state
entries for the actor. However support for this in the dapr runtime has
not be implemented. We're removing this API to avoid confusion since
it does not behave as expected. We can revisit this in the future based
on feedback.
2021-01-11 11:21:16 -08:00
Sander Molenkamp afc87abe7d
Replace ValueTask with Task (#539) 2021-01-11 10:27:40 -08:00
Ryan Nowak fdc35bbbaf
Do not write exception to response body (#535)
Fixes: #410

This change removes code that would write the exception message and call
stack to the response body when a non-remoting invoke is used. While
this kind of thing can be helpful for debugging, the best thing to do is
actually just let the exception bubble. This allows users to use the
ASP.NET Core error handling features that are much richer and have
security related guidance built-in.
2021-01-08 14:33:25 -08:00
vinayada1 9413ed3f99
fix exception with ActorProxy (#530)
* fix exception with ActorProxy

This reverts commit b599b57f65.
2021-01-08 13:57:43 -08:00
Per Ökvist 50dec32e8a
state operation overload with meta #412 (#470)
* state operation overload with meta #412

* added metadata to bulk state

* getStateAndEtag with metadata test

* an -> a keyvalue pair

* Added GetBulkStateAsync_ValidateRequest

* update

* update

* removed backup files

* metadata docs

* state store metadata docs

Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2021-01-08 11:45:34 -08:00
Ryan Nowak 3a03ada243
Use Startup to register Actors (#533)
Fixes: #434

This change introduces new APIs for registering Actors DI and with
the HTTP pipeline based on the ASP.NET Core Startup.cs model. This
replaces `UseActors()` in Program.cs and delivers better integration
between the ASP.NET Core framework and Actors.

The bug that motivated this change was that the actors HTTP handlers
were separate from the application's main routing table. This meant that
certain routing patterns were totally broken (such as Blazor Server)
when used in the same project as actors. There was no real way to fix
this without a change in how we register the framework to make it more
consistent with other features that build on ASP.NET Core.
2021-01-08 11:30:07 -08:00
Arghya Sadhu 67d59502bf
rename name to bindingName for API consistency (#504)
Signed-off-by: Arghya Sadhu <arghya88@gmail.com>

Co-authored-by: vinayada1 <28875764+vinayada1@users.noreply.github.com>
2021-01-05 13:49:37 -08:00
vinayada1 c650955f75
rename InvokeAsync to InvokeMethodAsync (#529) 2021-01-05 13:41:41 -08:00
Carlos Mendible 9fd1900e59
Fixing 502 (#503)
Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2021-01-04 17:50:52 -08:00
Ryan Nowak 776156298e
Apply linting suggestions (#492)
We've had a list of linting-related messages piling up for a while now.
This change bulk-applies these suggestions with usually relate to
simplification or use or newer language features like ??=

The only changes I did manually here are:

    Removing some usage of Task.GetAwaiter().GetResult() where it was
    just laziness
    Removing some dead code in methods and parameters of internal APIs.
2021-01-04 17:35:57 -08:00
Ryan Nowak d54419526f
Add .NET 5 testing (#458)
DO NOT MERGE - just testing this against the RC. We'll merge this
once 5 is a full release.
2021-01-04 11:13:35 -08:00
vinayada1 39c6d8ca7d
Merge release-1.0.0 into master (#518)
* update proto files (#507)

* fix samples (#509)

* fix docs (#515)
2020-12-18 11:12:39 -08:00
Ryan Nowak 490e522716
Update actor docs for 0.12 changes (#501)
Co-authored-by: vinayada1 <28875764+vinayada1@users.noreply.github.com>
2020-12-18 10:37:05 -08:00
vinayada1 1edfdf447b
Change package versioning from preview to rc (#506) 2020-12-14 15:38:27 -08:00
vinayada1 d694698b4f
add sample for state apis with etags (#498)
* add sample for state apis with etags

* fixed review comments
2020-12-07 14:45:40 -08:00
vinayada1 eeaf42ff22
Timers (#485)
* init commit

* working changes

* fix review comments

Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2020-12-07 12:52:07 -08:00
Carlos Mendible 28bcbf9e3b
Resurrecting Secret Store Configuration Provider (#465)
* Resurrecting secret store extension

* Resurrecting secret store extension

* Trigger Build
2020-12-07 10:43:45 -08:00
Daniel Stoyanoff 5f38e63afc
#496 - add a check if there is no BindingInfo for action parameters (#497)
* #496 - add a check if there is no BindingInfo for acton parameters

* #496 - replace if with elseif

Co-authored-by: Daniel <daniel.s@appgr8.com>
2020-12-04 15:08:20 -08:00
vinayada1 310addbb92
Fix documentation (#495) 2020-12-03 13:22:01 -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
Ryan Nowak e95a5567f2
Implement dependency injection for Actors (#463)
* Implement dependency injection for Actors

Fixes: #171

This change allows Actors to accept dependency-injected services through
constructor parameters.

There are numerous breaking changes in this PR that are visible to user
code. In most cases these are simplifications.

For example the Actor base class accepted 3 constructor parameters,
which meant that every subclass (every actor type) also had 3 constructor
parameters. This isn't fun and becomes way less fun now that users can
add their own constructor parameters in a meaningful way.

As another example, we had multiple places where "runtime options" lived
that had different interaction patterns. Now there's a single options
type and you interactive with it through UseActors(...).

* address PR feedback

* React to API change
2020-12-01 10:15:08 -08:00
vinayada1 6a5d8ea09d
remove binaryformatter (#456)
* remove binaryformatter
2020-11-30 16:24:10 -08:00
Ryan Nowak 116d984b4e
Rename and cleanup of HTTPExtension (#488)
* Rename and cleanup of HTTPExtension

Fixes: #421

This change renames `HTTPExtension`->`HttpInvocationOptions`. This is more
idiomatic in .NET and reflects existing naming conventions (options or
settings for parameters).

Also changes to use the `System.Net.Http.HttpMethod` type for the http
method, and globally prefer the term `method` over `verb`. Every .NET
API that I'm aware of uses 'method', as does rfc7231.

* One more rename
2020-11-30 12:11:44 -08:00
vinayada1 47b59b4a97
remove unused field contenttype (#479) 2020-11-19 11:26:27 -08:00
vinayada1 80f2319fe4
Handle rpc exception thrown for operation cancellation (#455)
* Handle cancelled cancellation token

* add UTs

* add secrets UT

* fix review comments

* invoke and await in one call

* fix await

* Add test for multiple calls to UseActors (#459)

Fixes: #411

The bug was actually addressed in PR #453 - this change adds a test that
verifies that we actually fixed it.

Co-authored-by: vinayada1 <28875764+vinayada1@users.noreply.github.com>

* use grpcChannelOptions ThrowOperationCanceledOnCancellation

* Add doc

* add link to doc

Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2020-11-19 11:22:33 -08:00
vinayada1 d0786b4f55
removed ActorTypeInformation public constructor (#480) 2020-11-19 10:59:06 -08:00
Dasith Wijesiriwardena f6f434d6e6
Fluent methods for creating and manipulating HTTPExtension (#473)
* HTTPExtension fluent methods

* add tests

Co-authored-by: vinayada1 <28875764+vinayada1@users.noreply.github.com>
2020-11-17 12:58:02 -08:00
Ryan Nowak 721ea4a1be
Add test for multiple calls to UseActors (#459)
Fixes: #411

The bug was actually addressed in PR #453 - this change adds a test that
verifies that we actually fixed it.

Co-authored-by: vinayada1 <28875764+vinayada1@users.noreply.github.com>
2020-11-16 13:00:38 -08:00
vinayada1 6ce5e319fd
fix docs (#475) 2020-11-13 14:02:01 -08:00
vinayada1 d8fa3cdcc4
update proto files for rc release (#468) 2020-11-11 09:57:35 -08:00
Ryan Nowak 7d1fa13101
Make ActorId deserializable (#457)
Fixes: #444

ActorId doesn't define a default constructor, and so it's not
deserializable via System.Text.Json.

This change implements a converter so that ActorId's API shape can work
with the serializer properly.

I added an integration test for ActorReference as well, but no library
changes we needed for that, ActorId was the blocker.
2020-11-05 15:10:38 -08:00
vinayada1 29d0f7c38c
naming convention (#460) 2020-11-04 14:09:50 -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
vinayada1 0ccddf73ff
Logging changes to use ILogger (#453)
* logging changes to use ILogger

Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2020-10-30 13:09:32 -07:00
Ryan Nowak aa682eb462
Remove async void in tests (#447)
Fixes: #446

`async void` is almost always a bug in server-side programming. If these
tests were doing any networking then they would encounter concurrency
bugs or crash in the event of an exception.

Co-authored-by: vinayada1 <28875764+vinayada1@users.noreply.github.com>
2020-10-29 15:54:17 -07:00
Carlos Mendible 3b1538be9f
Fix: --dapr-http-port param is now --port (#451)
Fixing command:  `--dapr-http-port` parameer is now `--port`

Co-authored-by: vinayada1 <28875764+vinayada1@users.noreply.github.com>
2020-10-29 14:20:02 -07:00
Ryan Nowak bf1d83e68e
Add coverlet output to gitignore (#448)
Makes sure we exclude the generated `coverage.json` files from git. We
don't want these to get accidentally committed if someone is running
coverage on their own machine.
2020-10-28 12:56:35 -07:00
Aaron Crawfis b07675c001
Merge pull request #449 from dapr/docs-updates
Update Dapr docs links
2020-10-26 15:38:18 -07:00
Aaron Crawfis e79cc88dbd Update Dapr docs links 2020-10-23 11:32:11 -07:00
Charlie Stanley 39f3f71445
Merge pull request #443 from wcs1only/code-coverage
Added codecov integration (#436)
2020-10-20 12:15:11 -07:00
Charlie Stanley ab3f45e7e1 Added codecov integration (#436) 2020-10-19 19:06:21 -07:00
Artur Souza 731234e38d
Adds instructions for release notes in issue templates. (#438) 2020-10-16 14:01:37 -07:00
Ryan Nowak cd781248c7 Remove static instance of ActorRuntime
Contributes to: #416

This change removes a mutable static instance - this is low-hanging
fruit design improvement and helps us make these features more flexible
in the future.
2020-10-15 16:53:32 -07:00
vinayada1 a061b726b6
use Guid to generate unique Actor id (#428) 2020-10-15 14:18:20 -07:00
Nghia Tran 29af055cb1
Merge pull request #430 from tcnghia/no-set-env
Remove set-env due to CVE-2020-15228
2020-10-15 10:52:45 -07:00
Nghia Tran 0ac85274d4
Merge branch 'master' into no-set-env 2020-10-14 11:25:47 -07:00
vinayada1 2d83efb4c9
grpc exception handling sample (#427)
* rpc exception handling
2020-10-14 10:15:42 -07:00
Nghia Tran 63999da568 Remove set-env due to CVE-2020-15228
Fixes https://github.com/dapr/dotnet-sdk/issues/417
2020-10-13 18:45:45 -07:00
Ryan Nowak 701244e367 Update requirements in readme to reflect reality
- remove references to specific VS versions (these will quickly become
  stale and can be confusing because VS wants you to live on the latest
  version).
- include mac/linux instructions
2020-10-10 19:04:00 -07:00