How to deploy static sites with git

As part of my contribution to a recent Random Hacks of Kindness event, I needed to put together a simple deployment mechanism for the static part of the site. The idea was to use a simple git push to trigger a deployment to production. There was a lot of documentation out here on the web about this, but there were many pitfalls along the way that I thought I’d document here to help others attempting to do the same. [Read More]

Dropwizard with OpenID

Dropwizard is an excellent framework to create lightweight web services with. Out of the box it comes with a wide range of useful features that just make developing web services a pleasure. In particular, support for Basic authentication and OAuth2 are pretty much required for any web service that is public facing these days - and why aren’t you employing secure web services internally? Criticism aside, one common authentication technique appears to be missing: OpenID. [Read More]

How to include Markdown with Freemarker in Dropwizard

One common problem that web developers face is the elegant handling of rich text received from their users which should be rendered as HTML. Obviously, accepting raw HTML from unknown sources is a major security risk. Fortunately, this problem has been solved through the use of Markdown which requires only an easily readable text document from your users. If you’re looking for a portable rich text solution for documentation and requirements specifications then Markdown is a great solution. [Read More]

MultiBit Merchant - Implementing HMAC authentication in Dropwizard

As part of my ongoing open source project MultiBit Merchant (MBM) I am keeping a journal of my discoveries and thoughts along the way. This one deals with how I implemented HMAC authentication for Dropwizard as part of the security for the MBM RESTful API. There is a lot of ground to cover so this is going to be a long one. I’ve added lots of code examples but these will drift out of date so I’d recommend reviewing the source code of the MBM project to get the latest implementations. [Read More]

How to implement a RuntimeExceptionMapper for Dropwizard

One common problem that web developers face is the elegant handling of exceptions in their applications. You want to give the browser the correct response code (e.g. 404 or 500), but you also want to ensure that the user experience of that failure maintains the style of the overall site. The default Dropwizard behaviour is rather minimal in this area (by design) and so I thought I’d post up an implementation to act as a starting point for others to use: [Read More]