What I love about data annotations and validation attributes, is that the validation rules are defined very close to the class: when you open it up, you can view all the rules. The ApiController will even automatically do model validation. This is great, but I like some defense in depth; I want to be able to use those validations in my business service as well. I should not have to trust input. Let’s explore how we can make that happen.
After implementing Kiota clients with resilience, I felt the need to spend some time on unit testing them. The Kiota docs on unit testing uses NSubstitute to override the response of the adapter. After some testing (pun intended), I did not feel satisfied with the results; we should be able to use the “normal” way of testing an HttpClient, right? In this blog, I’ll show how to use the RichardSzalay.MockHttp package together with Kiota.
My new years resolution is to generate HTTP clients for services with an Open API spec. Microsoft released Kiota, a tool that generates C# classes from specs. In this blog, I’ll be looking at dependency injection and resilience.
I was working on a project that needed to call multiple webservices, so I wanted to add resilience. Luckily, Microsoft has created a HTTP Resilience package as a wrapper for Polly, adding sensible defaults. In this blog I’ll explore how easy it is to add the new package to our services, including deferring to configuration.
If you have local administrator access, you may be able to temporarily override a managed Windows 11 wallpaper by updating the registry and refreshing the wallpaper with PowerShell.
Let’s add JWT tokens to protect our API endpoints. Connecting services will supply their public keys, so we can validate their JWT tokens. We’ll use a configuration file to map tokens to local policies to restrict access to certain endpoints.
I’ve decided to upgrade the hubot-command-mapper and the bot-zero projects to ESM, just like Hubot 11. This blog will focus on how to upgrade the unit tests. In that sense it is a short rewrite of Hubot testing revisited.
At Wehkamp, we’ve been very busy with the migration of our container platform. Our (old) Blaze platform runs on Mesos, Marathon, and NGINX, but we’re shifting to a new Atlas platform, powered by Kubernetes and Istio. This setup gives us more resilience, security and auto scaling. A year ago, we successfully migrated our www-ingress to this new platform. This week, we set our sights on migrating the app-ingress for our Android and IOS backend services. Unfortunately, things didn’t go as planned…
There are many guides on how to install and configure Git on a Windows PC. As I test new developer laptops for Wehkamp, it makes sense to have some notes on how to do it. Most Windows developers use git HTTPS cloning, but this guide shows how to install and configure SSH.