I would like to introduce a new helper tool I’ve developed for integration tests – SnsTestReceiver. This my new little pet helps to test SNS allowing the assertion of the notifications published in an easy and scalable way.
Continue reading SnsTestReceiver – IntroductionTag: .net core
Docker image vulnerabilities in .NET Core
AWS ECR recently rolled out a new feature called Scan on push which makes it very easy to scan for docker image vulnerabilities once your images are pushed to an ECR repository. The results of those using .NET Core docker images might be very surprising, or not?! :)
Continue reading Docker image vulnerabilities in .NET CoreWaiting LocalStack S3 to start
In my previous blog post about LocalStack S3 setup I’ve included a hardcoded delay of 5 seconds before actually calling AWS SDK. This gives enough time when waiting LocalStack to start and be ready to accept incoming requests. However, what is actually enough?
Continue reading Waiting LocalStack S3 to startLocalStack S3 setup for .net core development
If you use AWS S3 and don’t want to use the actual bucket for one or another reason for your local development, you’ve probably come across LocalStack S3 mock for this. Especially, if you are running your apps or integration tests in Docker.
Continue reading LocalStack S3 setup for .net core developmentCustom Unauthorized response body
A quick example to illustrate an implementation of a custom Unauthorized response body in ASP.NET Core 2.1. The implementation is based on the AuthorizeFilter from Microsoft MVC framework.
Continue reading Custom Unauthorized response bodyNo RegionEndpoint or ServiceURL configured
I was setting up Amazon SQS client locally, and received No RegionEndpoint or ServiceURL configured exception. My goal was to load all AWS config values from environment variables together with a temporary session token, however I will go trough config file option as well. Apparently region value was not picked up by the Amazon SQS client.
Continue reading No RegionEndpoint or ServiceURL configuredCustom Authentication in ASP.NET Core 2.1
This blog post shows a quick example of implementing custom authentication in .NET Core 2.1 to secure your Web API. And in most cases you do want to secure your Web APIs, even though they were internal (micro)services only. If you don’t have a proper Identity provider e. g. Identity Server in place, and just need a quick solution, then a simple option is to validate Authorization header against a hardcoded value.
Continue reading Custom Authentication in ASP.NET Core 2.1.NET Core and KnockoutJS web application
From all different solutions for various problems I’ve implemented in the past I wanted to create a simple web application that I could get back to for reference any time, and this would be a fully working KnockoutJS web application. The idea was to implement a simple client contacts management application using .NET Core 1.1, Entity Framework Core 1.1, KnockoutJS, and MSTest + Jasmine for unit testing.
Continue reading .NET Core and KnockoutJS web applicationIHttpContextAccessor and Exceptions handling
Recently I’ve been working on several small .NET Core web apps and was looking for two things. Firstly, a way to access Session in a data service directly, and not just by passing HttpContext reference down from controller. And secondly, log any unhandled exceptions that occur in the application. And the answer to both questions was IHttpContextAccessor interface!
Continue reading IHttpContextAccessor and Exceptions handlingSwashbuckle and Swagger for .NET Core 1.0 validator issue
I’ve decided to write this blog post when I came across an issue with Swashbuckle trying to validate JSON file in Swagger and was failing since Swagger’s online validator was trying to fetch JSON file from an development server which is not accessible from external networks.
Continue reading Swashbuckle and Swagger for .NET Core 1.0 validator issue