Shannon Cochran

RC Week 3 - Deciding on an approach to handle safely running user input as code

Today was a shorter day for me but I made some progress on my ruby-version-of-leetle/wordle app.

I realized I was dragging my feet on making some design decisions on how to handle user input as code that I would run. I first thought I might just use eval() because it is just a demo app but I read a lot about how dangerous it is and decided to look for some alternatives. I didn’t want to set up containers or sandboxes and really just wanted a solution that would be good enough for a small app. A fellow recurser had mentioned a tool called Piston and I decided to use their apisince that seemed like the way to go with the least amount of set up on my end. I might do something else later but for now, this is good enough to move me forward.

Here's a tiny ruby script I used to test out hitting piston. I haven't used HTTParty a ton, but it reminds me a lot of the Python requests library