Authservices StubIdp Improvements: AttributeStatements and User Lists

This is an announcement of two new related features in the Authservices SAML2 StubIdp, AttributeStatements and user lists.

AttributeStatements

Until now the only identification related element supported by the StubIdp was the Subject NameID.
In many SAML2 installations additional data, like roles and full name, are included as AttributeStatements. This has been supported by the AuthServices library, but it has not been possible to generate testdata with the StubIdp.
Now we have implemented a dynamic list of AttributeStatements in the StubIdp.

BurstFilter for log4net – How to Save Your Mailbox

This is a guest post by Albin Sunnanbo, introducing a burst filter preventing log4net from filling up a support mailbox.

One Friday afternoon, just before leaving for the weekend, I glanced at our support mail inbox. inbox
The unread counter was literally spinning. Three mails a second.

To make a long story short we had two problems.

  1. A lost db connection due to a DNS failure.
  2. A mail logger that tried to nuke Outlook into oblivion. A mail logger that took a while to stop because we could not reach our server due to the aforementioned DNS failure.

This incident taught us two lessons. Write down the IP addresses of all your servers and throttle your logging.
That project mentioned above used Enterprise Library Logging block.
When starting a new project I decided to try log4net for logging. I also decided to not repeat previous mistakes.

Pickup Mail Viewer

This is a guest post by Albin Sunnanbo introducing a great hack to work with mails in test environments.

If you have a .NET application that sends emails, this is probably something for you.

TL;DR;

PickupMailViewer is a simple web viewer for emails saved by the specifiedPickupDirectory SMTP setting in a .NET application.
Download the source, publish to your test server, configure pickup directory and you should be up and running within five minutes.

Outgoing Emails in Test Environments

In your test environment will typically not send real emails, but rather use the specifiedPickupDirectory delivery method for your SMTP-settings in web.config. This puts all outgoing emails as *.eml files in the file system instead of sending real emails.

IMHO that is the way to go regarding emails in your test environment.

However, there is one drawback, the emails gets dropped in a folder somewhere on your test server. Typically in a location that nobody looks at regularly. In my case I first have to connect a VPN, then open a remote desktop connection to our server, open the folder and copy the desired file back to my own computer (no eml viewer, a.k.a. Outlook, on the test server) and finally open it in Outlook.
Even worse for our testers that don’t even have permissions to login on the test machine. They have to ask a developer to get their emails out of the test system. As you can imagine this only happens when it is absolutely necessary.

Solving the set Startup Projects bug in Visual Studio

This is a guest post by Albin Sunnanbo sharing how a mysterious Visual Studio problem made the Set Startup project command fail.

In one of our projects at work we had this mysterious problem with Visual Studio, both 2012 and 2013. It happened to some developers and some machines. When I got a new computer a while ago I was hit with this dreaded bug too. This is a story about how to use available clues to succeed with solving even the strangest problems.

When trying to set multiple startup projects in Visual Studio we right click solution, click Set StartUp Projects…
StartupProjectsBug-1
and expect the familiar dialog to pop up. But no, the menu disappears and then nothing happens. No dialog. Nothing.
If we click Properties instead we get an ugly dialog with the text “Object reference not set to an instance of an object.”

StartupProjectsBug-2
That poor dialog is pretty famous, it got something like a quarter of a million hits on Google. More than I’ll ever get.
Nothing on the top five Google pages seemed to help. We finally found a workaround. Uninstall NuGet package manager, set your startup projects, reinstall NuGet package manager. Not particularly elegant, but at least we could proceed with our regular work.

Regression Testing Processing Algorithms

This is a guest post by Albin Sunnanbo sharing experiences on regression testing.

On several occasions I have worked with systems that processed lots of work items with a fairly complicated algorithm. When doing a larger rewrite of such an algorithm you want to regression test your algorithm. Of course you have a bunch of unit tests and/or integration tests that maps to your requirements, but unit tests tends to test systems from one angle and you need to complement with other test methods to test it from other angles too. We have used copy of production data to run a comprehensive regression test with just a few hours of work.

Our systems had the following workflow

  1. Users or imports produces some kind of work item in the system, i.e. orders.
  2. There is a completion phase of the work where the user commits each work item and make the result final, i.e. sends the order.
  3. Once each item is final the system processes the work item and produces an output that is saved in a database before it is exported to another system.

We have successfully used the following approach to regression testing for those kind of algorithms.

Software Development is a Job – Coding is a Passion

I'm Anders Abel, an independent systems architect and developer in Stockholm, Sweden.

profile for Anders Abel at Stack Overflow, Q&A for professional and enthusiast programmers

Code for most posts is available on my GitHub account.

Popular Posts

Archives

Series

Powered by WordPress with the Passion for Coding theme.