I am currently sketching out a project I am doing at my job, where I will have a self hosted WebAPI, connected to a serial device, where the app I am creating will configure that device. No, it is not a Raspberry PI :)So instead of having a database as a data source for the API, I would makecalls to the serial device. I think that it is a pretty neat idea, and I can usethe usual methodology for developing APIs.So, I have one or two questions that I could use some help with.Question 1: My company has a limited amount of these serial devices for testing purposes, so I can not rely on having a device every time I want to test my newly written code. So is it a good idea to have a flag in the http-request that specifies whether the api should get the data from the serial device or get testdata from say a document? I was thinking about a OWin middleware that can route the call to the correct service.Question 2: Security. Since the selfhost API would be installed on the users local computer, and the webapp would only call localhost, is there any need to think about security and authentication and the like? The websuite that is present in my company has a authentication solution already, so is that enough? I always struggle when it comes to security concerns, so I have no confidence in my reasoning ability on that subject :)
security in selfhost web api
.net;testing;security;api design