* 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.
* 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>
Non-reentrant actors can utilize their state manager's cache
for repeated calls. They should still be able to do this unless
using reentrancy.
Co-authored-by: Ryan Nowak <nowakra@gmail.com>
* Add support for Actor Reentrancy
This commit allows for the Dapr-Reentrancy-Id header to be
propogated through an actor's call chain which lets the dapr
runtime allow reentrant calls.
https://github.com/dapr/dotnet-sdk/issues/661
* Add unit/e2e tests for Actor Reentrancy
* Introduce state isolation for actor reentrancy
* Move state context to be fully AsyncLocal
Moved the UseHttpsRedirection to the else block of the IsDevelopment
check, and add a comment describing why.
The Dapr runtime reports and error and aborts the request after an HTTP
redirection. By default ASP.Net Core uses port 5000 for HTTP, and port
5001 for HTTPs. This means that if the instructions are followed exactly
the example won't work. The VSCode extension also breaks.
Call `Type.GetTypeFromHandle` when calling
`IActorRequestMessageBody.GetParameter`
The code that generates the `IActorRequestMessageBody` parameter setup
for the dispatched call is technically incorrect, as it passes a
`RuntimeTypeHandle` to a method expecting `Type`. The correct thing to
do is to call `Type.GetTypeHandle` first to perform the conversion.
Fixes: #664
This fixes an issue where we're not passing the serializer options to
the deserialize method for a user-specified payload. This was just an
oversight and did not behave as expected when users have customized the
settings.
Fixes: #655
This fixes a functional bug in how we initialize the default settings of
based on the `DAPI_API_TOKEN` environment variable.
Additional, the `CreateInvokeMethodRequest` family of methods were
missing API token support. This has been added.
* Unit testability for timers and reminders
Fixes: #575
This change adds abstractions for Actors timer and reminder
functionality, making them possible to unit test. Previously these
features were wired from the Actor class directly into the client
functionality, and there was no way for a user of actors to write their
own tests when they include this functionality in their code.
Making this work required a lot of munging of basic data types because
we need to *extract* a layer of functionality into a testable API.
I also added a helper method for tests to create an actor host with
mocks attached. We'll likely need to do more in the future to support
testability for actors. I started this process by adding some "unit
test" unit tests. The only way to test that you can test is by testing
:).
----
Additionally I added E2E tests for actors timers and reminders and
improved some of the existing test functionality.
The big investment here is to change the layering of tests to ensure
that we only need to start one instance of the test app at a time.
Previously we'd start and stop the test app as part of the only test we
have. Adding more tests means we want to avoid this overhead when
possible.
This is specifically a challenge for actors since the assocation of an
actor type to an app id is **global state**. We want to keep the app
process we're using for tests long-lived to avoid classic distributed
systems problems (like the host going away) inside our tests.
* Dedupe code for initializing defaults