Roundup #67: Cert Expiration Check, Should I use MicroServices? StackOverflow Survey, gRPC-Web

Here are the things that caught my eye recently in .NET.  I’d love to hear what you found most interesting this week.  Let me know in the comments or on Twitter.

Certificate Expiration Check

I thought this was a pretty cool idea and an easy way to keep track of expiring certs.

Link: https://github.com/ardalis/CertExpirationCheck

Should I Use A Microservices Architecture?

Are you considering adopting a microservices architecture? Won’t it fix all your problems? Join me for a look into the realities of microservices!

Link: https://www.jamesmichaelhickey.com/microservices-architecture/

2020 Stack Overflow Developer Survey

Thank you for taking the 2020 Stack Overflow Developer Survey, the largest and most comprehensive survey of software developers (and anyone else who codes!) on Earth. 

Link: https://stackoverflow.az1.qualtrics.com/jfe/form/SV_eL0mFVwuo7KWeXP

A new experiment: Call .NET gRPC services from the browser with gRPC-Web

I’m excited to announce experimental support for gRPC-Web with .NET. gRPC-Web allows gRPC to be called from browser-based apps like JavaScript SPAs or Blazor WebAssembly apps.

gRPC-Web for .NET promises to bring many of gRPC’s great features to browser apps:

Strongly-typed code-generated clients
Compact Protobuf messages
Server streaming

Link: https://devblogs.microsoft.com/aspnet/grpc-web-experiment/

Enjoy this post? Subscribe!

Subscribe to our weekly Newsletter and stay tuned.

Message Sender: Who Sent the Command/Event?

Message Sender

When handling a message, regardless if it’s a command or event, you often want to know who sent the message. Who was the message sender? Not the service, but the actual user who initiated it. If it’s a command then who invoked it. If it’s an event, who invoked the command that changed state within the system that created the event.

This post is in a series related to messaging. The overview is available in my Message Properties post.

Authorization

The most common reason for wanting to know who sent a message is to determine if they are authorized to perform whatever action is being done by a command. The same can apply for events and event handlers. The task of an event handler may be conditional on who caused the event in the first place.

SenderID

This can be as simple as including a SenderID along with your message data. A simple example based on other posts in this series:

The SenderID would represent a way for your server to identify who is sending the message. This could be a unique identifier of a user within the system.

ID Token

Another option is to include an ID Token.

ID Tokens are a similar idea but used mainly in token-based authentication. It provides a more performant way of accessing the user profile and access rights. Basically it’s a cached copy of the user profile that was generated when the user authenticated.

One concern here is if you are persisting messages for any length of time, and processing them later, you need to be aware that the ID Token may have expired and may no longer exist in the cache. ID Tokens generally have a lifetime and your message storage may not.

The benefit is access to authorization information that you may need when processing a message. Is the sender authorized to perform an action?

Message Sender

If you have any other ways you like to keep track of the sender, let me know in the comments or on Twitter.

Related Links

Enjoy this post? Subscribe!

Subscribe to our weekly Newsletter and stay tuned.

Roundup #66: Capturing the World in Software, Conventional, Polymorphic classes with System.Text.Json, Blazor WebAssembly 3.2.0 Preview 1

Here are the things that caught my eye recently in .NET.  I’d love to hear what you found most interesting this week.  Let me know in the comments or on Twitter.

Capturing the World in Software

If event sourcing is not scalable, faster, or simpler, why use it?

Event Sourcing gives you a complete, consistent model of the slice of the world modeled by your software. That’s pretty attractive.

Link: https://blog.jessitron.com/2020/01/24/capturing-the-world-in-software/

Conventional

After this tweet by Dave Glick, I found this package that I thought was pretty interesting. Check out the twitter thread for a lot of good info.

Link: https://github.com/andrewabest/Conventional

Deserializing JSON into polymorphic classes with System.Text.Json

While working on SpaceDotNet, a strong-typed client SDK to access the JetBrains Space HTTP API, I came across a scenario to deserialize JSON into polymorphic classes. In this post, I’ll explain how to write a custom JsonConverter for System.Text.Json to help with deserialization for such cases.

Link: https://blog.maartenballiauw.be/post/2020/01/29/deserializing-json-into-polymorphic-classes-with-systemtextjson.html

Blazor WebAssembly 3.2.0 Preview 1 release now available

Today we released a new preview update for Blazor WebAssembly with a bunch of great new features and improvements.

Here’s what’s new in this release:

  • Version updated to 3.2
  • Simplified startup
  • Download size improvements
  • Support for .NET SignalR client

Link: https://devblogs.microsoft.com/aspnet/blazor-webassembly-3-2-0-preview-1-release-now-available/

Enjoy this post? Subscribe!

Subscribe to our weekly Newsletter and stay tuned.