RSSAmplifier

Blog

danielwertheim

notes from a passionate developer

danielwertheim.seRSS feed ↗15 posts

Latest posts

The Journey with multi-tenancy accesses continues with some issues

Initially I set out to support a scenario where an user could be part of multiple tenants and have different permissions to each tenant. This has since changed and an user can now only belong to one tenant. The authentication part is taken care of by an external provider, but

Authenticate externally, authorize locally

Currently building a small service that has the need of multitenancy and where each user can be part of multiple tenants and have different permissions at each tenant. One solution could be to e.g. have multiple realms in a KeyCloak installation or perhaps make use of custom user attributes

How to create a NuGet metapackage

This is more of a note to myself post, but last week I had the need to create a metapackage (a package without any contents, one that just references other packages). It was a really long time ago since I did that 👴Like in the pre dotnet CLI age,

MongoDB, C# and DateTime's

Storing DateTime in MongoDB using C# is easy. Just add a property of DateTime and off you go. Easy. Right? Well, MongoDB stores all date times as UTC, but you can tell the driver to deserialize back as e.g DateTimeKind.Local , but nevertheless, it will be stored in UTC

Keycloak and multi tenancy using single Realm

Instead of setting up multiple realms or multiple client registrations, you can make use of a single realm and a single client registration and still easily support multi tenancy using Keycloak . It will be more secure to have e.g. isolated realms, as users then are separated, but I'

C# - Always valid value objects

Saw a video that was talking about the fact that using value objects provides you with always valid objects. Then it showed usage of the new'ish C# minimal construct for a record, using the positional syntax, defining some properties and then went on with life. This does of

ASP.NET, registration of a proxy-decorator service in ServiceCollection

I recently found myself, having the need of intercepting calls to a service from an external NuGet package. The Service was registered in the Service Collection via extension methods and I wanted it to be " intact ", seen to configuration and dependencies etc. I needed to register a proxy/

My employees would not have eight-hour workdays

If I ever get in a position where I have employees, they will not have eight-hour workdays as we normally have here in Sweden. A workday would have a maximum of six-seven hours. Period. During all my years as a programmer, I have never felt, that I for

GraphQL.NET and endpoint authorization in ASP.NET Core 3.1

Had my first experience with setting up a GraphQL API in ASP.NET Core 3.1 today using GraphQL-DotNet . Using their examples as inspiration to get started you'll find that there's nothing in the .NET Core sample regarding on how-to protect the endpoint that

Onboarding is one of the first chances you have to impress

When I'm closing in on the start date for a new contract at a new customer, I usually ping them to see that everything is " good to go " and what time to start etc. At one time, I thought: " Na. Let's see what

Terraform, workspaces and remote state in Azure

There are excellent resources around on how-to get started with Terraform , e.g. via Hashicorp Learn , which has contents for AWS, Azure etc. I do believe that a good solid foundation to start with should cover remote state and workspaces. Especially since they aren't that complex to

Setting Daily usage quota for an Azure Function when using Terraform

I recently had the need of setting up an Azure Function using Terraform . For this particular environment I was using the consumption plan and wanted to make use of the "Daily Usage Quota" setting. This is not supported by the azurerm_function_app config/template. I filed a

UTF-8 BOM adventures in C#

Time for a quick look at UTF-8 encoding and byte order marker (BOM). Lets jump right into some code. You are probably going to nail this as you most likely will be alert now, given the title and all, but would you have expected this test to pass? [Fact]

Using docker to generate CA, server & client certificates for TESTING

When implementing support for TLS1.2 and client-server certificate verification for MyNatsClient I needed a quick way to generate: CA, Server and Client certificates. I could of course script this and use OpenSSL but I found a small and simple docker image that simplified this process. Lets have a

New release of MyNatsClient - now 60% faster

Lately I've spent some time overhauling MyNatsClient (my open source .NET client for NATS ). I've added support for TLS1.2 and fixed a few bugs but mostly been focusing on performance. And in doing so, I've managed to increase the performance with 60%. The