Enforcing authorization on operation level is done via a dedicated attribute:
For more information on endpoint authorization, see our official documentation page.
Event Subscription Validation with CloudEvents Support
Starting from v3.2, we also support CloudEvents when validating incoming events. Previously, we only validated EventGrid events. The full explanation of how to receive and validate events is fully described in these Microsoft docs. The short version is that in case of EventGrid events, the
Aeg-Event-Type HTTP header and that the request body contains a
SubscriptionValidation event model. In case of CloudEvents, a
OPTIONS HTTP method should be used and validation happens on the
WebHook-Request-Origin HTTP header.
Adding such an event validation to your application usually is only necessary on a single operation. Therefore, this feature is not available to be globally registered.
For more information on endpoint validation, see our official documentation page.
Strongly-Typed Event Filtering in Automated Testing
The EventGrid library provides testing infrastructure to allow integration tests run against an Azure EventGrid resource. The result of your integration test can be sent to Azure EventGrid, and the Arcus code makes sure that you receive the typed event. This way of testing is also broadly used across Arcus components (messaging, background jobs, templates) to verify if a certain piece of functionality works as expected. Once you want to test some Azure-running functionality without any access to the code, this testing strategy will help greatly.
An overview of this setup is available on our documentation site and is also shown here:
The ‘host’ runs alongside your integration tests and manages the event subscription. As test writer, you only have to concern yourself with the actual event assertion. A simple setup can look like this:
Notice that in the assertion, you can choose to receive your event with the unique identifying ID for which an event was published. In the new v3.2 version, we allow multiple ways of retrieving back your event. This makes assertion a lot easier and test-friendly because the writer doesn’t have to concern themselves with casting or deserialization. A custom filtering of the event let you choose how you want to retrieve the event back; i.e. based on the event subject, or a custom event data property. It’s all possible for both EventGrid and CloudEvent events.
For more information on the infrastructure provided for your integration testing, see our official documentation.
.NET 6 Support
This release also finally makes sure that that the EventGrid functionality can be used in .NET 6 projects. This is not the last step in fully supporting .NET 6 in Arcus, but is a major step forward.
This new version of Arcus EventGrid was long overdue. A lot of new features are finally released, together with full .NET 6 support. At time of writing, this new version is already implemented in the upcoming Arcus releases and tests. That’s how useful and reusable the library is.
See our official documentation for more information on all the currently supported features. If you have any questions, remarks, comments, or just want to discuss something with us, feel free to contact the Arcus team at Codit.
Thanks for reading!
Subscribe to our RSS feed