Now that I have some basic persistence going, I can spend some time improving things that are not so ideal. One thing I wanted to change was the URL for the public wishlist. When a wishlist is shared, the URL was only slightly different in that it had public between wishlist and ID. So, someone with access to the public url could simply remove the public keyword and have access to the owners wishlist.
Maybe in the future it will be solved with authentication but with the MVP, I wanted a no sign-in experience to reduce complexity but also lower the barrier of entry for use.


I didn’t want to store the public id because with azure tables, I only have one row key available. I decided to go with encrypting the actual ID and setting that encryption as the public ID.
I then added a new endpoint called public to separate actions allowed from the public view. Since I had already some old wishlists set up and shared, I also want it to be backwards compatible. So when we get a call from the public endpoint, we try to see if it’s a guid and if it isn’t we decrypt.
I found this library called CSharpVitamins.ShortGuid that converts a GUID to a ShortGuid and back. I then created an EncodedIdentifier which basically uses a key from appsettings to encrypt the ShortGuid.
The EncodeString and DecodeString codes were written by co-pilot. It’s really nice to have it as a tool, saves the extra step of going to google.
It did take me a while to put together the two. I probably could have done a better job if I took a TDD approach. I ended up with a few crappy tests but they were still helpful in letting me debug the encoding and decoding flow.

I updated the implementation this morning to include a factory that is created as a singleton in the application so the key is read once during creation.
Then there was updating the web application to the correct API endpoints and use the public id property.
Leave a comment